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
AnAuthorizationContextimplementation 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 ObjectgetHandler()Enumeration<String>getHeaderNames()StringgetHttpHeader(String s)StringgetHttpMethod()abstract org.apache.solr.common.params.SolrParamsgetParams()StringgetRemoteAddr()StringgetRemoteHost()abstract AuthorizationContext.RequestTypegetRequestType()StringgetResource()StringgetUserName()This method returns the name of the authenticated user for the current request.PrincipalgetUserPrincipal()This method returns thePrincipalcorresponding to the authenticated user for the current request.
-
-
-
Method Detail
-
getParams
public abstract org.apache.solr.common.params.SolrParams getParams()
- Specified by:
getParamsin classAuthorizationContext
-
getCollectionRequests
public abstract List<AuthorizationContext.CollectionRequest> getCollectionRequests()
- Specified by:
getCollectionRequestsin classAuthorizationContext
-
getRequestType
public abstract AuthorizationContext.RequestType getRequestType()
- Specified by:
getRequestTypein classAuthorizationContext
-
getHandler
public abstract Object getHandler()
- Specified by:
getHandlerin classAuthorizationContext
-
getResource
public String getResource()
- Specified by:
getResourcein classAuthorizationContext
-
getRemoteAddr
public String getRemoteAddr()
- Specified by:
getRemoteAddrin classAuthorizationContext
-
getUserPrincipal
public Principal getUserPrincipal()
Description copied from class:AuthorizationContextThis method returns thePrincipalcorresponding 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:
getUserPrincipalin classAuthorizationContext- Returns:
- user principal in case of an authenticated request null in case of unauthenticated request
-
getUserName
public String getUserName()
Description copied from class:AuthorizationContextThis 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:
getUserNamein classAuthorizationContext- Returns:
- user name in case of an authenticated user null in case of unauthenticated request
-
getHttpHeader
public String getHttpHeader(String s)
- Specified by:
getHttpHeaderin classAuthorizationContext
-
getHeaderNames
public Enumeration<String> getHeaderNames()
- Specified by:
getHeaderNamesin classAuthorizationContext
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethodin classAuthorizationContext
-
getRemoteHost
public String getRemoteHost()
- Specified by:
getRemoteHostin classAuthorizationContext
-
-