Class SimpleSecurityManager

java.lang.Object
io.milton.http.fs.SimpleSecurityManager
All Implemented Interfaces:
SecurityManager

public class SimpleSecurityManager extends Object implements SecurityManager
Has a realm and a map where the keys are user names and the values are passwords
Author:
brad
  • Constructor Details

    • SimpleSecurityManager

      public SimpleSecurityManager()
    • SimpleSecurityManager

      public SimpleSecurityManager(DigestGenerator digestGenerator)
    • SimpleSecurityManager

      public SimpleSecurityManager(String realm, Map<String,String> nameAndPasswords)
  • Method Details

    • getUserByName

      public Object getUserByName(String name)
    • authenticate

      public Object authenticate(String user, String password)
      Specified by:
      authenticate in interface SecurityManager
      Returns:
      - some object representing the user to associate with the request
    • authenticate

      public Object authenticate(DigestResponse digestRequest)
      Description copied from interface: SecurityManager
      Authenticate a digest request
      Specified by:
      authenticate in interface SecurityManager
      Returns:
      See Also:
    • authorise

      public boolean authorise(Request request, Request.Method method, Auth auth, Resource resource)
      Description copied from interface: SecurityManager
      Check that the authenticater user can access the given resource for the given method.
      Specified by:
      authorise in interface SecurityManager
      Parameters:
      request - - the request itself
      method - - the request method
      auth - - authentication object representing the current user
      resource - - the resource being operated on
      Returns:
      - true to indicate that the user is allowed access
    • getRealm

      public String getRealm(String host)
      Specified by:
      getRealm in interface SecurityManager
      Returns:
      - the name of the security realm this is managing
    • setRealm

      public void setRealm(String realm)
      Parameters:
      realm - the realm to set
    • setNameAndPasswords

      public void setNameAndPasswords(Map<String,String> nameAndPasswords)
    • setDigestGenerator

      public void setDigestGenerator(DigestGenerator digestGenerator)
    • isDigestAllowed

      public boolean isDigestAllowed()
      Specified by:
      isDigestAllowed in interface SecurityManager
    • getDigestGenerator

      public DigestGenerator getDigestGenerator()