judgevet.adapters.outbound.network
Status: draft.
judgevet.adapters.outbound.network
Configure HTTPX proxy routing and certificate verification explicitly.
HTTPX defaults and environment behavior are documented at https://www.python-httpx.org/advanced/ssl/ and https://www.python-httpx.org/environment_variables/.
Examples:
from judgevet.adapters.outbound.network import NetworkConfig
assert NetworkConfig().verification() is True
See Also
- judgevet.adapters.outbound.http: Sync and async HTTP clients.
- judgevet.adapters.inbound.settings: Environment configuration.
NetworkConfig
dataclass
Select explicit network options while retaining secure defaults.
Attributes:
| Name | Type | Description |
|---|---|---|
proxy |
str | None
|
Explicit HTTPX proxy URL, omitted from representation. |
ca_bundle |
str | None
|
PEM trust bundle replacing default CA roots. |
verify |
bool
|
Verify certificate chains and hostnames by default. |
Examples:
network = NetworkConfig(ca_bundle="/etc/company/ca.pem")
assert network.verify is True
__post_init__()
Reject contradictory or incorrectly typed verification choices.
Raises:
| Type | Description |
|---|---|
TypeError
|
If verify is not a boolean. |
ValueError
|
If a trust bundle accompanies disabled verification. |
verification()
Build explicit trust roots or retain HTTPX verification behavior.
Returns:
| Type | Description |
|---|---|
SSLContext | bool
|
A verifying context for an explicit CA bundle, otherwise verify. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the configured CA bundle cannot be loaded. |