From 9581c7dcb2093b319ef6fc3284d6e76e6c100029 Mon Sep 17 00:00:00 2001 From: Abdon Pijpelink Date: Mon, 31 Jul 2023 16:40:01 +0200 Subject: [PATCH 1/2] [DOCS] Clarify retrieving own API keys with 'manage_own_api_key' privilege --- .../en/rest-api/security/get-api-keys.asciidoc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc b/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc index a6dc4b2ab390d..796f321436796 100644 --- a/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc +++ b/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc @@ -15,10 +15,16 @@ Retrieves information for one or more API keys. [[security-api-get-api-key-prereqs]] ==== {api-prereq-title} -* To use this API, you must have at least the `manage_own_api_key` or the `read_security` -cluster privileges. -* If you have only the `manage_own_api_key` privilege, this API returns only -the API keys that you own. If you have `read_security`, `manage_api_key` or greater +* To use this API, you must have at least the `manage_own_api_key` or the +`read_security` cluster privileges. +** If you only have the `manage_own_api_key` privilege, this API only returns +the API keys that you own. ++ +NOTE: Authenticating with an API key that has the `manage_own_api_key` privilege +does not allow retrieving the authenticated user's own keys using `owner=true`. +Instead, specify a key ID in the `id` field, or authenticate the user with basic +credentials. +** If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership. From a120b4db2aad7c5709b49e3d928c030a51db705c Mon Sep 17 00:00:00 2001 From: Abdon Pijpelink Date: Tue, 1 Aug 2023 09:55:43 +0200 Subject: [PATCH 2/2] Review feedback --- x-pack/docs/en/rest-api/security/get-api-keys.asciidoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc b/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc index 796f321436796..17a08960a3a4c 100644 --- a/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc +++ b/x-pack/docs/en/rest-api/security/get-api-keys.asciidoc @@ -21,9 +21,8 @@ Retrieves information for one or more API keys. the API keys that you own. + NOTE: Authenticating with an API key that has the `manage_own_api_key` privilege -does not allow retrieving the authenticated user's own keys using `owner=true`. -Instead, specify a key ID in the `id` field, or authenticate the user with basic -credentials. +does not allow retrieving the authenticated user's own keys. Instead, +authenticate the user with basic credentials. ** If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership.