Expand description
Iroh RPC plane — server-side protocol handler for ALPN hyprstream-rpc/1.
Part of Epic #131 Phase 2 (#133). This module ships:
IrohRpcProtocolHandler— iroh [ProtocolHandler] that plugs intocrate::transport::iroh_substrateunder thehyprstream-rpc/1ALPN. Enforces a server-wide cap on concurrent streams (DoS bound) and drains in-flight requests onProtocolHandler::shutdown.IrohRequestProcessor— sealed request processing trait; production network sessions admit only the canonical envelope/service bridge.LocalServiceBridge— adapts acrate::service::RequestService(potentially!Send) to the Send-boundedIrohRequestProcessor.
Trust model: The protocol handler does not parse SignedEnvelope —
it forwards opaque bytes to the IrohRequestProcessor. Envelope
verification, JWT/DPoP, and authorize_signer enforcement happen inside
the processor (which is LocalServiceBridge in production, delegating
to crate::service::dispatch::process_request). The handler does
hold a signing key for trusted-local transport-only processor failures.
Admission failures on the untrusted iroh carrier are reset/dropped without
a signed response, preventing an unauthenticated signing oracle.
Wire framing: each request is the opaque bytes of a Cap’n Proto-encoded
crate::envelope::SignedEnvelope written to a freshly-opened iroh bidi
stream. The response is symmetric. Both endpoints are our code; iroh’s
QUIC TLS authenticates the addressed NodeId only at the carrier layer; the
request envelope independently supplies application identity proof.
Re-exports§
pub use super::rpc_session::build_error_envelope;pub use super::rpc_session::from_fn;pub use super::rpc_session::read_to_cap;pub use super::rpc_session::serve_rpc_connection;pub use super::rpc_session::IrohRequestProcessor;pub use super::rpc_session::DEFAULT_STREAM_LIMIT;pub use super::rpc_session::MAX_FRAME_BYTES;
Structs§
- Iroh
RpcProtocol Handler - Iroh protocol handler that terminates
hyprstream-rpc/1bidi streams, dispatches each request through the wrappedIrohRequestProcessor, caps concurrent streams server-wide (shared semaphore), and drains in-flight requests onProtocolHandler::shutdown(called byRouter::shutdown). - Local
Service Bridge - Adapt a
crate::service::RequestServicetoIrohRequestProcessor.
Enums§
- Bridge
Shutdown Error - Stable terminal outcome shared by all explicit shutdown waiters.
Functions§
- client_
request - Client-side helper: open a bidi stream on
hyprstream-rpc/1against an already-connected iroh [Connection], write the request, read the response.