Merge pull request #5566 from eugenp/rename-user-helidon
rename user in helidon app
This commit is contained in:
commit
406d9c290d
|
@ -4,13 +4,13 @@ import io.helidon.security.provider.httpauth.UserStore;
|
|||
|
||||
import java.util.Collection;
|
||||
|
||||
public class UserApp implements UserStore.User {
|
||||
public class MyUser implements UserStore.User {
|
||||
|
||||
private String login;
|
||||
private char[] password;
|
||||
private Collection<String> roles;
|
||||
|
||||
public UserApp(String login, char[] password, Collection<String> roles) {
|
||||
public MyUser(String login, char[] password, Collection<String> roles) {
|
||||
this.login = login;
|
||||
this.password = password;
|
||||
this.roles = roles;
|
|
@ -23,9 +23,9 @@ public class WebApplicationSecurity {
|
|||
ServerConfiguration serverConfig =
|
||||
ServerConfiguration.fromConfig(config.get("server"));
|
||||
|
||||
Map<String, UserApp> users = new HashMap<>();
|
||||
users.put("user", new UserApp("user", "user".toCharArray(), Arrays.asList("ROLE_USER")));
|
||||
users.put("admin", new UserApp("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN")));
|
||||
Map<String, MyUser> users = new HashMap<>();
|
||||
users.put("user", new MyUser("user", "user".toCharArray(), Arrays.asList("ROLE_USER")));
|
||||
users.put("admin", new MyUser("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN")));
|
||||
UserStore store = user -> Optional.ofNullable(users.get(user));
|
||||
|
||||
HttpBasicAuthProvider httpBasicAuthProvider = HttpBasicAuthProvider.builder()
|
||||
|
|
Loading…
Reference in New Issue