Class AuthorizationService

java.lang.Object
org.elasticsearch.xpack.security.authz.AuthorizationService

public class AuthorizationService extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.elasticsearch.common.settings.Setting<Boolean>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AuthorizationService(org.elasticsearch.common.settings.Settings settings, CompositeRolesStore rolesStore, org.elasticsearch.cluster.service.ClusterService clusterService, AuditTrailService auditTrailService, org.elasticsearch.xpack.core.security.authc.AuthenticationFailureHandler authcFailureHandler, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.xpack.core.security.user.AnonymousUser anonymousUser, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine authorizationEngine, Set<RequestInterceptor> requestInterceptors, org.elasticsearch.license.XPackLicenseState licenseState, org.elasticsearch.cluster.metadata.IndexNameExpressionResolver resolver, OperatorPrivileges.OperatorPrivilegesService operatorPrivilegesService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addSettings(List<org.elasticsearch.common.settings.Setting<?>> settings)
     
    void
    authorize(org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest originalRequest, org.elasticsearch.action.ActionListener<Void> listener)
    Verifies that the given user can execute the given request (and action).
    void
    checkPrivileges(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.xpack.core.security.action.user.HasPrivilegesRequest request, Collection<org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor> applicationPrivilegeDescriptors, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.action.user.HasPrivilegesResponse> listener)
     
    void
    retrieveUserPrivileges(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse> listener)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ANONYMOUS_AUTHORIZATION_EXCEPTION_SETTING

      public static final org.elasticsearch.common.settings.Setting<Boolean> ANONYMOUS_AUTHORIZATION_EXCEPTION_SETTING
  • Constructor Details

    • AuthorizationService

      public AuthorizationService(org.elasticsearch.common.settings.Settings settings, CompositeRolesStore rolesStore, org.elasticsearch.cluster.service.ClusterService clusterService, AuditTrailService auditTrailService, org.elasticsearch.xpack.core.security.authc.AuthenticationFailureHandler authcFailureHandler, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.xpack.core.security.user.AnonymousUser anonymousUser, @Nullable org.elasticsearch.xpack.core.security.authz.AuthorizationEngine authorizationEngine, Set<RequestInterceptor> requestInterceptors, org.elasticsearch.license.XPackLicenseState licenseState, org.elasticsearch.cluster.metadata.IndexNameExpressionResolver resolver, OperatorPrivileges.OperatorPrivilegesService operatorPrivilegesService)
  • Method Details

    • checkPrivileges

      public void checkPrivileges(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.xpack.core.security.action.user.HasPrivilegesRequest request, Collection<org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor> applicationPrivilegeDescriptors, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.action.user.HasPrivilegesResponse> listener)
    • retrieveUserPrivileges

      public void retrieveUserPrivileges(org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse> listener)
    • authorize

      public void authorize(org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest originalRequest, org.elasticsearch.action.ActionListener<Void> listener)
      Verifies that the given user can execute the given request (and action). If the user doesn't have the appropriate privileges for this action/request, an ElasticsearchSecurityException will be thrown.
      Parameters:
      authentication - The authentication information
      action - The action
      originalRequest - The request
      listener - The listener that gets called. A call to ActionListener.onResponse(Object) indicates success
    • addSettings

      public static void addSettings(List<org.elasticsearch.common.settings.Setting<?>> settings)