-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path100_tokens.yml
58 lines (52 loc) · 1.11 KB
/
100_tokens.yml
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
54
55
56
57
58
---
requires:
stack: true
serverless: false
---
setup:
- do:
security.put_role:
name: "admin_role"
body: >
{
"cluster": ["manage_security"]
}
- do:
security.put_user:
username: "token_user"
body: >
{
"password" : "x-pack-test-password",
"roles" : [ "admin_role" ],
"full_name" : "Token User"
}
---
teardown:
- do:
security.delete_role:
name: "admin_role"
ignore: 404
- do:
security.delete_user:
username: "token_user"
ignore: 404
---
"Tokens":
- do:
security.get_token:
body:
grant_type: "password"
username: "token_user"
password: "x-pack-test-password"
- match: { type: "Bearer" }
- is_true: access_token
- set: { access_token: token }
- match: { expires_in: 1200 }
- is_false: scope
- do:
security.invalidate_token:
body:
token: $token
- match: { invalidated_tokens: 1 }
- match: { previously_invalidated_tokens: 0 }
- match: { error_count: 0 }