Class MockCredentialStoreManagedObjectSource
- All Implemented Interfaces:
ManagedObject,ManagedObjectSource<None,,None> CredentialStore
Provides mocking of a CredentialStore in a similar way
MockChallengeHttpSecuritySource works.
Using this store allows the application to be built with its appropriate
HttpSecuritySource authentication scheme. This mocks the backing
CredentialStore for development and tests environments to avoid user
management. This therefore avoids the need to change the application
behaviour between environments (same HttpSecuritySource but differing
configured CredentialStore).
- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends Enum<O>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext -
Field Summary
FieldsFields inherited from interface net.officefloor.web.security.store.CredentialStore
DEFAULT_ALGORITHM, NO_ALGORITHM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtains the algorithm used to encrypt credentials within thisCredentialStore.protected ManagedObjectSynchronously obtains theManagedObject.Obtains the object being managed.protected voidOverridden to load meta-data.protected voidOverridden to load specifications.retrieveCredentialEntry(String userId, String realm) Retrieves theCredentialEntry.Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObjectMethods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
Field Details
-
PROPERTY_ALGORITHM
Name of thePropertyfor the algorithm.- See Also:
-
-
Constructor Details
-
MockCredentialStoreManagedObjectSource
public MockCredentialStoreManagedObjectSource()
-
-
Method Details
-
loadSpecification
Description copied from class:AbstractAsyncManagedObjectSourceOverridden to load specifications.- Specified by:
loadSpecificationin classAbstractAsyncManagedObjectSource<None,None> - Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None, None> context) throws ExceptionDescription copied from class:AbstractAsyncManagedObjectSourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractAsyncManagedObjectSource<None,None> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
getManagedObject
Description copied from class:AbstractManagedObjectSourceSynchronously obtains theManagedObject.- Specified by:
getManagedObjectin classAbstractManagedObjectSource<None,None> - Returns:
ManagedObject.- Throws:
Throwable- If fails to obtain theManagedObject.
-
getObject
Description copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
Throwable- Indicating failed to obtain the object for use.
-
getAlgorithm
Description copied from interface:CredentialStoreObtains the algorithm used to encrypt credentials within this
CredentialStore.Should the return be
null, blank orCredentialStore.NO_ALGORITHMthen the password is considered to be stored in plain text. This is however only useful for theBASICauthentication scheme due to the nature of the other authentication schemes (such asDIGEST).It is expected that the credentials for
DIGESTwill be stored as the algorithm applied touserId:realm:password(as per RFC 2617). This is necessary as the password is never supplied and therefore forDIGESTthis MUST return an algorithm.- Specified by:
getAlgorithmin interfaceCredentialStore- Returns:
- Algorithm.
-
retrieveCredentialEntry
Description copied from interface:CredentialStoreRetrieves theCredentialEntry.- Specified by:
retrieveCredentialEntryin interfaceCredentialStore- Parameters:
userId- User identifier.realm- Realm. May benull(especially in the case forBasicauthentication).- Returns:
CredentialEntryornullif noCredentialEntryexists for parameters.
-