OpenSearch/x-pack/docs/en/rest-api/security/clear-privileges-cache.asciidoc
Yang Wang a5a8b4ae1d
Add cache for application privileges (#55836) (#58798)
Add caching support for application privileges to reduce number of round-trips to security index when building application privilege descriptors.

Privilege retrieving in NativePrivilegeStore is changed to always fetching all privilege documents for a given application. The caching is applied to all places including "get privilege", "has privileges" APIs and CompositeRolesStore (for authentication).
2020-07-02 11:50:03 +10:00

44 lines
1.3 KiB
Plaintext

[role="xpack"]
[[security-api-clear-privilege-cache]]
=== Clear privileges cache API
++++
<titleabbrev>Clear privileges cache</titleabbrev>
++++
Evicts privileges from the native application privilege cache.
The cache is also automatically cleared for applications that have their privileges updated.
[[security-api-clear-privilege-cache-request]]
==== {api-request-title}
`POST /_security/privilege/<application>/_clear_cache`
[[security-api-clear-privilege-cache-prereqs]]
==== {api-prereq-title}
* To use this API, you must have at least the `manage_security` cluster
privilege.
[[security-api-clear-privilege-cache-desc]]
==== {api-description-title}
For more information about the native realm, see
<<realms>> and <<native-realm>>.
[[security-api-clear-privilege-cache-path-params]]
==== {api-path-parms-title}
`application`::
(string) The name of the application. If omitted, all entries are evicted from the cache.
[[security-api-clear-privilege-cache-example]]
==== {api-examples-title}
The clear privileges cache API evicts privileges from the native application privilege cache.
For example, to clear the cache for `myapp`:
[source,console]
--------------------------------------------------
POST /_security/privilege/myapp/_clear_cache
--------------------------------------------------