Skip to main content

Crate osproxy_transport

Crate osproxy_transport 

Source
Expand description

Transport layer: bytes on and off the wire.

Owns protocol framing and, in a later slice, TLS termination behind the CryptoProvider seam (docs/07) and pooled upstream connections (docs/04 §7). It knows nothing about routing decisions or tenancy semantics.

M1 implements the HTTP/1.1 cleartext ingress: serve accepts connections, parses each request into an owned IngressRequest (with its EndpointKind classified by classify()), invokes an IngressHandler, and writes the IngressResponse. The handler, implemented by the binary, is where the request meets the engine pipeline.

Structs§

Classified
The result of classifying a request path.
Incoming
The streamed request body type for IngressHandler::handle_forward, re-exported so handlers can name it without depending on hyper directly. A stream of Bytes, used when receiving bodies from the network.
IngressLimits
Per-ingress memory bounds. Sized for bulk: max_body_bytes is the largest single body buffered, inflight_ceiling the largest sum across concurrent requests before new ones are shed with 429.
IngressRequest
A parsed, owned client request ready for the pipeline.
IngressResponse
The response a handler returns for the transport to write back.
RingProvider
A CryptoProvider backed by rustls’s pure-Rust ring module (non-fips feature). Not FIPS-validated, fips_mode() is always false. Server-auth and mutual-TLS, built from PEM.
StreamingResponse
A streaming response a handler returns for a verbatim forward (ADR-014): a status, extra headers, and a body piped to the client without buffering.

Enums§

TlsError
A failure building a RingProvider from PEM material.

Constants§

DRAIN_DEADLINE
How long graceful shutdown waits for in-flight requests to drain before giving up and dropping the remainder (NFR-R5).
FIPS_APPROVED_SUITES
The FIPS-approved TLS cipher suites the proxy offers (docs/07 §2 caveat 3, NFR-S5): TLS 1.3 and TLS 1.2 AES-GCM only. CHACHA20-POLY1305 is deliberately excluded, it is not a FIPS-approved suite. This wire policy is applied to every provider, FIPS-validated or not, so the suites negotiated are identical regardless of the underlying module; the FIPS module changes validation, not the suites on the wire. The set is keyed on the provider-independent CipherSuite identifier so the aws-lc-rs provider pins the exact same list.

Traits§

CryptoProvider
The pluggable TLS backend.
IngressHandler
Handles a parsed ingress request, producing a response.

Functions§

buffered_response
Wraps fully-buffered bytes as a ResponseBody (the buffered response path).
classify
Classifies a method + path into an endpoint, logical index, and doc id.
serve
Serves HTTP/1.1 requests on listener with the default IngressLimits.
serve_grpc
Serves the gRPC DocumentService on listener, dispatching each RPC through handler (the same pipeline the HTTP ingress drives), until it errors.
serve_grpc_tls
Serves the gRPC DocumentService on listener over TLS, terminating each connection with provider’s configuration (mutual TLS when the provider requires a client certificate, whose identity reaches the handler).
serve_tls
Serves HTTPS requests on listener, terminating TLS with provider’s configuration, until the listener errors.
serve_tls_with_limits
Serves HTTPS requests on listener under the given memory limits, terminating TLS with provider’s configuration, until the listener errors.
serve_tls_with_shutdown
Like serve_tls, but drains in-flight requests when shutdown resolves (NFR-R5), bounded by DRAIN_DEADLINE.
serve_with_limits
Serves HTTP/1.1 requests on listener, dispatching each to handler under the given memory limits (per-request 413, in-flight 429), until the listener errors.
serve_with_shutdown
Like serve, but stops accepting and drains in-flight requests when shutdown resolves (NFR-R5). In-flight connections finish their current request and close; the drain is bounded by DRAIN_DEADLINE.

Type Aliases§

DefaultCryptoProvider
The crypto provider the active build selected: RingProvider under non-fips, AwsLcFipsProvider under fips. Server/wiring code names this alias so it never hard-codes a concrete provider or branches on the feature.
ResponseBody
The transport’s HTTP response body: boxed so a response may be buffered bytes or a live stream piped from the upstream without buffering (ADR-014). Unsync, the server only needs Send. Structurally identical to osproxy-sink’s ByteBody, so a streamed upstream response flows through as-is, no copy.