Interface OperatorPrivileges.OperatorPrivilegesService
- All Known Implementing Classes:
OperatorPrivileges.DefaultOperatorPrivilegesService
- Enclosing class:
- OperatorPrivileges
public static interface OperatorPrivileges.OperatorPrivilegesService
-
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.ElasticsearchSecurityExceptioncheck(org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest request, org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Check whether the user is an operator and whether the request is an operator-only.voidmaybeInterceptRequest(org.elasticsearch.common.util.concurrent.ThreadContext threadContext, org.elasticsearch.transport.TransportRequest request) When operator privileges are enabled, certain requests needs to be configured in a specific way so that they respect operator only settings.voidmaybeMarkOperatorUser(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Set a ThreadContext HeaderAuthenticationField.PRIVILEGE_CATEGORY_KEYif authentication is an operator user.
-
Method Details
-
maybeMarkOperatorUser
void maybeMarkOperatorUser(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Set a ThreadContext HeaderAuthenticationField.PRIVILEGE_CATEGORY_KEYif authentication is an operator user. -
check
org.elasticsearch.ElasticsearchSecurityException check(org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest request, org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Check whether the user is an operator and whether the request is an operator-only.- Returns:
- An exception if user is an non-operator and the request is operator-only. Otherwise returns null.
-
maybeInterceptRequest
void maybeInterceptRequest(org.elasticsearch.common.util.concurrent.ThreadContext threadContext, org.elasticsearch.transport.TransportRequest request) When operator privileges are enabled, certain requests needs to be configured in a specific way so that they respect operator only settings. For an example, the restore snapshot request should not restore operator only states from the snapshot. This method is where that requests are configured when necessary.
-