Package io.milton.http.fs
Class SimpleSecurityManager
java.lang.Object
io.milton.http.fs.SimpleSecurityManager
- All Implemented Interfaces:
SecurityManager
Has a realm and a map where the keys are user names and the values are
passwords
- Author:
- brad
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSecurityManager(DigestGenerator digestGenerator) SimpleSecurityManager(String realm, Map<String, String> nameAndPasswords) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(DigestResponse digestRequest) Authenticate a digest requestauthenticate(String user, String password) booleanauthorise(Request request, Request.Method method, Auth auth, Resource resource) Check that the authenticater user can access the given resource for the given method.getUserByName(String name) booleanvoidsetDigestGenerator(DigestGenerator digestGenerator) voidsetNameAndPasswords(Map<String, String> nameAndPasswords) void
-
Constructor Details
-
SimpleSecurityManager
public SimpleSecurityManager() -
SimpleSecurityManager
-
SimpleSecurityManager
-
-
Method Details
-
getUserByName
-
authenticate
- Specified by:
authenticatein interfaceSecurityManager- Returns:
- - some object representing the user to associate with the request
-
authenticate
Description copied from interface:SecurityManagerAuthenticate a digest request- Specified by:
authenticatein interfaceSecurityManager- Returns:
- See Also:
-
authorise
Description copied from interface:SecurityManagerCheck that the authenticater user can access the given resource for the given method.- Specified by:
authorisein interfaceSecurityManager- Parameters:
request- - the request itselfmethod- - the request methodauth- - authentication object representing the current userresource- - the resource being operated on- Returns:
- - true to indicate that the user is allowed access
-
getRealm
- Specified by:
getRealmin interfaceSecurityManager- Returns:
- - the name of the security realm this is managing
-
setRealm
- Parameters:
realm- the realm to set
-
setNameAndPasswords
-
setDigestGenerator
-
isDigestAllowed
public boolean isDigestAllowed()- Specified by:
isDigestAllowedin interfaceSecurityManager
-
getDigestGenerator
-