Implement Monlet MVP stack and UI updates

This commit is contained in:
Stanislav Rossovskii
2026-05-27 10:01:59 +04:00
parent dcea096327
commit edc51e9c59
145 changed files with 15618 additions and 248 deletions

View File

@@ -0,0 +1,26 @@
import re
_PATTERNS: list[tuple[re.Pattern[str], object]] = [
(
re.compile(r"(?i)(authorization|set-cookie|cookie)([\"'=:]+\s*)([^\r\n]+)"),
lambda m: f"{m.group(1)}{m.group(2)}***",
),
(
re.compile(r"(?i)(token|secret|password|api[_-]?key|credential)([\"'=:]+\s*)([^\s\"',;]+)"),
lambda m: f"{m.group(1)}{m.group(2)}***",
),
(re.compile(r"(?i)(bearer)\s+\S+"), r"\1 ***"),
]
def redact(value: str | None) -> str | None:
if value is None:
return None
out = value
for pat, repl in _PATTERNS:
out = pat.sub(repl, out)
return out
def redact_dict(d: dict) -> dict:
return {k: redact(v) if isinstance(v, str) else v for k, v in d.items()}