http
azure_bootstrap.http
¶
Hardened outbound HTTP client — sync requests stack.
Modules:
| Name | Description |
|---|---|
async_client |
Optional httpx async HTTP client stack. |
Functions:
| Name | Description |
|---|---|
build_session |
Return a |
request_with_retry |
Issue an HTTP request with default timeout, traceparent, and SSRF guard. |
normalize_pem |
Normalize PEM strings mangled by env/Key Vault (spaces, CRLF). |
write_temp_pem |
Write normalized PEM to a temp file; caller owns cleanup. |
build_session
¶
build_session(*, total_retries: int = 5, backoff_factor: float = 1.0, pool_connections: int = 10, pool_maxsize: int = 10) -> Any
Return a requests.Session with urllib3 Retry mounted.
Source code in azure_bootstrap/http/__init__.py
request_with_retry
¶
request_with_retry(method: str, url: str, *, session: Any | None = None, timeout: float = _DEFAULT_TIMEOUT, headers: dict[str, str] | None = None, allow_private: bool = False, **kwargs: Any) -> Any
Issue an HTTP request with default timeout, traceparent, and SSRF guard.
Source code in azure_bootstrap/http/__init__.py
normalize_pem
¶
Normalize PEM strings mangled by env/Key Vault (spaces, CRLF).
Source code in azure_bootstrap/http/__init__.py
write_temp_pem
¶
Write normalized PEM to a temp file; caller owns cleanup.