Skip to content

Commit

Permalink
Redact conn secrets in webserver logs (#16579)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2a59de3)
  • Loading branch information
msumit authored and jhtimmins committed Aug 9, 2021
1 parent 88fd2db commit 4d2db2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/hooks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from airflow.typing_compat import Protocol
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.log.secrets_masker import redact

if TYPE_CHECKING:
from airflow.models.connection import Connection # Avoid circular imports.
Expand Down Expand Up @@ -74,8 +75,8 @@ def get_connection(cls, conn_id: str) -> "Connection":
conn.port,
conn.schema,
conn.login,
conn.password,
conn.extra_dejson,
redact(conn.password),
redact(conn.extra_dejson),
)
return conn

Expand Down

0 comments on commit 4d2db2e

Please sign in to comment.