Skip to content

Commit

Permalink
fixup! Mask secret values from connections and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ashb committed May 4, 2021
1 parent 7d7b2da commit 3c6e356
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions airflow/sensors/smart_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,18 @@ def create_new_task_handler():
Create task log handler for a sensor work.
:return: log handler
"""
from airflow.utils.log.secrets_masker import _secrets_masker # noqa

handler_config_copy = {k: handler_config[k] for k in handler_config}
del handler_config_copy['filters']

formatter_config_copy = {k: formatter_config[k] for k in formatter_config}
handler = dictConfigurator.configure_handler(handler_config_copy)
formatter = dictConfigurator.configure_formatter(formatter_config_copy)
handler.setFormatter(formatter)

# We want to share the _global_ filterer instance, not create a new one
handler.addFilter(_secrets_masker())
return handler

def _get_sensor_logger(self, si):
Expand Down

0 comments on commit 3c6e356

Please sign in to comment.