-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path140_user.yml
63 lines (57 loc) · 1.23 KB
/
140_user.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
59
60
61
62
63
---
requires:
stack: true
serverless: false
---
setup:
- do:
security.put_user:
username: "juan"
body: >
{
"password": "s3krit-password",
"roles" : [ "superuser" ]
}
---
teardown:
- do:
security.delete_user:
username: "juan"
ignore: 404
---
"security.user":
- do:
security.get_user:
username: "juan"
- match: { juan.username: "juan" }
- do:
headers:
Authorization: "Basic anVhbjpzM2tyaXQtcGFzc3dvcmQ="
cluster.health: {}
- match: { timed_out: false }
# disable the user
- do:
security.disable_user:
username: "juan"
# validate user cannot login
- do:
catch: unauthorized
headers:
Authorization: "Basic anVhbjpzM2tyaXQtcGFzc3dvcmQ="
cluster.health: {}
# enable the user
- do:
security.enable_user:
username: "juan"
# validate that the user can login again
- do:
headers:
Authorization: "Basic anVhbjpzM2tyaXQtcGFzc3dvcmQ="
cluster.health: {}
- match: { timed_out: false }
- do:
headers:
Authorization: "Basic anVhbjpzM2tyaXQtcGFzc3dvcmQ="
security.query_user:
body: { }
- match: { total: 1 }