Package org.apache.solr.security
Class HttpServletAuthorizationContext
- java.lang.Object
-
- org.apache.solr.security.AuthorizationContext
-
- org.apache.solr.security.HttpServletAuthorizationContext
-
public abstract class HttpServletAuthorizationContext extends AuthorizationContext
AnAuthorizationContext
implementation that delegates many methods to an underlyingHttpServletRequest
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.security.AuthorizationContext
AuthorizationContext.CollectionRequest, AuthorizationContext.RequestType
-
-
Constructor Summary
Constructors Constructor Description HttpServletAuthorizationContext(javax.servlet.http.HttpServletRequest servletRequest)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract List<AuthorizationContext.CollectionRequest>
getCollectionRequests()
abstract Object
getHandler()
Enumeration<String>
getHeaderNames()
String
getHttpHeader(String s)
String
getHttpMethod()
abstract org.apache.solr.common.params.SolrParams
getParams()
String
getRemoteAddr()
String
getRemoteHost()
abstract AuthorizationContext.RequestType
getRequestType()
String
getResource()
String
getUserName()
This method returns the name of the authenticated user for the current request.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()
- Specified by:
getParams
in classAuthorizationContext
-
getCollectionRequests
public abstract List<AuthorizationContext.CollectionRequest> getCollectionRequests()
- Specified by:
getCollectionRequests
in classAuthorizationContext
-
getRequestType
public abstract AuthorizationContext.RequestType getRequestType()
- Specified by:
getRequestType
in classAuthorizationContext
-
getHandler
public abstract Object getHandler()
- Specified by:
getHandler
in classAuthorizationContext
-
getResource
public String getResource()
- Specified by:
getResource
in classAuthorizationContext
-
getRemoteAddr
public String getRemoteAddr()
- Specified by:
getRemoteAddr
in classAuthorizationContext
-
getUserPrincipal
public Principal getUserPrincipal()
Description copied from class:AuthorizationContext
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). TheAuthorizationContext.getUserName()
method may be preferred to extract the identity of the authenticated user instead of this method.- Specified by:
getUserPrincipal
in classAuthorizationContext
- Returns:
- user principal in case of an authenticated request null in case of unauthenticated request
-
getUserName
public String getUserName()
Description copied from class:AuthorizationContext
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.- Specified by:
getUserName
in classAuthorizationContext
- Returns:
- user name in case of an authenticated user null in case of unauthenticated request
-
getHttpHeader
public String getHttpHeader(String s)
- Specified by:
getHttpHeader
in classAuthorizationContext
-
getHeaderNames
public Enumeration<String> getHeaderNames()
- Specified by:
getHeaderNames
in classAuthorizationContext
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethod
in classAuthorizationContext
-
getRemoteHost
public String getRemoteHost()
- Specified by:
getRemoteHost
in classAuthorizationContext
-
-