-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# What does this PR do ? Improves the DX of the Query method - Add a RawJson object that designate a string that should represent a Json Object and should not be escaped, RawJson can be given to `sdk.query` or be put anywhere in a map or object - Add RequestPayload class, mostly used in Kotlin to instantiate new query without having to use `map.put` multiples times in row - The serializer is now capable of serializing Java Objects directly
- Loading branch information
Shiranuit
authored
Mar 11, 2022
1 parent
b80d428
commit 0860d9f
Showing
46 changed files
with
461 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/check-rights/snippets/check-rights-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-auth#checkRights | ||
description: Checks if an API action can be executed by the current user | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: true |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-auth#checkRights | ||
description: Checks if an API action can be executed by the current user | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: true |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/check-token/snippets/check-token-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#CheckToken | ||
description: Checks an authentication token's validity. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/check-token/snippets/check-token-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#CheckToken | ||
description: Checks an authentication token's validity. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#CreateMyCredentials | ||
description: Creates the current user's credentials for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: catch | ||
expected: io.kuzzle.sdk.coreClasses.exceptions.ApiErrorException:\ Unknown\ authentication\ strategy\ "other" |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/create-my-credentials/snippets/create-my-credentials-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#CreateMyCredentials | ||
description: Creates the current user's credentials for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: catch | ||
expected: io.kuzzle.sdk.coreClasses.exceptions.ApiErrorException:\ Unknown\ authentication\ strategy\ "other" |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#CredentialsExist | ||
description: Checks that the current user has credentials for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: "true" |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/credentials-exist/snippets/credentials-exist-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#CredentialsExist | ||
description: Checks that the current user has credentials for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: "true" |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#DeleteMyCredentials | ||
description: Deletes the current user's credentials for the specified. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/delete-my-credentials/snippets/delete-my-credentials-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#DeleteMyCredentials | ||
description: Deletes the current user's credentials for the specified. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-current-user/snippets/get-current-user-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#GetCurrentUser | ||
description: Returns the profile object for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: ^{strategies=\[local\],\ _source={profileIds=\[default\],\ _kuzzle_info={.*}},\ _id=foo}$ |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-current-user/snippets/get-current-user-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#GetCurrentUser | ||
description: Returns the profile object for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: ^{strategies=\[local\],\ _source={profileIds=\[default\],\ _kuzzle_info={.*}},\ _id=foo}$ |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: java-Auth#GetMyCredentials | ||
description: Returns the current user's credential information for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: | ||
- {kuid=foo,\ username=foo} |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-my-credentials/snippets/get-my-credentials-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: kotlin-Auth#GetMyCredentials | ||
description: Returns the current user's credential information for the specified strategy. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: | ||
- {kuid=foo,\ username=foo} |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#GetMyRights | ||
description: Returns the rights for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: [{controller=*,\ action=*,\ index=*,\ collection=*,\ value=allowed}] |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-my-rights/snippets/get-my-rights-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#GetMyRights | ||
description: Returns the rights for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: [{controller=*,\ action=*,\ index=*,\ collection=*,\ value=allowed}] |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-strategies/snippets/get-strategies-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#GetStrategies | ||
description: Returns the rights for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: [local] |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/get-strategies/snippets/get-strategies-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#GetStrategies | ||
description: Returns the rights for the user linked to the `JSON Web Token`. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: [local] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#Logout | ||
description: Revokes the user's token & unsubscribe them from registered rooms. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/logout/snippets/logout-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#Logout | ||
description: Revokes the user's token & unsubscribe them from registered rooms. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: default | ||
expected: Success |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/refresh-token/snippets/refresh-token-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: java-Auth#RefreshToken | ||
description: Refreshes an authentication token. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: ^{jwt=.*,\ _id=foo,\ ttl=3600000,\ expiresAt=[0-9]+}$ |
4 changes: 2 additions & 2 deletions
4
doc/1/controllers/auth/refresh-token/snippets/refresh-token-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: kotlin-Auth#RefreshToken | ||
description: Refreshes an authentication token. | ||
hooks: | ||
before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo | ||
before: curl -X POST kuzzle:7512/users/foo/_create?refresh=wait_for -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' | ||
after: curl -X DELETE kuzzle:7512/users/foo?refresh=wait_for | ||
template: print-result | ||
expected: ^{jwt=.*,\ _id=foo,\ ttl=3600000,\ expiresAt=[0-9]+}$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.