java.lang.Object
net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource<MockAuthentication,MockAccessControl,C,O,F>
net.officefloor.web.security.scheme.AbstractMockHttpSecuritySource<C,O,F>
- All Implemented Interfaces:
HttpSecurity<MockAuthentication,,MockAccessControl, C, O, F> HttpSecuritySource<MockAuthentication,MockAccessControl, C, O, F>
@TestSource
public class AbstractMockHttpSecuritySource<C,O extends Enum<O>,F extends Enum<F>>
extends AbstractHttpSecuritySource<MockAuthentication,MockAccessControl,C,O,F>
implements HttpSecurity<MockAuthentication,MockAccessControl,C,O,F>
Abstract mock
HttpSecuritySource.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
AbstractHttpSecuritySource.DependencyLabeller, AbstractHttpSecuritySource.Labeller, AbstractHttpSecuritySource.MetaDataContext<A,AC extends Serializable, C, O extends Enum<O>, F extends Enum<F>>, AbstractHttpSecuritySource.SpecificationContext -
Field Summary
Fields inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
UTF_8 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(C credentials, AuthenticateContext<MockAccessControl, O, F> context) Undertakes authentication.voidchallenge(ChallengeContext<O, F> context) Triggers the authentication challenge to the client.Creates the custom authentication.protected voidloadMetaData(AbstractHttpSecuritySource.MetaDataContext<MockAuthentication, MockAccessControl, C, O, F> context) Overridden to load meta-data.protected voidOverridden to load specifications.voidlogout(LogoutContext<O, F> context) Logs out.booleanratify(C credentials, RatifyContext<MockAccessControl> context) Ratifies whether enough information is available to undertake authentication.sourceHttpSecurity(HttpSecurityContext context) Sources theHttpSecurity.Methods inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
getSpecification, init, start, stop
-
Constructor Details
-
AbstractMockHttpSecuritySource
public AbstractMockHttpSecuritySource()
-
-
Method Details
-
loadSpecification
Description copied from class:AbstractHttpSecuritySourceOverridden to load specifications.- Specified by:
loadSpecificationin classAbstractHttpSecuritySource<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractHttpSecuritySource.MetaDataContext<MockAuthentication, MockAccessControl, throws ExceptionC, O, F> context) Description copied from class:AbstractHttpSecuritySourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractHttpSecuritySource<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
sourceHttpSecurity
public HttpSecurity<MockAuthentication,MockAccessControl, sourceHttpSecurityC, O, F> (HttpSecurityContext context) throws HttpException Description copied from interface:HttpSecuritySourceSources theHttpSecurity.- Specified by:
sourceHttpSecurityin interfaceHttpSecuritySource<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context-HttpSecurity.- Returns:
HttpSecurity.- Throws:
HttpException- If fails to source theHttpSecurity.
-
createAuthentication
Description copied from interface:HttpSecurityCreates the custom authentication.- Specified by:
createAuthenticationin interfaceHttpSecurity<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context-AuthenticateContext.- Returns:
- Custom authentication.
-
ratify
Description copied from interface:HttpSecurityRatifies whether enough information is available to undertake authentication.
As authentication will likely require communication with external services (LDAP store, database, etc), this method allows checking whether enough information is available to undertake the authentication. The purpose is to avoid the
ManagedFunctiondepending on dependencies of authentication subsequently causing execution by differentTeam. This is especially as the majority ofHttpRequestservicing will use theHttpSessionto cache details and not require the authentication dependencies causing the swap inTeam.- Specified by:
ratifyin interfaceHttpSecurity<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
credentials- Credentials.context-RatifyContext.- Returns:
trueshould enough information be available to undertake authentication.falseif not enough information is available for authentication.
-
authenticate
public void authenticate(C credentials, AuthenticateContext<MockAccessControl, O, throws HttpExceptionF> context) Description copied from interface:HttpSecurityUndertakes authentication.- Specified by:
authenticatein interfaceHttpSecurity<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
credentials- Credentials.context-AuthenticateContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
challenge
Description copied from interface:HttpSecurityTriggers the authentication challenge to the client.- Specified by:
challengein interfaceHttpSecurity<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context-ChallengeContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
logout
Description copied from interface:HttpSecurityLogs out.- Specified by:
logoutin interfaceHttpSecurity<MockAuthentication,MockAccessControl, C, O extends Enum<O>, F extends Enum<F>> - Parameters:
context-LogoutContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-