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


##########
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:
   I'm saying, that since the import is here, that we can move this function to 
be a method on our Configuration class in airflow/configuration.py without 
causing any import cycles. Importing things inside a function to avoid import 
loops is a pattern we do a lot in Airflow.



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