qiuyanjun888 commented on code in PR #18397:
URL: 
https://github.com/apache/dolphinscheduler/pull/18397#discussion_r3577022165


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/log/SensitiveDataConverter.java:
##########
@@ -37,6 +37,18 @@ public class SensitiveDataConverter extends MessageConverter 
{
     private static Pattern multilinePattern;
     private static final Set<String> maskPatterns = new HashSet<>();
 
+    private static final String KNOWN_SENSITIVE_CONFIGURATION_KEY_REGEX =
+            
"(?:password|access[._-]?key(?:[._-]?(?:id|secret))?|secret[._-]?access[._-]?key|secret[._-]?key)";
+
+    private static final Pattern QUOTED_SENSITIVE_CONFIGURATION_PATTERN = 
Pattern.compile(

Review Comment:
   Fixed in `1e61609d`. I replaced the lazy quoted-value match with quote-aware 
delimiter scanning, so escaped quotes are not treated as the end of the value. 
Known-sensitive masking now also runs before the legacy configured patterns, 
preventing the old password regex from truncating the value first.
   
   The exact JSON example now becomes `{"password":"******","bucket":"ds"}`.
   
   Validation: `SensitiveDataConverterTest` passed 7/7, `DinkyLogSanitizerTest` 
passed 5/5, and Spotless passed for both task-api and task-dinky.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to