Expand description
Transport layer for submilli:http — the embedder-facing HttpClient /
AuthProxy traits, the default reqwest client with SSRF policy, and the
bounded download/decompression plumbing. No Wasm ABI here; the package’s
host fns live in super.
Structs§
- Download
Meta - Body was streamed to the caller’s writer; only metadata survives.
- Download
Progress - Progress remains observable when a download fails or is cancelled.
- Http
Request - Http
Response - 4xx/5xx are not errors at this layer — only transport failures become
HttpError. - Noop
Auth Proxy - Recorded
Request - How the call log keys and digests a request: its masked URL, and the digest of its masked meta and body. The auth proxy may rewrite the URL and headers (a credential injected into the query or a header, in another position), so a transport that must recognize a request it saw recorded reads this instead of deriving it again.
- Redirect
Denied - A hop the guard refused. Transports return it unchanged as
HttpError::PermissionDeniedso the guest sees the original denial. - Redirect
Hop - The request a redirect is about to send.
- Reqwest
Http Client - Default
HttpClient— asyncreqwest, built with the SSRF policy resolver. Redirects are followed byReqwestHttpClient::follow_redirectsrather than reqwest, so every hop is checked against the request’s own policy and guard and the pooled client holds no per-request authorization. Thecookiesfeature is intentionally never enabled, so the client carries no cross-request state; the server builds one per session (seesubmilli-server) for tenant isolation.
Enums§
- Auth
Proxy Error - Decompression
- Egress
At - Which request an egress refusal belongs to, for a guard that records decisions.
- Http
Error
Traits§
- Auth
Proxy - Pipeline:
host fn → auth_proxy.transform(req, caller) → http_client.send(req). Consume-and-return so middlewares compose:m2.transform(m1.transform(req, c)?, c)?.calleris the package that made the call ("main"for the user’s script); blueprint auth-proxy injection applies only tomain. - Http
Client - Embedder-supplied HTTP transport. 4xx/5xx are not errors; only transport
failures return
Err(HttpError).Send + Syncfor sharing across stores. Implementations must enforceHttpRequest::transport_policy, including redirect destinations, and must callHttpRequest::redirect_guardbefore sending each redirect hop, returning its denial asHttpError::PermissionDenied; a transport that follows redirects without the guard bypasses the blueprint’s capability rules. PreserveHttpError::Internalas a fatal host failure. - Redirect
Guard - Authorizes one redirect hop before any byte of it is sent.
Functions§
- default_
auth_ proxy - default_
http_ client - describe_
error_ chain - detect_
decompression - Public so embedder
HttpClient::downloadimpls can apply the right decoder before counting bytes againstmax_response_size. - is_
policy_ refusal - Whether an error chain (as
describe_error_chainrenders it) is the network policy refusing the destination, which reaches a client builder’s caller as a connect error. - stream_
to_ writer - Bounded chunked copy (8 KiB stack chunk) with optional gzip/zstd decoding.
Public so embedder
HttpClient::downloadimpls can reuse it:readeris the response body as it arrives, decoded intowriterexactly as the built-in client decodes a download, with the same limits on the wire and decoded bytes.