mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 12:17:43 +08:00
Co-authored-by: jackfanwan <61672564+jackfanwan@users.noreply.github.com>
This commit is contained in:
parent
951f707b61
commit
c4953e8660
@ -728,7 +728,7 @@ public final class Constants {
|
||||
* dataSource sensitive param
|
||||
*/
|
||||
public static final String DATASOURCE_PASSWORD_REGEX =
|
||||
"(?<=((?i)password((\\\\\":\\\\\")|(=')))).*?(?=((\\\\\")|(')))";
|
||||
"(?<=((?i)password((\":\")|(=')))).*?(?=((\")|(')))";
|
||||
|
||||
/**
|
||||
* default worker group
|
||||
|
@ -47,11 +47,11 @@ public class SensitiveDataConverterTest {
|
||||
+ "\"database\":\"carbond\","
|
||||
+ "\"jdbcUrl\":\"jdbc:mysql://192.168.xx.xx:3306/ods\","
|
||||
+ "\"user\":\"view\","
|
||||
+ "\"password\":\"******\"}";
|
||||
+ "\"password\":\"*****\"}";
|
||||
|
||||
@Test
|
||||
public void convert() {
|
||||
Assert.assertNotEquals(maskLogMsg, passwordHandler(pwdPattern, logMsg));
|
||||
Assert.assertEquals(maskLogMsg, passwordHandler(pwdPattern, logMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,8 +62,8 @@ public class SensitiveDataConverterTest {
|
||||
logger.info("parameter : {}", logMsg);
|
||||
logger.info("parameter : {}", passwordHandler(pwdPattern, logMsg));
|
||||
|
||||
Assert.assertEquals(logMsg, passwordHandler(pwdPattern, logMsg));
|
||||
Assert.assertNotEquals(maskLogMsg, passwordHandler(pwdPattern, logMsg));
|
||||
Assert.assertNotEquals(logMsg, passwordHandler(pwdPattern, logMsg));
|
||||
Assert.assertEquals(maskLogMsg, passwordHandler(pwdPattern, logMsg));
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user