Adapt to Spring Security changes
Closes gh-32604
This commit is contained in:
@@ -54,7 +54,7 @@ public class EncodePasswordCommand extends OptionParsingCommand {
|
||||
Map<String, Supplier<PasswordEncoder>> encoders = new LinkedHashMap<>();
|
||||
encoders.put("default", PasswordEncoderFactories::createDelegatingPasswordEncoder);
|
||||
encoders.put("bcrypt", BCryptPasswordEncoder::new);
|
||||
encoders.put("pbkdf2", Pbkdf2PasswordEncoder::new);
|
||||
encoders.put("pbkdf2", Pbkdf2PasswordEncoder::defaultsForSpringSecurity_v5_8);
|
||||
ENCODERS = Collections.unmodifiableMap(encoders);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,8 @@ class EncodePasswordCommandTests {
|
||||
ExitStatus status = command.run("-a", "pbkdf2", "boot");
|
||||
then(this.log).should().info(this.message.capture());
|
||||
assertThat(this.message.getValue()).doesNotStartWith("{");
|
||||
assertThat(new Pbkdf2PasswordEncoder().matches("boot", this.message.getValue())).isTrue();
|
||||
assertThat(Pbkdf2PasswordEncoder.defaultsForSpringSecurity_v5_8().matches("boot", this.message.getValue()))
|
||||
.isTrue();
|
||||
assertThat(status).isEqualTo(ExitStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user