ashb commented on code in PR #43040:
URL: https://github.com/apache/airflow/pull/43040#discussion_r1808815806
##########
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:
How many messages is this going to create every time Airflow starts up? This
would also appear inside the task instance logs, so I think this should
probably be reduced to a debug level log so that it doesn't "spam" things.
##########
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:
Wait, the import is already inside this function anyway, so it wouldn't
create a circular import (only top level imports can create circular imports.
(Circular dependency, sure, but that's a fact of life in python really.)
--
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]