Repository navigation
fix(moq-net): a scoped peer's lite-07 session exchanges claims instead of closing Unauthorized - #9373
Conversation
Quest-Claim: 6bd0c41e24fa69b5
…t it admits is whole
…ed grant is whole; finish the quest
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It gates the Node ID on the scope the application admitted (Handle::authorize) rather than on the origin handles alone, which Cluster::scope_session widens to every prefix. The fix sits in moq-net, so every server that widens its handles for in-band AUTH gets it.
Reviewed changes
I reviewed all 7 files at 283e5ec, plus the relay admission path that sets the grant before SETUP (connection.rs:160 → Lease::preparing → Refresh::new → handle.authorize, which runs before request.ok()).
lite::session::startgates the Node ID on the admitted grant:node_id(...).filter(|_| auth.admits_whole()). Because of this,routingstays false andRouteStream::poll_setupnever reaches itsUnauthorizedclose for a scoped peer, since it checksself.publish.routingbefore the whole-grant check.- New
auth::Link::admits_whole: true only while the session scope (limit plus issued grants) matches""in both directions. A unit test covers unset, whole, and each way a grant can narrow. - Draft wording: the Routing paragraph now says an endpoint sends the Node ID only when its admitted grant is whole. It keeps the
UNAUTHORIZEDMUST for the case where both sides declared and a grant later narrows, which matches thepoll_permitloop inroute_stream.rs. - Integration test
scoped_link_exchanges_claims: a lite-07 link scoped totenant-aroutes both ways, frames cross in both directions, andother/camdoes not leak. - Quest cleanup: the finished quest file and the links to it are removed.
claude-opus-5-5 | 𝕏

Problem
A lite-07 relay that admits a peer with a link and a scoped grant at the root (publish and subscribe
["tenant-a"]) closed the sessionUnauthorized, and the dialer retried forever. The relay'sCluster::scope_sessionwidens the session's origin handles to every prefix so in-band AUTH can regrant.origin::Consumer::node_idsaw those whole handles and declared a Node ID in SETUP, andRouteStream::poll_setupthen checked the real AUTH permit and closed, as the draft mandates. The same grant worked over lite-06 and over lite-07 without a link.Approach
lite::session::startdeclares a Node ID only when the handles are whole and the grant the application admitted the peer under (Handle::authorize, which the relay applies before answering SETUP) covers every path in both directions (newauth::Link::admits_whole). A scoped peer's relay declares none, so the pair exchanges claims as on lite-06. The fix is in moq-net, so any server that widens its handles hits it too,moq auth serveincluded. The draft's Routing paragraph now says an endpoint sends the Node ID only when the grant it admits covers every path.Validation
scoped_link_exchanges_claims(moq-relay, real TCP/TLS lite-07): a CDN admitting a dial at/scoped(link upstream, root"",["tenant-a"]both ways) now routestenant-a/cdnandtenant-a/edgeboth ways and reads frames across;other/camnever reaches the dialer. It timed out at "the edge learns the tenant" before the fix (confirmed red).a_scope_admits_whole_only_when_it_leaves_nothing_out(moq-net): unset, whole, and each way of leaving a path out, widening and narrowing.just check(rs, js, drafts, quest) passed.just test interop --allwas not run: no wire change.Impact
Choices for review
request.ok()), not the peer's AUTH_OK to our token, which arrives later. An app that callsauthorizeonly after the session starts is still judged by its handles.Unauthorized, as the draft's MUST requires. Demoting a routing session to claims would need a wire change.js/netnever declares a Node ID.lite07-finalize.mdandfederation.md.Caused by
scope_session(found by person).Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (arm B)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 283e5ec
Base: origin/main at 7d491a3
Risk: medium,
Could break lite-07 sessions with a scoped peer at the root: `rs/moq-net/src/lite/session.rs` now declares a Node ID only when the admitted grant covers the whole tree, so such peers exchange claims instead of being closed Unauthorized, a behavior change for relay operators and their peers that a revert fully undoes. No public API or wire format changes (the new `admits_whole` is `pub(crate)`), so this is a bug fix rather than high; the draft wording, quest deletions, and integration test are low.Classified: medium by Claude Code, claude-haiku-5-5, low effort, session
7eb42818-d665-4a25-9e5b-da3dddd24977Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a2026e-08c1-7900-97a2-d1c829f52d4c, round 1Score: 9/10,
No actionable regressions were found; the fix directly targets admission and adds bidirectional integration coverage, though builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none