mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
This commit is contained in:
1 parent
7edb66c311
commit
525de56036
2 files changed
+10
-1
No files matched your search
@@ -4,8 +4,9 @@ from typing import Literal
|
|||||||
|
|
||||||
api_filter = r"(.*&key=)([^&]*)(.*)"
|
api_filter = r"(.*&key=)([^&]*)(.*)"
|
||||||
home_filter = r"(/home/)([^\s'\/]*)(.*)"
|
home_filter = r"(/home/)([^\s'\/]*)(.*)"
|
||||||
|
user_filter = r"(.*Steam/userdata/)([^/]*)(.*)"
|
||||||
REDACTED = r"\1REDACTED\3"
|
REDACTED = r"\1REDACTED\3"
|
||||||
REDACTION_PATTERNS = [api_filter, home_filter]
|
REDACTION_PATTERNS = [api_filter, home_filter, user_filter]
|
||||||
|
|
||||||
|
|
||||||
def redact_home(text: str) -> str:
|
def redact_home(text: str) -> str:
|
||||||
|
|||||||
@@ -37,6 +37,14 @@ class RecordsListHandler(logging.Handler):
|
|||||||
"Error in directory: '/home/SENSITIVE_USERNAME'",
|
"Error in directory: '/home/SENSITIVE_USERNAME'",
|
||||||
"Error in directory: '/home/REDACTED'",
|
"Error in directory: '/home/REDACTED'",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"User directory: /home/user/.local/share/Steam/userdata/999999/grid",
|
||||||
|
"User directory: /home/REDACTED/.local/share/Steam/userdata/REDACTED/grid",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"User directory: /drive/.local/share/Steam/userdata/999999",
|
||||||
|
"User directory: /drive/.local/share/Steam/userdata/REDACTED",
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_log_redaction(log_error: str, expect: str) -> None:
|
def test_log_redaction(log_error: str, expect: str) -> None:
|
||||||
|
|||||||
Reference in new issue
Block a user