Package digilib.auth

Class PathAuthzOps

  • All Implemented Interfaces:
    AuthzOps

    public class PathAuthzOps
    extends AuthzOpsImpl
    Implements AuthzOps using paths defined in an XML config file. The name of the configuration file is read from the digilib config parameter "auth-file". The tag "digilib-paths" is read from the configuration file:
     
     <digilib-paths>
       <path name="histast/eastwood-collection" role="eastwood-coll" />
     </digilib-paths>
     
     
    A user must supply one of the roles under "role" to access the directory "name". Roles under "role" must be separated by comma only (no spaces).
    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
    • Constructor Detail

      • PathAuthzOps

        public PathAuthzOps()
    • Method Detail

      • init

        public void init​(DigilibConfiguration dlConfig)
                  throws AuthOpException
        Initialize authentication operations. Reads tag "digilib-paths" from configuration file and sets up authentication arrays.
        Specified by:
        init in interface AuthzOps
        Specified by:
        init in class AuthzOpsImpl
        Parameters:
        dlConfig - current DigilibConfiguration
        Throws:
        AuthOpException - Exception thrown on error.
      • rolesForPath

        public List<String> rolesForPath​(DigilibServletRequest dlRequest)
                                  throws AuthOpException
        Return authorization roles needed for request. Returns the list of authorization roles that are required to access the specified path. No list means the path is free.
        Specified by:
        rolesForPath in class AuthzOpsImpl
        Parameters:
        dlRequest - DigilibServletRequest with image path and remote address information.
        Returns:
        List of Strings with role names.
        Throws:
        AuthOpException - Exception thrown on error.