|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.server.handler.AbstractHandler org.eclipse.jetty.server.handler.AbstractHandlerContainer org.eclipse.jetty.server.handler.HandlerWrapper org.eclipse.jetty.security.SecurityHandler
public abstract class SecurityHandler
Abstract SecurityHandler.
Select and apply an Authenticator
to a request.
The Authenticator may either be directly set on the handler
or will be create during AbstractLifeCycle.start()
with a call to
either the default or set AuthenticatorFactory.
SecurityHandler has a set of initparameters that are used by the Authentication.Configuration. At startup, any context init parameters that start with "org.eclipse.jetty.security." that do not have values in the SecurityHandler init parameters, are copied.
Nested Class Summary | |
---|---|
class |
SecurityHandler.NotChecked
|
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
static Principal |
__NO_USER
|
static Principal |
__NOBODY
Nobody user. |
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
---|
_handler |
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
protected |
SecurityHandler()
|
Method Summary | |
---|---|
protected boolean |
checkSecurity(Request request)
|
protected abstract boolean |
checkUserDataPermissions(String pathInContext,
Request request,
Response response,
Object constraintInfo)
|
protected abstract boolean |
checkWebResourcePermissions(String pathInContext,
Request request,
Response response,
Object constraintInfo,
UserIdentity userIdentity)
|
protected void |
doStart()
|
protected void |
doStop()
|
protected IdentityService |
findIdentityService()
|
protected LoginService |
findLoginService()
|
Authenticator |
getAuthenticator()
|
Authenticator.Factory |
getAuthenticatorFactory()
|
String |
getAuthMethod()
|
IdentityService |
getIdentityService()
Get the identityService. |
String |
getInitParameter(String key)
|
Set<String> |
getInitParameterNames()
|
LoginService |
getLoginService()
Get the loginService. |
String |
getRealmName()
|
void |
handle(String pathInContext,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
Handle a request. |
protected abstract boolean |
isAuthMandatory(Request baseRequest,
Response base_response,
Object constraintInfo)
|
boolean |
isCheckWelcomeFiles()
|
protected abstract Object |
prepareConstraintInfo(String pathInContext,
Request request)
|
void |
setAuthenticator(Authenticator authenticator)
Set the authenticator. |
void |
setAuthenticatorFactory(Authenticator.Factory authenticatorFactory)
|
void |
setAuthMethod(String authMethod)
|
void |
setCheckWelcomeFiles(boolean authenticateWelcomeFiles)
|
void |
setIdentityService(IdentityService identityService)
Set the identityService. |
String |
setInitParameter(String key,
String value)
Set an initialization parameter. |
void |
setLoginService(LoginService loginService)
Set the loginService. |
void |
setRealmName(String realmName)
|
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
---|
expandChildren, getHandler, getHandlers, setHandler, setServer |
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer |
---|
dump, expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler |
---|
destroy, dump, getServer, toString |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Field Detail |
---|
public static Principal __NO_USER
public static Principal __NOBODY
Constructor Detail |
---|
protected SecurityHandler()
Method Detail |
---|
public IdentityService getIdentityService()
getIdentityService
in interface Authenticator.Configuration
public void setIdentityService(IdentityService identityService)
identityService
- the identityService to setpublic LoginService getLoginService()
getLoginService
in interface Authenticator.Configuration
public void setLoginService(LoginService loginService)
loginService
- the loginService to setpublic Authenticator getAuthenticator()
public void setAuthenticator(Authenticator authenticator)
authenticator
-
IllegalStateException
- if the SecurityHandler is runningpublic Authenticator.Factory getAuthenticatorFactory()
public void setAuthenticatorFactory(Authenticator.Factory authenticatorFactory)
authenticatorFactory
- the authenticatorFactory to set
IllegalStateException
- if the SecurityHandler is runningpublic String getRealmName()
getRealmName
in interface Authenticator.Configuration
public void setRealmName(String realmName)
realmName
- the realmName to set
IllegalStateException
- if the SecurityHandler is runningpublic String getAuthMethod()
getAuthMethod
in interface Authenticator.Configuration
public void setAuthMethod(String authMethod)
authMethod
- the authMethod to set
IllegalStateException
- if the SecurityHandler is runningpublic boolean isCheckWelcomeFiles()
public void setCheckWelcomeFiles(boolean authenticateWelcomeFiles)
authenticateWelcomeFiles
- True if forwards to welcome files are
authenticated
IllegalStateException
- if the SecurityHandler is runningpublic String getInitParameter(String key)
getInitParameter
in interface Authenticator.Configuration
public Set<String> getInitParameterNames()
getInitParameterNames
in interface Authenticator.Configuration
public String setInitParameter(String key, String value)
key
- value
-
IllegalStateException
- if the SecurityHandler is runningprotected LoginService findLoginService()
protected IdentityService findIdentityService()
protected void doStart() throws Exception
doStart
in class HandlerWrapper
Exception
protected void doStop() throws Exception
doStop
in class HandlerWrapper
Exception
HandlerWrapper.doStop()
protected boolean checkSecurity(Request request)
public void handle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Handler
handle
in interface Handler
handle
in class HandlerWrapper
pathInContext
- The target of the request - either a URI or a name.baseRequest
- The original unwrapped request object.request
- The request either as the Request
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Request object if required.response
- The response as the Response
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Response object if required.
IOException
ServletException
protected abstract Object prepareConstraintInfo(String pathInContext, Request request)
protected abstract boolean checkUserDataPermissions(String pathInContext, Request request, Response response, Object constraintInfo) throws IOException
IOException
protected abstract boolean isAuthMandatory(Request baseRequest, Response base_response, Object constraintInfo)
protected abstract boolean checkWebResourcePermissions(String pathInContext, Request request, Response response, Object constraintInfo, UserIdentity userIdentity) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |