feat(dlp): websocket scanning, response headers, extended encoding variants, sk-proj pattern (PRD 0053)

This commit is contained in:
2026-06-06 17:59:36 +00:00
committed by didericis
parent 76e38b24e6
commit 1ecef55fea
6 changed files with 300 additions and 33 deletions
+17
View File
@@ -538,6 +538,22 @@ def build_outbound_scan_text(
return "\n".join(parts)
def build_inbound_scan_text(
headers: typing.Mapping[str, str],
body: str,
) -> str:
"""Assemble inbound response surfaces into one string for DLP scanning.
Covers all response headers plus body.
"""
parts: list[str] = []
for name, value in headers.items():
parts.append(f"{name}: {value}")
if body:
parts.append(body)
return "\n".join(parts)
def _detector_enabled(
configured: tuple[str, ...] | None,
name: str,
@@ -610,6 +626,7 @@ __all__ = [
"PathMatch",
"Route",
"ScanResult",
"build_inbound_scan_text",
"build_outbound_scan_text",
"decide",
"evaluate_matches",