amoghrajesh commented on code in PR #43040:
URL: https://github.com/apache/airflow/pull/43040#discussion_r1809926938


##########
airflow/settings.py:
##########
@@ -722,6 +722,22 @@ def import_local_settings():
         log.info("Loaded airflow_local_settings from %s .", 
airflow_local_settings.__file__)
 
 
+def mask_conf_values():
+    from airflow.utils.log.secrets_masker import mask_secret
+
+    for section, key in conf.sensitive_config_values:
+        try:
+            value = conf.get(section, key)
+        except AirflowConfigException:
+            log.warning(
+                "Could not retrieve value from section %s, for key %s. 
Skipping redaction of this conf.",
+                section,
+                key,
+            )
+            continue

Review Comment:
   Makes sense, this will log a couple of times.
   I will make this change and move it to DEBUG so that the log flooding is 
much lesser.



##########
airflow/settings.py:
##########
@@ -722,6 +722,22 @@ def import_local_settings():
         log.info("Loaded airflow_local_settings from %s .", 
airflow_local_settings.__file__)
 
 
+def mask_conf_values():
+    from airflow.utils.log.secrets_masker import mask_secret
+
+    for section, key in conf.sensitive_config_values:
+        try:
+            value = conf.get(section, key)
+        except AirflowConfigException:
+            log.warning(
+                "Could not retrieve value from section %s, for key %s. 
Skipping redaction of this conf.",
+                section,
+                key,
+            )
+            continue
+        mask_secret(value)

Review Comment:
   Let me try that out, makes sense.



-- 
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