Package org.apache.solr.security
Class AuthorizationContext
- java.lang.Object
-
- org.apache.solr.security.AuthorizationContext
-
- Direct Known Subclasses:
HttpServletAuthorizationContext
public abstract class AuthorizationContext extends Object
Request context for Solr to be used by Authorization plugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizationContext.CollectionRequest
static class
AuthorizationContext.RequestType
-
Constructor Summary
Constructors Constructor Description AuthorizationContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract List<AuthorizationContext.CollectionRequest>
getCollectionRequests()
abstract Object
getHandler()
abstract Enumeration<String>
getHeaderNames()
abstract String
getHttpHeader(String header)
abstract String
getHttpMethod()
abstract org.apache.solr.common.params.SolrParams
getParams()
abstract String
getRemoteAddr()
abstract String
getRemoteHost()
abstract AuthorizationContext.RequestType
getRequestType()
abstract String
getResource()
abstract String
getUserName()
This method returns the name of the authenticated user for the current request.abstract Principal
getUserPrincipal()
This method returns thePrincipal
corresponding to the authenticated user for the current request.
-
-
-
Method Detail
-
getParams
public abstract org.apache.solr.common.params.SolrParams getParams()
-
getUserPrincipal
public abstract Principal getUserPrincipal()
This method returns thePrincipal
corresponding to the authenticated user for the current request. The value returned byPrincipal.getName()
depends on the authentication mechanism used (e.g. for user "foo" with BASIC authentication the result would be "foo". On the other hand with KERBEROS it would be foo@REALMNAME). ThegetUserName()
method may be preferred to extract the identity of the authenticated user instead of this method.- Returns:
- user principal in case of an authenticated request null in case of unauthenticated request
-
getUserName
public abstract String getUserName()
This method returns the name of the authenticated user for the current request. The return value of this method is agnostic of the underlying authentication mechanism used.- Returns:
- user name in case of an authenticated user null in case of unauthenticated request
-
getHeaderNames
public abstract Enumeration<String> getHeaderNames()
-
getRemoteAddr
public abstract String getRemoteAddr()
-
getRemoteHost
public abstract String getRemoteHost()
-
getCollectionRequests
public abstract List<AuthorizationContext.CollectionRequest> getCollectionRequests()
-
getRequestType
public abstract AuthorizationContext.RequestType getRequestType()
-
getResource
public abstract String getResource()
-
getHttpMethod
public abstract String getHttpMethod()
-
getHandler
public abstract Object getHandler()
-
-