Class ConfigUserStore

  • All Implemented Interfaces:
    UserStore

    public class ConfigUserStore
    extends Object
    implements UserStore
    User store loaded from configuration.
    • Constructor Detail

      • ConfigUserStore

        public ConfigUserStore()
    • Method Detail

      • create

        public static ConfigUserStore create​(Config config)
        Create an instance from config. Expects key "users" to be the current key. Example:
         users: [
         {
           login = "jack"
           password = "${CLEAR=password}"
           roles = ["user", "admin"]
         },
         {
           login = "jill"
           # master password is "jungle", password is "password"
           password = "${AES=3XQ8A1RszE9JbXl+lUnnsX0gakuqjnTyp8YJWIAU1D3SiM2TaSnxd6U0/LjrdJYv}"
           roles = ["user"]
         }
         ]
         
        Parameters:
        config - to load this user store from
        Returns:
        UserStore instance
      • user

        public Optional<UserStore.User> user​(String login)
        Description copied from interface: UserStore
        Get user based on login.
        Specified by:
        user in interface UserStore
        Parameters:
        login - login of the user (as obtained from request)
        Returns:
        User information (empty if user is not found)