You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by jh...@apache.org on 2021/08/13 18:20:30 UTC
[airflow] 10/38: Redact conn secrets in webserver logs (#16579)
This is an automated email from the ASF dual-hosted git repository.
jhtimmins pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 6eec6d0e37cc27d1743922931dcde2a3b16900bf
Author: Sumit Maheshwari <ms...@users.noreply.github.com>
AuthorDate: Tue Jun 22 14:40:45 2021 +0530
Redact conn secrets in webserver logs (#16579)
(cherry picked from commit 2a59de3e558e3b60caad876dee8fa4b43a7a17cf)
---
airflow/hooks/base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/airflow/hooks/base.py b/airflow/hooks/base.py
index f286a6f..3531bf3 100644
--- a/airflow/hooks/base.py
+++ b/airflow/hooks/base.py
@@ -22,6 +22,7 @@ from typing import TYPE_CHECKING, Any, Dict, List
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.
@@ -74,8 +75,8 @@ class BaseHook(LoggingMixin):
conn.port,
conn.schema,
conn.login,
- conn.password,
- conn.extra_dejson,
+ redact(conn.password),
+ redact(conn.extra_dejson),
)
return conn