oxsean commented on code in PR #15699:
URL: https://github.com/apache/dubbo/pull/15699#discussion_r2367460947
##########
dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java:
##########
@@ -501,4 +505,29 @@ public static String getProperty(String property, String
defaultValue) {
public static int get(String property, int defaultValue) {
return get(ApplicationModel.defaultModel(), property, defaultValue);
}
+
+ private static volatile Set<String> SensitiveParameterNames;
+
+ public static boolean isSensitiveParameter(URL url, String name) {
+ if (SensitiveParameterNames == null) {
+ synchronized (ConfigurationUtils.class) {
+ if (SensitiveParameterNames == null) {
+ Set<String> names = new HashSet<>();
+ // Always include default sensitive parameters
+ names.add(CommonConstants.PASSWORD_KEY);
+ names.add("secretKey");
+
+ // Add custom parameters from configuration
+ String value =
getProperty(url.getOrDefaultApplicationModel(), SENSITIVE_PARAMETER_NAMES);
+ if (value != null) {
+ String[] customNames = StringUtils.tokenize(value);
+ names.addAll(Arrays.asList(customNames));
Review Comment:
Collections.addAll
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]