This commit is contained in:
Alexander Myasoedov
2026-05-14 19:08:40 +03:00
parent 695eac4144
commit d5cd85f8cb
3 changed files with 213 additions and 5 deletions
+4 -4
View File
@@ -166,10 +166,10 @@ def sanitize_log_output(data: str | dict) -> str:
data = str(data)
patterns = [
(r'(api[_-]?key["\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(token["\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(password["\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(secret["\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(api[_-]?key["\'\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(token["\'\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(password["\'\s:=]+)["\']?[\w-]+', r"\1***"),
(r'(secret["\'\s:=]+)["\']?[\w-]+', r"\1***"),
(r"Bearer\s+[\w-]+", "Bearer ***"),
]