Interface OperatorPrivileges.OperatorPrivilegesService

All Known Implementing Classes:
OperatorPrivileges.DefaultOperatorPrivilegesService
Enclosing class:
OperatorPrivileges

public static interface OperatorPrivileges.OperatorPrivilegesService
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    void
    maybeMarkOperatorUser(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.common.util.concurrent.ThreadContext threadContext)
    Set a ThreadContext Header AuthenticationField.PRIVILEGE_CATEGORY_KEY if 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 Header AuthenticationField.PRIVILEGE_CATEGORY_KEY if 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.