mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '2.5.x'
Closes gh-28082
This commit is contained in:
commit
1829dc4960
@ -48,8 +48,9 @@ public class Sanitizer {
|
||||
|
||||
private static final String[] REGEX_PARTS = { "*", "$", "^", "+" };
|
||||
|
||||
private static final Set<String> DEFAULT_KEYS_TO_SANITIZE = new LinkedHashSet<>(Arrays.asList("password", "secret",
|
||||
"key", "token", ".*credentials.*", "vcap_services", "sun.java.command"));
|
||||
private static final Set<String> DEFAULT_KEYS_TO_SANITIZE = new LinkedHashSet<>(
|
||||
Arrays.asList("password", "secret", "key", "token", ".*credentials.*", "vcap_services", "sun.java.command",
|
||||
"^spring[\\._]application[\\\\._]json$"));
|
||||
|
||||
private static final Set<String> URI_USERINFO_KEYS = new LinkedHashSet<>(
|
||||
Arrays.asList("uri", "uris", "url", "urls", "address", "addresses"));
|
||||
|
@ -48,6 +48,8 @@ class SanitizerTests {
|
||||
assertThat(sanitizer.sanitize("sometoken", "secret")).isEqualTo("******");
|
||||
assertThat(sanitizer.sanitize("find", "secret")).isEqualTo("secret");
|
||||
assertThat(sanitizer.sanitize("sun.java.command", "--spring.redis.password=pa55w0rd")).isEqualTo("******");
|
||||
assertThat(sanitizer.sanitize("SPRING_APPLICATION_JSON", "{password:123}")).isEqualTo("******");
|
||||
assertThat(sanitizer.sanitize("spring.application.json", "{password:123}")).isEqualTo("******");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user