Skip to content

Commit 1b64c19

Browse files
bizybotYogesh Gaikwad
authored and
Yogesh Gaikwad
committed
Add owner flag parameter to the rest spec (#48500)
This commit adds missing info about newly added `owner` flag to the rest spec, also adds a rest test for the same. Closes#48499
1 parent 89c6575 commit 1b64c19

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"realm_name":{
3131
"type":"string",
3232
"description":"realm name of the user who created this API key to be retrieved"
33+
},
34+
"owner": {
35+
"type":"boolean",
36+
"default": false,
37+
"description":"flag to query API keys owned by the currently authenticated user"
3338
}
3439
}
3540
}

x-pack/plugin/src/test/resources/rest-api-spec/test/api_key/10_basic.yml

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ teardown:
176176
- match: { "api_keys.0.invalidated": false }
177177
- is_true: "api_keys.0.creation"
178178

179+
- do:
180+
headers:
181+
Authorization: "Basic YXBpX2tleV91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" # api_key_user
182+
security.get_api_key:
183+
owner: true
184+
- length: { "api_keys" : 1 }
185+
- match: { "api_keys.0.username": "api_key_user" }
186+
- match: { "api_keys.0.invalidated": false }
187+
- is_true: "api_keys.0.creation"
188+
179189
---
180190
"Test invalidate api key":
181191
- skip:

0 commit comments

Comments
 (0)