Skip to main content

Module carrier

Module carrier 

Source
Expand description

Receive-side carrier classification (INV-2, #1042; ADR #1023).

A CarrierContext states, for one accepted connection/request, which class of carrier the bytes arrived on. It is constructed only at the server’s real accept boundary (the listener/session code in this crate) and threaded through super::rpc_session::serve_rpc_connection and crate::service::dispatch::process_request to the envelope-policy chokepoints. It is never derived from request bytes, headers, JWT claims, remote addresses, or caller assertions — whoever constructs a request must not be able to construct its trust class.

The context answers exactly one policy question on the receive path: may a cleartext (encrypted_envelope == None) request envelope be processed? Untrusted carriers (iroh direct/relay, QUIC including loopback, WebTransport, unknown) must reject cleartext before claims evaluation or handler dispatch; only explicitly trusted same-host carriers (inproc, UDS, systemd-activated UDS) retain their documented cleartext behavior.

This mirrors the send side’s Transport::forbids_cleartext_envelope (#1036) so the two halves of INV-2 (#1028) classify identically. The carrier context is not an identity: remote NodeId, TLS identity, relay/direct state, and signer equality remain diagnostics — live identity admission is #1027’s separate evidence.

Structs§

CarrierContext
Carrier class of an accepted RPC connection, as attested by the accept boundary that constructed it.