fix(proxy): keep service traffic on --proxy and warn about requests that bypass it

--proxy now overrides HTTP(S)_PROXY and the Windows system proxy while keeping the env CA bundle. Core fallback sessions use the run's proxy, and a warn-only audit hook names service code that sends a request or opens a raw socket outside the proxy; a session with proxy_exempt = True opts out.
This commit is contained in:
imSp4rky
2026-10-16 16:12:42 -06:00
parent 95ec73ece5
commit bfda31ce4a
25 changed files with 575 additions and 28 deletions
+13
View File
@@ -191,6 +191,19 @@ def test_requests_spec_carries_verify() -> None:
assert rebuilt.verify is False
def test_requests_spec_carries_trust_env() -> None:
"""A proxied session ignores env proxies, so a child must not let HTTPS_PROXY win again."""
rs = Session()
rs.trust_env = False
spec = build_session_spec(rs)
assert spec is not None
rebuilt = rebuild_session(pickle.loads(pickle.dumps(spec)), 1)
assert rebuilt is not None
assert rebuilt.trust_env is False
def test_requests_spec_carries_params() -> None:
"""Services hold an auth token in session.params; without it every segment request is unauthed."""
rs = Session()