Split DLP detector-config parsing into its own module #291
Reference in New Issue
Block a user
Delete Branch "decompose-egress-dlp-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #287.
Summary
bot_bottle/egress_addon_core.py(862 LOC) mixed the per-routedlp:block parser —_parse_detectorsplus the detector-name frozensets andoutbound_on_matchpolicy constants — in with the request-time scan/decision flow.This moves that config-parsing layer into a new stdlib-only
bot_bottle/egress_dlp_config.pyasparse_dlp_block, so the decision path in the core module reads top-to-bottom without scrolling past config plumbing.Compatibility
ON_MATCH_*constants,OUTBOUND_ON_MATCH_VALUES,DEFAULT_OUTBOUND_ON_MATCH, andparse_dlp_blockare re-exported fromegress_addon_core(and listed in its__all__), so existingfrom egress_addon_core import …callers (egress_addon.py,egress.py, tests) are unchanged.Dockerfile.sidecars) and uses the same flat/package import shim as its siblings; both import paths are verified.Full unit suite (1297 tests) passes; pyright clean; pylint 10.00 on the changed files.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.