Skip to content

Commit 7734bff

Browse files
committed
Add authentication, change password, create api key examples
1 parent 11d4769 commit 7734bff

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# summary:
2+
description: A successful response from `GET /_security/_authenticate`.
3+
# type: response
4+
# response_code: 200
5+
value: |-
6+
{
7+
"username": "rdeniro",
8+
"roles": [
9+
"admin"
10+
],
11+
"full_name": null,
12+
"email": null,
13+
"metadata": { },
14+
"enabled": true,
15+
"authentication_realm": {
16+
"name" : "file",
17+
"type" : "file"
18+
},
19+
"lookup_realm": {
20+
"name" : "file",
21+
"type" : "file"
22+
},
23+
"authentication_type": "realm"
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# summary:
2+
# method_request: POST /_security/user/jacknich/_password
3+
description: >
4+
Run `POST /_security/user/jacknich/_password` to update the password for the `jacknich` user.
5+
# type: request
6+
value: |-
7+
{
8+
"password" : "new-test-password"
9+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# summary:
2+
# method_request: POST /_security/api_key
3+
description: >
4+
Run `POST /_security/api_key` to create an API key.
5+
If `expiration` is not provided, the API keys do not expire.
6+
If `role_descriptors` is not provided, the permissions of the authenticated user are applied.
7+
# type: request
8+
value: |-
9+
{
10+
"name": "my-api-key",
11+
"expiration": "1d",
12+
"role_descriptors": {
13+
"role-a": {
14+
"cluster": ["all"],
15+
"indices": [
16+
{
17+
"names": ["index-a*"],
18+
"privileges": ["read"]
19+
}
20+
]
21+
},
22+
"role-b": {
23+
"cluster": ["all"],
24+
"indices": [
25+
{
26+
"names": ["index-b*"],
27+
"privileges": ["all"]
28+
}
29+
]
30+
}
31+
},
32+
"metadata": {
33+
"application": "my-application",
34+
"environment": {
35+
"level": 1,
36+
"trusted": true,
37+
"tags": ["dev", "staging"]
38+
}
39+
}
40+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# summary:
2+
description: A successful response from `POST /_security/api_key`.
3+
# type: response
4+
# response_code: 200
5+
value: |-
6+
{
7+
"id": "VuaCfGcBCdbkQm-e5aOx",
8+
"name": "my-api-key",
9+
"expiration": 1544068612110,
10+
"api_key": "ui2lp2axTNmsyakw9tvNnw",
11+
"encoded": "VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw=="
12+
}

0 commit comments

Comments
 (0)