rmetzger commented on code in PR #26803:
URL: https://github.com/apache/flink/pull/26803#discussion_r2211303565
##########
flink-python/src/main/java/org/apache/flink/client/python/PythonEnvUtils.java:
##########
@@ -544,4 +541,23 @@ public void run() {
}
}
}
+
+ /**
+ * Redacts values of sensitive environment variables before logging.
+ * Keys containing patterns such as SECRET, TOKEN, PASSWORD, or KEY
(case-insensitive)
+ * will have their values replaced with "***REDACTED***".
+ */
+ public static String redactEnv(Map<String, String> environment) {
+ return environment.entrySet().stream()
+ .map(
+ e -> {
+ String key = e.getKey();
+ String value =
+
key.toUpperCase().matches(".*(SECRET|TOKEN|PASSWORD|KEY).*")
Review Comment:
We maintain a list of sensitive keys in `GlobalConfiguration.isSensitive(s)`.
Can you call into that method for making the check, and also use the
`HIDDEN_CONTENT` static string from there?
--
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]