Class ConfigUserStore
- java.lang.Object
-
- io.helidon.security.providers.httpauth.ConfigUserStore
-
- All Implemented Interfaces:
SecureUserStore
public class ConfigUserStore extends Object implements SecureUserStore
User store loaded from configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.security.providers.httpauth.SecureUserStore
SecureUserStore.User
-
-
Constructor Summary
Constructors Constructor Description ConfigUserStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SecureUserStorecreate(Config config)Create an instance from config.Optional<SecureUserStore.User>user(String login)Get user based on login.
-
-
-
Method Detail
-
create
public static SecureUserStore 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:
SecureUserStoreinstance
-
user
public Optional<SecureUserStore.User> user(String login)
Description copied from interface:SecureUserStoreGet user based on login. The returned user may not be populated -SecureUserStore.User.roles()is never called beforeSecureUserStore.User.isPasswordValid(char[]). Also the missing user and user with wrong password are treated the same - so if your implementation cannot decide whether a user exists until the password is checked, you can delay that decision and just returnfalsefromSecureUserStore.User.isPasswordValid(char[])for both cases (e.g. invalid user and invalid password).- Specified by:
userin interfaceSecureUserStore- Parameters:
login- login of the user (as obtained from request)- Returns:
- User information (empty if user is not found)
-
-