mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-22 00:45:10 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user