File tree Expand file tree Collapse file tree
bambu/src/main/java/com/tfyre/servlet Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import java .security .Security ;
1818import java .security .spec .InvalidKeySpecException ;
1919import java .util .HashMap ;
20+ import java .util .HashSet ;
2021import java .util .Map ;
2122import java .util .Optional ;
23+ import java .util .Set ;
2224import java .util .stream .Collectors ;
2325import org .wildfly .security .credential .PasswordCredential ;
2426import org .wildfly .security .evidence .PasswordGuessEvidence ;
@@ -44,8 +46,10 @@ public void postConstruct() {
4446 map .put (userPass , new User (BcryptUtil .bcryptHash (userPass ), SystemRoles .ROLE_ADMIN ));
4547 return ;
4648 }
49+ final Set <String > seen = new HashSet <>();
4750 map .putAll (config .users ().entrySet ()
4851 .stream ()
52+ .filter (e -> seen .add (e .getKey ().toLowerCase ()))
4953 .collect (Collectors .toMap (e -> e .getKey ().toLowerCase (), e -> {
5054 String password = e .getValue ().password ();
5155 if (ModularCrypt .identifyAlgorithm (password .toCharArray ()) == null ) {
You can’t perform that action at this time.
0 commit comments