From 034e7e0ef7f0e54a0c1dd89aeb2aa6bfe5f89836 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 23 Oct 2026 11:05:55 -0700 Subject: [PATCH 1/2] quest: import #6545, #6566, #6567, #6536 Co-Authored-By: Claude Opus 5.5 --- quest/m0/README.md | 3 ++ quest/m0/h265-aspect-backport.md | 23 +++++++++++++++ quest/m0/hop-id-64.md | 40 +++++++++++++++++++++++++++ quest/m0/malformed-auth-token-code.md | 30 ++++++++++++++++++++ quest/m1/auth/README.md | 7 +++-- quest/m1/auth/ietf-patterns.md | 38 +++++++++++++++++++++++++ quest/m1/auth/token-in-band.md | 7 ++--- 7 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 quest/m0/h265-aspect-backport.md create mode 100644 quest/m0/hop-id-64.md create mode 100644 quest/m0/malformed-auth-token-code.md create mode 100644 quest/m1/auth/ietf-patterns.md diff --git a/quest/m0/README.md b/quest/m0/README.md index f72452dfc72..95319698c40 100644 --- a/quest/m0/README.md +++ b/quest/m0/README.md @@ -42,8 +42,11 @@ Each lands its fixes in its own PR and plans only what needs a decision. - [Broadcast epochs](/quest/m0/broadcast-epoch/README.md) - every first-party publisher that can restart mints a fresh route epoch, the newest wins a path, and only routes with the same epoch resume a subscription - [web-transport-proto 0.6.3](/quest/m0/web-transport-proto-0.6.3.md) - `main` and `release` lock the upstream release that bounds decoded CONNECT headers, so a peer can't make a relay hold megabytes per session before auth +- [64-bit Hop IDs](/quest/m0/hop-id-64.md) - a moq-transport peer with any non-zero 64-bit Hop ID keeps its session, and Hop IDs are `u64` in Rust and JS +- [MALFORMED_AUTH_TOKEN session code](/quest/m0/malformed-auth-token-code.md) - a 0x16 close reports a malformed token instead of `unknown code=22`, and moq-net sends it for an unparseable token - [qmux 0.5.3](/quest/m0/qmux-0.5.3.md) - crates.io publishes qmux 0.5.3 with the builder session config the release backport of #5609 needs - [Release shutdown backport](/quest/m0/ffi-shutdown-backport.md) - `release` publishes a non-breaking moq-ffi with an async `drain()` and qmux sessions on the QUIC stream limit - [Release fixed delay](/quest/m0/release-fixed-delay.md) - a fixed latency on `release`, which moq.dev runs, ignores the catalog's jitter and delay as `main` already does +- [H.265 aspect backport](/quest/m0/h265-aspect-backport.md) - `release` publishes the #5574 fix, so a square-pixel H.265 stream plays at its picture's aspect - [CI cost and latency](/quest/m0/ci/README.md) - cloud CI runs only in the merge queue as one `just ci` pass, expensive checks run nightly and gate `release`, caches move to R2, and runners are chosen last - [MIGRATE.md at the cut](/quest/m0/migrate-at-cut.md) - PRs stop conflicting on `MIGRATE.md`: breaking PRs carry their migration note in the PR, and the breaking cut writes the guides diff --git a/quest/m0/h265-aspect-backport.md b/quest/m0/h265-aspect-backport.md new file mode 100644 index 00000000000..6975891adb7 --- /dev/null +++ b/quest/m0/h265-aspect-backport.md @@ -0,0 +1,23 @@ +# [XS] Backport the H.265 display aspect fix to release + +## Goal + +The `release` line publishes a moq-mux and libmoq whose H.265 importer puts +the picture's display aspect in the catalog, not the VUI's sample aspect, so +a 1280x720 stream signalling square pixels plays at 16:9 in @moq/watch +instead of square. Check: the newest libmoq release contains the fix. + +## Plan + +✅ Decided 2026-10-23 (maintainer, importing #6536): backport rather than wait +for the next cut. Why: the cut is gated on broadcast epochs, and libmoq users +run `release`. + +Cherry-pick [moq-dev/moq#5574](https://github.com/moq-dev/moq/pull/5574) onto +`release` following CONTRIBUTING's backport workflow, adapting to the release +line's `codec/video.rs` helpers and keeping its tests. Public API and wire are +unchanged. + +## Closes + +- [#6536](https://github.com/moq-dev/moq/issues/6536) - H.265 importer puts the sample aspect in the display aspect fields diff --git a/quest/m0/hop-id-64.md b/quest/m0/hop-id-64.md new file mode 100644 index 00000000000..b827a24f5a4 --- /dev/null +++ b/quest/m0/hop-id-64.md @@ -0,0 +1,40 @@ +# [M] 64-bit Hop IDs + +## Goal + +A moq-transport peer that declares or advertises any non-zero 64-bit Hop ID, +as draft-lcurley-moq-cluster lets it pick at random, keeps its session: today +`Hop::from_wire` refuses anything at or above 2^62 with `invalid value`, so +about three in four moqx `main` relays can't connect on draft 18. Hop IDs are +`u64` end to end in Rust and JS, on every wire that can carry them. + +## Plan + +✅ Decided 2026-10-23 (maintainer, importing #6545): widen `Hop` to 64 bits +rather than cap the draft at 2^62 - 1. Why: the cluster draft already encodes +Hop IDs as vi64 and promises a 64-bit space, and a fold into 62 bits breaks +loop detection, since a relay never recognizes its own folded ID. + +✅ Decided 2026-10-23 (maintainer): a lite-01..06 link, whose QUIC varint +stops at 2^62 - 1, carries a hop it cannot encode as 0, the reserved unknown +hop. Why: the route still reaches the old peer; loop detection through that +hop is lost on that link only, and `max_hops` and path cost still bound it. + +- `moq-lite-07-wip` and IETF draft 17+ already use the leading-ones varint up + to `u64::MAX`; no wire layout changes. `Hop::from_wire` and `Hop::new` + accept any `u64`, and only the QUIC-varint encoders map an oversized hop + to 0. Our own hop declaration on an old lite link follows the same rule. +- `Hop::random` keeps its 2^53 range so older `@moq/lite` clients, which read + the exclude hop as a JavaScript number, still accept our IDs. +- `js/net` carries hop IDs as `bigint` wherever it decodes or compares them. +- draft-lcurley-moq-cluster and draft-lcurley-moq-lite say Hop IDs span 64 + bits and that a link whose varint can't carry one sends 0 in its place. +- Test: a draft-18 session with a peer Hop ID of `u64::MAX` connects, and a + path holding one crosses a lite-06 link as 0. + +Public API: `Hop::new` accepts the full `u64` range (additive). Wire: none on +current versions; old lite links gain the 0 substitution. + +## Closes + +- [#6545](https://github.com/moq-dev/moq/issues/6545) - moq-net refuses a HOP_ID at or above 2^62 diff --git a/quest/m0/malformed-auth-token-code.md b/quest/m0/malformed-auth-token-code.md new file mode 100644 index 00000000000..e979d75519a --- /dev/null +++ b/quest/m0/malformed-auth-token-code.md @@ -0,0 +1,30 @@ +# [XS] MALFORMED_AUTH_TOKEN session code + +## Goal + +A session closed with MALFORMED_AUTH_TOKEN (0x16) reports "malformed auth +token" instead of `unknown code=22`, in Rust and JS, and moq-net closes with +it where it refuses a connection token it cannot parse, so a client learns +its token's format is wrong rather than its grant. + +## Plan + +✅ Decided 2026-10-23 (maintainer, importing #6567): add +`SessionError::MalformedAuthToken` = 0x16 beside `UnknownAuthTokenAlias`, +encoded and decoded, rather than leave it unknown. Why: its neighbours 0x13, +0x17, and 0x18 are mapped, and moqx sends it for a token that isn't a CWT. + +- Add it to the round-trip table in `rs/moq-net/src/error.rs`, mirror it in + `js/net`, and add the row to draft-lcurley-moq-lite's session-code table + with a changelog bullet. +- Find where moq-net refuses an unparseable SETUP or URL token and close with + this code there; keep `Unauthorized` for a well-formed token that grants + nothing. + +Public API: one additive variant on a `#[non_exhaustive]` enum, and its JS +mirror. Wire: a newly assigned moq-lite session code with moq-transport's +meaning. + +## Closes + +- [#6567](https://github.com/moq-dev/moq/issues/6567) - 0x16 reports `unknown code=22` diff --git a/quest/m1/auth/README.md b/quest/m1/auth/README.md index cf9ff0086de..cf8e47af879 100644 --- a/quest/m1/auth/README.md +++ b/quest/m1/auth/README.md @@ -88,9 +88,9 @@ Decisions settled while planning, recorded so review does not relitigate them: root, and every token in a union shares the connection's root. Unscoped permission is `**`; an empty union grants nothing. Lite AUTH_OK carries those patterns, wildcards and literals alike, from the first release, with - no covering-prefix workaround. IETF AUTH_OK carries Track Namespace - prefixes, so an acceptor whose grant is not a union of subtrees answers - AUTH_ERROR NOT_SUPPORTED rather than widening it. Announce stays a prefix: + no covering-prefix workaround. IETF AUTH_OK carries the same patterns once + [IETF AUTH_OK patterns](/quest/m1/auth/ietf-patterns.md) lands (revised + 2026-10-23 from Track Namespace prefixes, #6566). Announce stays a prefix: ANNOUNCE_REQUEST and SUBSCRIBE_NAMESPACE do not gain patterns. The public grant type stays pattern-valued. - **Fail loud by aborting the session.** A publisher whose origin announces a @@ -144,6 +144,7 @@ because `main` assigned 0x3A to NOT_FETCHABLE first. ## Required +- [IETF AUTH_OK patterns](/quest/m1/auth/ietf-patterns.md) - moq-transport's AUTH_OK carries lite's patterns, so an exact or wildcard grant is admitted on draft 17+ - [Auth outlives its session](/quest/m1/auth/issuer.md) - one `auth::Handle` spans a connection's sessions, so a route's auth survives a reconnect - [Token in band](/quest/m1/auth/token-in-band.md) - extra credentials ride AUTH streams: a session starts on the token its SETUP or URL carried and its diff --git a/quest/m1/auth/ietf-patterns.md b/quest/m1/auth/ietf-patterns.md new file mode 100644 index 00000000000..245c4903c62 --- /dev/null +++ b/quest/m1/auth/ietf-patterns.md @@ -0,0 +1,38 @@ +# [M] Patterns in IETF AUTH_OK + +## Goal + +Any grant moq-lite's AUTH_OK can tell, moq-transport's can too. A token +granting an exact path (`ch1`) or a one-level wildcard (`live/*`) is admitted +on moq-transport draft 17+ as it is on draft 16 and moq-lite, instead of +being refused with "grant cannot be encoded as one AUTH_OK". + +## Plan + +✅ Decided 2026-10-23 (maintainer, importing #6566): carry patterns in IETF +AUTH_OK rather than document a subtree-only rule and warn in `moq auth sign`. +Why: `doc/bin/relay/auth.md` already promises exact patterns, and refusing a +URL token only because its informational AUTH_OK can't be encoded makes +estates that issue exact grants fail closed when clients move to draft 17. +This revises the auth epic's "initially prefixes" choice. + +✅ Decided 2026-10-23 (maintainer): encode each entry as the same pattern +string lite's AUTH_OK carries, relative to the session root, not a Track +Namespace plus a match kind. Why: one grammar and one codec, so the two +wires can't drift. + +- draft-lcurley-moq-auth-01: AUTH_OK's Publish and Subscribe entries become + patterns, with a changelog bullet. Per the lite-first wire-compat rule, no + -00 compatibility is kept. +- `rs/moq-net/src/ietf/auth.rs` encodes and decodes patterns. The refusal for + a grant that is not a union of subtrees goes away; the refusal for a grant + too large for one AUTH_OK stays, never trimmed. +- Mirror in `js/net` if it speaks the IETF AUTH extension. +- Test: the #6566 matrix (exact and subtree grants, drafts 16 and 18) admits + every cell. + +Public API: none. Wire: AUTH_OK in draft-lcurley-moq-auth changes shape. + +## Closes + +- [#6566](https://github.com/moq-dev/moq/issues/6566) - an exact-path grant is refused on draft 18 diff --git a/quest/m1/auth/token-in-band.md b/quest/m1/auth/token-in-band.md index e5413ae7086..e2a0af679ad 100644 --- a/quest/m1/auth/token-in-band.md +++ b/quest/m1/auth/token-in-band.md @@ -12,10 +12,9 @@ session's first requests wait on no AUTH. ## Plan -IETF AUTH initially carries only prefix-representable grants. Propagate its -`Unsupported` result for an unrepresentable pattern union; do not retry the -token through the URL, widen it, or leave token admission pending. Lite AUTH -already carries the full pattern grant. +IETF AUTH can refuse a grant too large for one AUTH_OK. Propagate its +`Unsupported` result; do not retry the token through the URL, trim it, or +leave token admission pending. - Client configuration separates the credential from the address: `moq_tokio::connect::Config` gains `tokens`, repeatable as `--connect-token` and `MOQ_CONNECT_TOKEN`, the default set for every dial From c56b2edcac85a708e74c465f50ae4478b62f61a9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 23 Oct 2026 11:12:33 -0700 Subject: [PATCH 2/2] quest: negotiate IETF AUTH_OK patterns apart and carry malformed through moq-auth Co-Authored-By: Claude Opus 5.5 --- quest/m0/malformed-auth-token-code.md | 20 +++++++++++++------- quest/m1/auth/ietf-patterns.md | 9 ++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/quest/m0/malformed-auth-token-code.md b/quest/m0/malformed-auth-token-code.md index e979d75519a..016cf33a630 100644 --- a/quest/m0/malformed-auth-token-code.md +++ b/quest/m0/malformed-auth-token-code.md @@ -1,4 +1,4 @@ -# [XS] MALFORMED_AUTH_TOKEN session code +# [S] MALFORMED_AUTH_TOKEN session code ## Goal @@ -17,12 +17,18 @@ encoded and decoded, rather than leave it unknown. Why: its neighbours 0x13, - Add it to the round-trip table in `rs/moq-net/src/error.rs`, mirror it in `js/net`, and add the row to draft-lcurley-moq-lite's session-code table with a changelog bullet. -- Find where moq-net refuses an unparseable SETUP or URL token and close with - this code there; keep `Unauthorized` for a well-formed token that grants - nothing. - -Public API: one additive variant on a `#[non_exhaustive]` enum, and its JS -mirror. Wire: a newly assigned moq-lite session code with moq-transport's +- Sending needs the auth contract to say why: moq-net treats the SETUP token + as opaque, `moq auth serve` already tells `Refusal::InvalidToken` apart but + `Refusal::body` collapses it into `Reason::Refused`, and the relay's + `refuse` maps that to `Unauthorized`. Add a malformed `refusal::Reason` + (older relays still read it as `Refused` through `#[serde(other)]`), map + `InvalidToken` to it, and have moq-relay close with this code; keep + `Unauthorized` for a well-formed token that grants nothing. Follow the + Cross-Package Sync row for `rs/moq-auth` (`js/auth`, + `doc/bin/relay/auth.md`). + +Public API: additive variants on `SessionError` and `moq_auth::refusal::Reason`, +and their JS mirrors. Wire: a newly assigned moq-lite session code with moq-transport's meaning. ## Closes diff --git a/quest/m1/auth/ietf-patterns.md b/quest/m1/auth/ietf-patterns.md index 245c4903c62..71c8a709e9e 100644 --- a/quest/m1/auth/ietf-patterns.md +++ b/quest/m1/auth/ietf-patterns.md @@ -22,8 +22,10 @@ Namespace plus a match kind. Why: one grammar and one codec, so the two wires can't drift. - draft-lcurley-moq-auth-01: AUTH_OK's Publish and Subscribe entries become - patterns, with a changelog bullet. Per the lite-first wire-compat rule, no - -00 compatibility is kept. + patterns, with a changelog bullet. The -00 codec is not kept, but -01 takes + a new AUTH Setup Option code point so a -00 peer simply doesn't negotiate + the extension instead of misparsing AUTH_OK; it falls back to the SETUP or + URL token as any peer without AUTH does. - `rs/moq-net/src/ietf/auth.rs` encodes and decodes patterns. The refusal for a grant that is not a union of subtrees goes away; the refusal for a grant too large for one AUTH_OK stays, never trimmed. @@ -31,7 +33,8 @@ wires can't drift. - Test: the #6566 matrix (exact and subtree grants, drafts 16 and 18) admits every cell. -Public API: none. Wire: AUTH_OK in draft-lcurley-moq-auth changes shape. +Public API: none. Wire: AUTH_OK in draft-lcurley-moq-auth changes shape under a +new AUTH Setup Option code point. ## Closes