mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Cache API key doc to reduce traffic to the security index (#59376)
Getting the API key document form the security index is the most time consuing part of the API Key authentication flow (>60% if index is local and >90% if index is remote). This traffic is now avoided by caching added with this PR. Additionally, we add a cache invalidator registry so that clearing of different caches will be managed in a single place (requires follow-up PRs).
This commit is contained in:
parent
c45724079c
commit
9e1f912ccc
31 changed files with 1514 additions and 25 deletions
|
@ -0,0 +1,34 @@
|
|||
|
||||
--
|
||||
:api: clear-api-key-cache
|
||||
:request: ClearApiKeyCacheRequest
|
||||
:response: ClearSecurityCacheResponse
|
||||
--
|
||||
[role="xpack"]
|
||||
[id="{upid}-{api}"]
|
||||
=== Clear API Key Cache API
|
||||
|
||||
[id="{upid}-{api}-request"]
|
||||
==== Clear API Key Cache Request
|
||||
|
||||
A +{request}+ supports clearing API key cache for the given IDs.
|
||||
It can also clear the entire cache if no ID is specified.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-request]
|
||||
--------------------------------------------------
|
||||
<1> the IDs(s) for the API keys to be evicted from the cache
|
||||
|
||||
include::../execution.asciidoc[]
|
||||
|
||||
[id="{upid}-{api}-response"]
|
||||
==== Clear API Key Cache Response
|
||||
|
||||
The returned +{response}+ allows to retrieve information about where the cache was cleared.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-response]
|
||||
--------------------------------------------------
|
||||
<1> the list of nodes that the cache was cleared on
|
|
@ -479,6 +479,7 @@ The Java High Level REST Client supports the following Security APIs:
|
|||
* <<{upid}-clear-roles-cache>>
|
||||
* <<{upid}-clear-privileges-cache>>
|
||||
* <<{upid}-clear-realm-cache>>
|
||||
* <<{upid}-clear-api-key-cache>>
|
||||
* <<{upid}-authenticate>>
|
||||
* <<{upid}-has-privileges>>
|
||||
* <<{upid}-get-user-privileges>>
|
||||
|
@ -511,6 +512,7 @@ include::security/get-privileges.asciidoc[]
|
|||
include::security/clear-roles-cache.asciidoc[]
|
||||
include::security/clear-privileges-cache.asciidoc[]
|
||||
include::security/clear-realm-cache.asciidoc[]
|
||||
include::security/clear-api-key-cache.asciidoc[]
|
||||
include::security/authenticate.asciidoc[]
|
||||
include::security/has-privileges.asciidoc[]
|
||||
include::security/get-user-privileges.asciidoc[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue