-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchange_password.yml
73 lines (71 loc) · 1.49 KB
/
change_password.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
64
65
66
67
68
69
70
71
72
73
---
requires:
stack: true
serverless: false
---
setup:
- do:
security.put_user:
username: "joe"
body: >
{
"password": "s3krit-password",
"roles" : [ "superuser" ]
}
- do:
security.put_role:
name: "user"
body: >
{
"cluster": ["monitor"],
"indices": [
{
"names": "*",
"privileges": ["all"]
}
]
}
- do:
security.put_user:
username: "unprivileged_user"
body: >
{
"password": "s3krit-password",
"roles" : [ "user" ]
}
---
teardown:
- do:
security.delete_user:
username: "joe"
ignore: 404
- do:
security.delete_role:
name: "user"
ignore: 404
- do:
security.delete_user:
username: "unprivileged_user"
ignore: 404
---
"Test changing users password":
# change password
- do:
security.change_password:
username: "joe"
body: >
{
"password" : "s3krit-password2"
}
# attempt to login with invalid credentials
- do:
catch: unauthorized
headers:
Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZA=="
cluster.health: {}
# login with new credentials
- do:
headers:
Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZDI="
cluster.health: {}
- match: { timed_out: false }