You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crypto/src/main/java/org/springframework/security/crypto/password/DelegatingPasswordEncoder.java
+11-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2022 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
19
19
importjava.util.HashMap;
20
20
importjava.util.Map;
21
21
22
+
importorg.springframework.util.StringUtils;
23
+
22
24
/**
23
25
* A password encoder that delegates to another PasswordEncoder based upon a prefixed
24
26
* identifier.
@@ -129,6 +131,10 @@ public class DelegatingPasswordEncoder implements PasswordEncoder {
129
131
130
132
privatestaticfinalStringDEFAULT_ID_SUFFIX = "}";
131
133
134
+
publicstaticfinalStringNO_PASSWORD_ENCODER_MAPPED = "There is no PasswordEncoder mapped for the id \"%s\"";
135
+
136
+
publicstaticfinalStringNO_PASSWORD_ENCODER_PREFIX = "You have entered a password with no PasswordEncoder. If that is your intent, it should be prefixed with `{noop}`.";
137
+
132
138
privatefinalStringidPrefix;
133
139
134
140
privatefinalStringidSuffix;
@@ -286,7 +292,10 @@ public String encode(CharSequence rawPassword) {
Copy file name to clipboardExpand all lines: crypto/src/test/java/org/springframework/security/crypto/password/DelegatingPasswordEncoderTests.java
+18-6
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2022 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -43,6 +43,8 @@
43
43
@ExtendWith(MockitoExtension.class)
44
44
publicclassDelegatingPasswordEncoderTests {
45
45
46
+
publicstaticfinalStringNO_PASSWORD_ENCODER = "You have entered a password with no PasswordEncoder. If that is your intent, it should be prefixed with `{noop}`.";
47
+
46
48
@Mock
47
49
privatePasswordEncoderbcrypt;
48
50
@@ -201,23 +203,23 @@ public void matchesWhenUnMappedThenIllegalArgumentException() {
0 commit comments