Class RestUserHandlerImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean authenticate​(java.lang.String username, java.lang.String password)
      Authenticate the user by hashing the input password using the stored salt, then comparing the generated hashed password to the stored hashed password
      java.lang.Iterable<java.lang.String> getAllUserNames()  
      RestUser getUserByUsername​(java.lang.String userName)  
      java.util.Set<io.javalin.core.security.Role> getUserRolesByUsername​(java.lang.String userName)  
      void readPasswordFile()  
      boolean setPassword​(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword)
      Sets new user password.
      void writePasswordFile()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RestUserHandlerImpl

        public RestUserHandlerImpl()
    • Method Detail

      • authenticate

        public boolean authenticate​(@NotNull
                                    java.lang.String username,
                                    @NotNull
                                    java.lang.String password)
        Authenticate the user by hashing the input password using the stored salt, then comparing the generated hashed password to the stored hashed password
        Specified by:
        authenticate in interface RestUserHandler
        Parameters:
        username - the user name
        password - the secret password
        Returns:
        true if successful
      • getUserRolesByUsername

        public java.util.Set<io.javalin.core.security.Role> getUserRolesByUsername​(java.lang.String userName)
        Specified by:
        getUserRolesByUsername in interface RestUserHandler
      • readPasswordFile

        public void readPasswordFile()
      • setPassword

        public boolean setPassword​(@NotNull
                                   java.lang.String userName,
                                   @NotNull
                                   java.lang.String oldPassword,
                                   @NotNull
                                   java.lang.String newPassword)
        Description copied from interface: RestUserHandler
        Sets new user password. N.B. Implementation may be implemented or omitted based on the specific back-end.
        Specified by:
        setPassword in interface RestUserHandler
        Parameters:
        userName - existing
        oldPassword - to verify
        newPassword - to set
        Returns:
        true if successful
      • writePasswordFile

        public void writePasswordFile()