From 1b64c1992a79513f5f980246986f28e24540ec90 Mon Sep 17 00:00:00 2001 From: Yogesh Gaikwad <902768+bizybot@users.noreply.github.com> Date: Wed, 30 Oct 2019 13:04:48 +1100 Subject: [PATCH] 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 --- .../rest-api-spec/api/security.get_api_key.json | 5 +++++ .../resources/rest-api-spec/test/api_key/10_basic.yml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json index c61ef6ca564..028f3a51aea 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/security.get_api_key.json @@ -30,6 +30,11 @@ "realm_name":{ "type":"string", "description":"realm name of the user who created this API key to be retrieved" + }, + "owner": { + "type":"boolean", + "default": false, + "description":"flag to query API keys owned by the currently authenticated user" } } } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/api_key/10_basic.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/api_key/10_basic.yml index 8ac56b605cb..dbdf22c69c9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/api_key/10_basic.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/api_key/10_basic.yml @@ -176,6 +176,16 @@ teardown: - match: { "api_keys.0.invalidated": false } - is_true: "api_keys.0.creation" + - do: + headers: + Authorization: "Basic YXBpX2tleV91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" # api_key_user + security.get_api_key: + owner: true + - length: { "api_keys" : 1 } + - match: { "api_keys.0.username": "api_key_user" } + - match: { "api_keys.0.invalidated": false } + - is_true: "api_keys.0.creation" + --- "Test invalidate api key": - skip: