Skip to content

Commit

Permalink
Mask value if the key is token (#16474)
Browse files Browse the repository at this point in the history
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

GitOrigin-RevId: d1d04fee8ded551c9fd0a13980feab27fbfc0cbe
  • Loading branch information
robertsaxby authored and Cloud Composer Team committed Mar 10, 2022
1 parent 566e084 commit ee898a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions airflow/utils/log/secrets_masker.py
Expand Up @@ -42,6 +42,7 @@
'password',
'private_key',
'secret',
'token',
}
)
"""Names of fields (Connection extra, Variable key name etc.) that are deemed sensitive"""
Expand Down

0 comments on commit ee898a3

Please sign in to comment.