refactor(egress): split DLP detector-config parsing into its own module
`egress_addon_core.py` mixed the per-route `dlp:` block parser (`_parse_detectors` plus the detector-name and `outbound_on_match` constants) in with the request-time scan/decision flow. Move that config-parsing layer into a new stdlib-only `egress_dlp_config.py` as `parse_dlp_block`, so the decision path in the core module reads top-to-bottom without scrolling past config plumbing. The constants and parser are re-exported from `egress_addon_core` (and listed in `__all__`) so existing `from egress_addon_core import ON_MATCH_*` / `OUTBOUND_DETECTOR_NAMES` callers are unchanged. The new module ships flat into the sidecar bundle (Dockerfile.sidecars) and uses the same flat/package import shim as its siblings. Pure refactor; behavior and wire format unchanged. Closes #287 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkwFXLFff9PYPy4wgVBJp9
This commit is contained in:
@@ -62,6 +62,7 @@ COPY --from=gitleaks-src /usr/bin/gitleaks /usr/bin/gitleaks
|
||||
# top-level siblings (absolute imports), matching the prior
|
||||
# Dockerfile.egress / Dockerfile.supervise layout.
|
||||
COPY bot_bottle/egress_addon_core.py /app/egress_addon_core.py
|
||||
COPY bot_bottle/egress_dlp_config.py /app/egress_dlp_config.py
|
||||
COPY bot_bottle/egress_addon.py /app/egress_addon.py
|
||||
COPY bot_bottle/dlp_detectors.py /app/dlp_detectors.py
|
||||
COPY bot_bottle/yaml_subset.py /app/yaml_subset.py
|
||||
|
||||
Reference in New Issue
Block a user