Skip to main content

Module iroh_moq

Module iroh_moq 

Source
Expand description

Iroh streaming plane — moq-lite (moql ALPN) protocol handler.

Part of Epic #131 Phase 3 (#134). This module ships the wire layer for the streaming plane:

  • IrohMoqProtocolHandler plugs into crate::transport::iroh_substrate under the moql ALPN, wrapping each accepted iroh Connection as a web_transport_iroh::Session and handing it to moq_net::Server, which spawns the moq-lite session machinery internally.
  • One shared OriginShared (an OriginProducer + matching OriginConsumer) is held by the handler; the same origin is used for in-process publishing (callers obtain it via IrohMoqProtocolHandler::origin_producer and create broadcasts directly) and for external subscribers — per spike #94’s finding, moq_net::Server does exactly this.

Trust model: §7.5 unchanged. On the wire, subscribers learn the DH-derived (unguessable) Track path out-of-band via authenticated RPC (a signed StreamInfo), and the per-Frame payload carries the chained-HMAC envelope. CDN-portability per §10.x of the Federated Agentic Namespaces doc. Admission: without an authenticator the carrier is unauthenticated and the accept path refuses anonymous peers; with a crate::transport::moql_admission::MoqlAdmissionAuthenticator installed (#1027), each connection must first prove an accepted current Ed25519 + ML-DSA-65 identity inside the carrier, and is then served only its own tenant’s scope.

What this module does NOT do: refactor StreamService or EventService to use this. That lands in Phase 3 part 2+ along with the §7.5 chained-HMAC tokenstream port.

Structs§

IrohMoqProtocolHandler
iroh ProtocolHandler for the moql ALPN. Each accepted connection is wrapped as a web_transport_iroh::Session and handed to moq_net::Server::accept, which performs the moq handshake and spawns the session machinery.
MoqAuthzConfig
#276 authorization config for a moq accept path: an optional subscribe authorizer and an optional peer→tenant resolver for per-tenant announce scoping. Absence of fresh application/session proof is always fail-closed; these hooks cannot turn an anonymous carrier into an authenticated peer.
OriginShared
Shared Origin clone-pair held by the handler.

Traits§

IngressAuthorizer
Trusted decision for granting an admitted peer ingress into a tenant’s shared origin. Admission proves the peer identity and tenant only; it does not imply that the peer may publish. The default is therefore deny.

Type Aliases§

PeerTenantResolver
Resolves the tenant for an independently authenticated application peer. Carrier NodeId is never passed here. Without a fresh-proof seam (#1027) the iroh accept path refuses before invoking this resolver; with a MoqlAdmissionAuthenticator installed, the resolver runs inside the admission exchange over the verified subject.
SharedIngressAuthorizer
Shareable ingress authorization hook supplied by the owning service policy.