mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
This commit is contained in:
1 parent
2418d8be68
commit
78151b3bb3
2 files changed
+1
-2
No files matched your search
@@ -4,7 +4,7 @@ from typing import Literal
|
|||||||
|
|
||||||
api_filter = r"(.*&key=)([^&]*)(.*)"
|
api_filter = r"(.*&key=)([^&]*)(.*)"
|
||||||
# FIXME: handle whitespace after directory name ($HOME root)
|
# FIXME: handle whitespace after directory name ($HOME root)
|
||||||
home_filter = r"(/home/)([^/]*)(.*)"
|
home_filter = r"(/home/)([^\s'\/]*)(.*)"
|
||||||
REDACTED = r"\1REDACTED\3"
|
REDACTED = r"\1REDACTED\3"
|
||||||
REDACTION_PATTERNS = [api_filter, home_filter]
|
REDACTION_PATTERNS = [api_filter, home_filter]
|
||||||
|
|
||||||
|
|||||||
@@ -51,5 +51,4 @@ def test_log_redaction(log_error: str, expect: str) -> None:
|
|||||||
|
|
||||||
logger.critical(log_error)
|
logger.critical(log_error)
|
||||||
redacted = handler.pop()
|
redacted = handler.pop()
|
||||||
print(redacted)
|
|
||||||
assert expect == redacted
|
assert expect == redacted
|
||||||
Reference in new issue
Block a user