-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.feature
53 lines (48 loc) · 2.22 KB
/
auth.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Feature: User management
Scenario Outline: Get a valid JWT when login
Given Kuzzle Server is running
And there is an user with id 'my-user-id'
And the user has 'local' credentials with name 'my-user-name' and password 'my-user-pwd'
When I log in as <user-name>:<user-pwd>
Then the JWT is <jwt_validity>
Examples:
| user-name | user-pwd | jwt_validity |
| 'my-user-name' | 'my-user-pwd' | valid |
| 'my-user-name-w' | 'my-user-pwd' | invalid |
| 'my-user-name' | 'my-user-pwd-w' | invalid |
| 'my-user-name-w' | 'my-user-pwd-w' | invalid |
Scenario Outline: Set user custom data (updateSelf)
Given Kuzzle Server is running
And there is an user with id 'my-user-id'
And the user has 'local' credentials with name 'my-user-name' and password 'my-user-pwd'
And I log in as 'my-user-name':'my-user-pwd'
And I update my user custom data with the pair <field-name>:<field-value>
When I get my user info
Then the response 'content' field contains the pair <field-name>:<field-value>
Examples:
| field-name | field-value |
| 'my_data' | 'mystringvalue' |
Scenario: Login out shall revoke the JWT
Given Kuzzle Server is running
And there is an user with id 'my-user-id'
And the user has 'local' credentials with name 'my-user-name' and password 'my-user-pwd'
And I log in as 'my-user-name':'my-user-pwd'
And the JWT is valid
When I logout
Then the JWT is invalid
Scenario: GetMyRights should return vector of rights
Given Kuzzle Server is running
And there is an user with id 'my-user-id'
And the user has 'local' credentials with name 'my-user-name' and password 'my-user-pwd'
And I log in as 'my-user-name':'my-user-pwd'
And I get my rights
Then I have a vector with 1 rights
Scenario: RefreshToken should return a valid token
Given Kuzzle Server is running
And there is an user with id 'my-user-id'
And the user has 'local' credentials with name 'my-user-name' and password 'my-user-pwd'
And I log in as 'my-user-name':'my-user-pwd'
And the JWT is valid
When I refresh the JWT
Then the previous JWT is now invalid
And the JWT is valid