pub trait SubscribeAuthorizer: Send + Sync {
// Required method
fn authorize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
peer: &'life1 PeerIdentity,
track_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = SubscribeDecision> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided method
fn authorize_without_track_hook<'life0, 'life1, 'async_trait>(
&'life0 self,
_peer: &'life1 PeerIdentity,
) -> Pin<Box<dyn Future<Output = SubscribeDecision> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Pluggable subscribe-time authorization hook for the moq accept path.
Implementors decide, given the (best-effort) peer identity and the
hierarchical track name, whether a subscribe is permitted. The intended
composition is: structural tenant scoping (tenant_scoped_consumer)
gates visibility / cross-tenant enumeration, and this hook gates
public-vs-private within what’s visible.
§Wiring status
- iroh
moqlpath (crate::transport::iroh_moq::IrohMoqProtocolHandler):remote_id()is carrier metadata, never identity. With acrate::transport::moql_admission::MoqlAdmissionAuthenticatorinstalled (#1027) the hook receives the admitted (verified) peer; without one it receives anonymous and the accept path refuses. - quinn
/moqpath (crate::transport::quinn_transport::QuinnRpcServer): as of #1153 the CONNECT is authenticated bycrate::transport::moq_connect_auth::MoqConnectAuthz(bearer JWT, verified before the handshake completes); the tenant is resolved from the verified subject and atenant_scoped_consumeris served. With noMoqConnectAuthzinstalled, the peer is anonymous and the hook receivesPeerIdentity::anonymous(single-tenant/open model); a policy-gated authorizer will deny private subscribes from anonymous quinn peers (fail-closed) while public broadcasts remain open.
Async because the MAC-backed authorizer revalidates credential-bearing cached subject contexts against the canonical revocation authority on every decision.
Required Methods§
Decide whether peer may subscribe to track_name.
Provided Methods§
Decide admission while moq-net provides no track name callback (#276).
The default is deny. Implementations with an audit path should override this method to record the coarse session denial.