Skip to content

feat(client): add trust_env proxy resolver foundation#173

Merged
GefMar merged 1 commit into
mainfrom
trust_env
Jun 6, 2026
Merged

feat(client): add trust_env proxy resolver foundation#173
GefMar merged 1 commit into
mainfrom
trust_env

Conversation

@GefMar
Copy link
Copy Markdown
Contributor

@GefMar GefMar commented Jun 6, 2026

Summary

Adds the trust_env proxy resolver foundation for FogHTTP.

This PR makes trust_env=True accepted and resolves supported proxy/TLS environment settings once during client configuration. It does not implement actual HTTP proxy routing or HTTPS CONNECT yet; those remain follow-up transport tasks.

Changes

  • Added internal proxy resolver package under foghttp/_client/proxy/.
  • Added typed proxy models for proxy URLs, targets, decisions, sources, and rules.
  • Implemented environment parsing for:
    • HTTP_PROXY / http_proxy
    • HTTPS_PROXY / https_proxy
    • ALL_PROXY / all_proxy
    • NO_PROXY / no_proxy
    • SSL_CERT_FILE / ssl_cert_file
  • Ignored uppercase HTTP_PROXY in CGI-like environments when REQUEST_METHOD is set.
  • Added focused NO_PROXY matching for wildcard, exact host, suffix, port, localhost, IPv4, and IPv6 rules.
  • Mapped SSL_CERT_FILE to TLSConfig only when explicit tls= is not provided.
  • Removed the obsolete trust_env argument from the Rust RawClient constructor boundary.
  • Added proxy/trust_env documentation and updated limitations/TLS/request-builder wording.

Security / Lifecycle Notes

  • Environment values are snapshotted at client config creation, not read on each request.
  • Proxy credentials are redacted in repr/error-facing surfaces.
  • SSL_CERT_DIR, TLS verification disabling, PAC/WPAD, SOCKS, HTTP proxy routing, and HTTPS CONNECT remain unsupported.
  • Proxy decisions stay in Python control-plane until transport support is implemented.

Comment thread tests/client_proxy/test_client_config.py Fixed
Comment thread tests/client_proxy/test_client_config.py Fixed
fix(proxy): reject bracketed non-ipv6 no_proxy hosts
fix(proxy): harden trust_env proxy parsing
fix(proxy): harden trust_env parser contract
fix(proxy): harden trust_env resolver security contract
@GefMar GefMar merged commit afa2de0 into main Jun 6, 2026
11 checks passed
@GefMar GefMar deleted the trust_env branch June 6, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant