diff --git a/doc/concept/moq-lite.md b/doc/concept/moq-lite.md index 4a207f14975..f33d92e2803 100644 --- a/doc/concept/moq-lite.md +++ b/doc/concept/moq-lite.md @@ -198,7 +198,7 @@ everywhere. On moq-transport an added token is kept even without the extension, so an announcement can name it: it rides that `PUBLISH_NAMESPACE` as its authorization token. The token belongs to the session that added it, so after a reconnect the application adds it again and re-announces. moq-lite has no -per-request token yet, so there an announcement rides the session's scope. +per-request token, so there an announcement rides the session's scope. ## Subscriptions diff --git a/quest/m1/auth/README.md b/quest/m1/auth/README.md index 270bef2c170..e16a8a819c4 100644 --- a/quest/m1/auth/README.md +++ b/quest/m1/auth/README.md @@ -14,9 +14,9 @@ means "nobody wants it yet" instead of "nobody ever will". This questline adds an AUTH exchange to both wires: one stream per token, a grant per token, the union of every accepted token as the session's scope, -and a loud failure when a publish can never be honored. It ends with the -credential able to travel in band, while the URL keeps working for every peer -that predates the stream. Node-bound peer grants for direct sessions belong to +and a loud failure when a publish can never be honored. It ends with extra +credentials able to travel in band, while the first rides SETUP, or the URL +for peers that predate the SETUP token. Node-bound peer grants for direct sessions belong to [P2P](/quest/m2/p2p/peer-grant.md), their only consumer. ## Plan @@ -27,21 +27,32 @@ Decisions settled while planning, recorded so review does not relitigate them: is presented, verified by the acceptor through `requests()`, and earns a grant with a lifetime. An AUTH stream's token lives for the session and its grant joins the session scope. A moq-transport `AUTHORIZATION TOKEN` - on a request is the same kind of auth, named by that request: it admits - only that request, never joins the scope, and ends with it. Renewal on - SUBSCRIBE_UPDATE or REQUEST_UPDATE names a new auth that replaces the old. + on a request is the same kind of auth, scoped to that request: it admits + only that request, never joins the scope, and ends with it. A + SUBSCRIBE_UPDATE or REQUEST_UPDATE carrying a new token replaces it. Per-request tokens are moq-transport's naive form and are not surfaced as a separate API. -- ✅ Decided 2026-10-15 (maintainer, #5148): an unnamed request is admitted - by the union of session-lifetime auths only. A named request outside its - auth's grant is refused, and ends when that auth ends. -- ✅ Decided 2026-10-15 (maintainer, #5148): the work lands in steps. - Step 1 (#5148) is incoming only: request tokens arrive on `requests()`, - named requests are held to their issued grant, renewal is renaming, and - no lite wire changes. Step 2 specs `auth=id` in the wip lite version so a - lite request names an AUTH stream instead of carrying a token. Step 3 - adds outgoing request tokens through `add()` with automatic naming, sent - as `USE_VALUE` on plain moq-transport. +- ✅ Decided 2026-10-19 (maintainer, closing + [#5927](https://github.com/moq-dev/moq/pull/5927)): **no per-request auth + on moq-lite.** Lite AUTH carries no ID and lite requests no `Auth` field, + so no request spends a byte on auth. moq-transport's per-request token + stays an acceptor-side mapping onto lite's model and never becomes a lite + wire feature. +- ✅ Decided 2026-10-15 (maintainer, #5148), narrowed 2026-10-19 (#5927): a + request without its own token is admitted by the union of session-lifetime + auths only, which on moq-lite is every request. A moq-transport request + carrying a token is held to that token's grant, inside the scope or not, + and ends when the token does. +- ✅ Decided 2026-10-15 (maintainer, #5148), revised 2026-10-19 (#5927): the + work lands in steps. Step 1 (#5148) is incoming only: request tokens + arrive on `requests()`, a moq-transport request is held to its token's + grant, an update's token replaces it, and no lite wire changes. Step 2, + lite requests naming an AUTH stream, is dropped; what it would have closed, + a request racing the token it relies on, is + [A request right behind its token](/quest/m1/auth/request-race.md). Step 3 + sends outgoing request tokens on moq-transport through `Route::auth` as + `USE_VALUE` ([Live requests follow their auth](/quest/m1/auth/request-update.md)); + lite has nothing to send, since the token already sits in the union. - ✅ Decided 2026-10-15 (maintainer, #5148): `auth::Handle::authorize` keeps its name and now means the connection credential's grant; the session adds every grant it issued to an AUTH token itself. @@ -58,8 +69,8 @@ Decisions settled while planning, recorded so review does not relitigate them: - **One AUTH stream per token, opened by whoever presents it.** Either side of a session may open one; the acceptor answers with the grant that token earns. A moq-net session opens one on both sides right after SETUP with an - empty token, meaning the credential the connection already presented (URL - `?jwt=`, mTLS, or nothing), so a publish-only client learns it may subscribe + empty token, meaning the credential the connection already presented (the + SETUP token, URL `?jwt=`, mTLS, or nothing), so a publish-only client learns it may subscribe to nothing and a relay learns which role its peer will ever play. This is also the answer to [moq-wg #1854](https://github.com/moq-wg/moq-transport/issues/1854): the @@ -84,21 +95,24 @@ Decisions settled while planning, recorded so review does not relitigate them: grant type stays pattern-valued. - **Fail loud by aborting the session.** A publisher whose origin announces a broadcast outside the union aborts the session with `Unauthorized`, naming - the path. The check runs against the grants in hand once the tokens the - library itself presented at setup are answered; a token the app adds later - is the app's to await before publishing what it unlocks. The origin is + the path. The check runs against the grants in hand once every token the + session presented is answered, setup, replayed, or app-added alike + ([request race](/quest/m1/auth/request-race.md)). The origin is untouched, so a broadcast shared across sessions (P2P hops, a cluster) is refused only where it is refused. Grant shrinkage cancels previously authorized work on this session without aborting it or deleting the shared origin; this is distinct from attempting a new unauthorized publication. Apps that want to decide themselves read the grant instead. -- **Older peers keep the URL.** WebTransport negotiates the moq version as a - subprotocol of the same CONNECT request that carries the URL, so a client - cannot learn whether the peer speaks AUTH before the token has to be sent. - The client puts the connection credential in the URL as long as any - version it offers has no AUTH stream and omits it once the offered set is - AUTH-capable; extra tokens go in band and are simply absent on an old peer. - Nothing is refused and nothing is silent. +- **The first token rides SETUP.** ✅ Decided 2026-10-19 (maintainer, + #5972): the connection credential goes in the client's SETUP (a + lite-07-wip SETUP parameter, moq-transport's AUTHORIZATION TOKEN option), + which the acceptor already reads before serving the session, so it costs + no round trip and a session's first requests wait on no AUTH. The URL is + fixed before the version is negotiated, so it carries the token as a + fallback while any offered version lacks the SETUP token. Extra tokens go + in band and are simply absent on an old peer. Nothing is refused and + nothing is silent. This replaces the earlier "always in the CONNECT + request" decision and its auth-header plan. - **Cluster peers keep mTLS.** A relay opens AUTH toward its peer with an empty token like any client; AUTH reports the grant actually admitted in each direction. The next mTLS scope quest can restrict or refuse it. A v1 endpoint @@ -132,13 +146,12 @@ because `main` assigned 0x3A to NOT_FETCHABLE first. - [Live requests follow their auth](/quest/m1/auth/request-update.md) - a route swaps its auth and the session sends the update, keeping the request up - [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 -- [Requests name their auth](/quest/m1/auth/request-auth-id.md) - lite-07 AUTH carries an ID and each request names the auth that admits it +- [A request right behind its token](/quest/m1/auth/request-race.md) - a lite request relying on a just-presented token is admitted, with no auth field on any request - [Bindings](/quest/m1/auth/bindings.md) - grants and tokens reach every binding through moq-ffi -- [Token in band](/quest/m1/auth/token-in-band.md) - the credential can leave - the URL: a session starts on what the URL carried and its AUTH streams add - the rest, with the URL kept for peers without the AUTH stream - subscription even while its joining FETCH waits for request-ID credit +- [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 + AUTH streams add the rest ## Related diff --git a/quest/m1/auth/request-auth-id.md b/quest/m1/auth/request-auth-id.md deleted file mode 100644 index dec288e79aa..00000000000 --- a/quest/m1/auth/request-auth-id.md +++ /dev/null @@ -1,61 +0,0 @@ -# [M] Requests name their auth on the lite wire - -## Goal - -In `moq-lite-07-wip`, AUTH carries an `ID (i)` the opener chooses -(increasing, never reused), and SUBSCRIBE, SUBSCRIBE_UPDATE, FETCH, -ANNOUNCE_REQUEST, ANNOUNCE_START and ANNOUNCE_UPDATE carry `Auth (i)`: 0 for -unnamed, otherwise the ID plus 1. A named request is admitted only by that auth's -grant and ends when the auth ends or narrows away from it. The presenter -names auths automatically. The `draft-lcurley-moq-auth` extension mirrors it -for moq-transport, additively. - -## Plan - -Step 2 of the unified auth model settled on -[#5148](https://github.com/moq-dev/moq/pull/5148) on 2026-10-15. Step 1 -(#5148) makes a moq-transport request token an auth on the shared -`requests()` queue; the decisions are recorded in the -[auth README](/quest/m1/auth/README.md). - -- ✅ Decided 2026-10-15 (maintainer): one kind of auth. Each request names at - most one (`auth=id`); moq-transport's per-request token is only an encoding - of that model, never a separate API. -- Settled in the #5148 design: at most one token per moq-transport request. - Distinct tokens are refused NOT_SUPPORTED, and a repeated identical token is - refused MALFORMED_AUTH_TOKEN. Test both. -- ✅ Decided 2026-10-15 (maintainer): an unnamed request is admitted by the - union of session-lifetime auths only, so a request-lifetime token never - widens tokenless requests. -- ✅ Decided 2026-10-15 (maintainer): a named request outside its auth's grant - is refused, even when session scope would admit it, and it ends with its - auth. -- ✅ Decided 2026-10-15 (maintainer): spec it in lite-07-wip now, before the - cut, so it doesn't cost lite-08. -- A request naming an ID that hasn't arrived yet waits for it while holding - its slot; one naming an ID that already ended is refused UNAUTHORIZED. The - wait spends only the requester's own session budget (its stream and - subscription limits), and ends when the AUTH arrives, the requester cancels, - or the session closes; no timer. -- Renewal on lite: add a new auth, SUBSCRIBE_UPDATE (ANNOUNCE_UPDATE for a route) the request to it, drop - the old one. AUTH and Subscribe streams are unordered, so dropping the old - auth must not race the update into an UNAUTHORIZED reset: settle what tells - the renewer the update applied before it drops the old auth, and spec it. -- moq-transport: AUTH's Request ID becomes the auth id, and a new request - parameter names it. The alias types map as: USE_VALUE registers a - request-lifetime auth and names it; REGISTER registers a session-lifetime - auth and names it for the carrying request, so that request ends when the - auth ends or narrows away from it; USE_ALIAS on a later request names it; - DELETE withdraws one. -- An AUTH with ID `u64::MAX` is refused, since no request can name it as - ID plus 1. Cover the boundary in the Rust and JS interop tests. -- Extend `rs/moq-net/benches/auth.rs` with a sweep over live auths and named - requests, measuring the end or narrowing of one auth. -- Update `drafts/draft-lcurley-moq-lite.md` and - `drafts/draft-lcurley-moq-auth.md`, Rust and `js/net`, and run - `just test interop --all`. Update `doc/concept/moq-lite.md`'s - Authorization section (scope is no longer only the session union) and - `doc/concept/standard.md`, which describes only moq-transport request tokens. - -Public API: none beyond step 1's `requests()` and `add()`; naming is -automatic. Wire: lite-07-wip AUTH and six request messages gain fields. diff --git a/quest/m1/auth/request-race.md b/quest/m1/auth/request-race.md new file mode 100644 index 00000000000..b1a7fc308e2 --- /dev/null +++ b/quest/m1/auth/request-race.md @@ -0,0 +1,114 @@ +# [S] A request right behind its token is admitted + +## Goal + +On moq-lite, a request that only a just-presented token admits is never +refused because it reached the acceptor before that token's AUTH settled, and +a renewal never drops a live request the new grant still covers. Lite +requests stay judged by the union of session-lifetime auths alone: no Auth ID +on AUTH, no `Auth` field on requests, no extra bytes on any request, and no +timer. + +## Plan + +- ✅ Decided 2026-10-19 (maintainer, closing + [#5927](https://github.com/moq-dev/moq/pull/5927)): drop the named version. + "I don't want per-request auth and I don't reaaaallly want to waste a byte + on every request." Lite AUTH carries no ID and lite requests no `Auth` + field. `main` never carried either (checked 2026-10-19 in + `drafts/draft-lcurley-moq-lite.md`, `rs/moq-net` and `js/net`), so nothing + needs removing. +- ✅ Decided 2026-10-19 (maintainer, #5972): the first token rides SETUP, a + lite-07-wip SETUP parameter and moq-transport's existing AUTHORIZATION + TOKEN option, with the URL query as the fallback. "We need to block on + SETUP anyway": the acceptor already reads the client's SETUP before serving + the session (`Server::accept_request_lite`), and a lite client sends + requests without waiting on the server's, so it costs no round trip and a + session's first requests wait on no AUTH. Further tokens join the union + through AUTH streams. [Token in band](/quest/m1/auth/token-in-band.md) + carries the parameter. This replaces the earlier "always in the CONNECT + request" decision and drops its auth-header plan. +- ✅ Decided 2026-10-19 (maintainer): moq-transport's per-request + AUTHORIZATION TOKEN stays acceptor-side as + [#5148](https://github.com/moq-dev/moq/pull/5148) modeled it and never + becomes a lite wire feature. `draft-lcurley-moq-auth` gains no request + parameter naming an AUTH, and token aliases stay unsupported (cache size 0). +- Where `main` stands (2026-10-19). A lite acceptor judges SUBSCRIBE and + FETCH against its scope when it decodes them, and a grant joins the scope + only once the acceptor accepts its token. The presenter's own gate refuses + a request its known union does not cover before sending it, and + `auth::Handle::add` (Rust) and `add` (js/net) resolve only after AUTH_OK, so + an app that awaits `add()` never races. Announcements already heal: a + broadcast withheld for falling outside the scope comes back when the scope + widens. What is left: + - the draft does not say any of this; + - nothing pins that an acceptor widens its scope no later than it sends + AUTH_OK, which the presenter relies on; + - tokens the library presents without the app awaiting them race the app's + requests on the same session: moq-tokio's reconnect replay in + `connection::auth` today, and later the extra session-start tokens of + [Auth outlives its session](/quest/m1/auth/issuer.md) and + [Token in band](/quest/m1/auth/token-in-band.md). The SETUP token never + races, so only a client with more than one token can hit it. +- ✅ Decided 2026-10-19 (maintainer, #5972): **the presenter waits**, with a + log line so we see how often it triggers. "I want to make sure we're not + adding dumb RTTs." A request its known union does not cover waits, instead + of failing locally, while any non-empty token this side presented is + unanswered, then goes out or fails against the settled union. An unknown + union covers nothing for this rule, but the empty token never holds a + request, since the acceptor judges the connection credential (SETUP or URL) + before it serves the session. It costs one round trip, only for the first request relying on a new + token, which `add()` already spends; a single-credential session and a + renewal spend nothing. No wire change and no acceptor state. The rule lives + in the shared gate, so the moq-transport AUTH extension gets it too. Abuse: + an acceptor that never answers holds only our own requests, which it could + stall anyway by never answering them. No timer. +- Rejected 2026-10-19 (#5972): the acceptor waiting on that peer's unanswered + AUTHs, because AUTH and the request ride different streams, so a lost AUTH + packet still lets the request arrive first with nothing pending; and an + AUTH_WAIT prefix on the request stream, which is exact but a new message to + save a round trip nobody has measured. Revisit AUTH_WAIT only if the log + below shows the wait firing in practice. +- ✅ Decided 2026-10-19 (maintainer, #5972): observability is the log line + only, not a `stats::Session` counter. Every request that waits on an + unanswered token logs once (path and how long it waited), in Rust and + `js/net`. +- The wait only sees tokens already presented, so a replayed token must be + registered on the new session before the app can use it. Today + `Shared::connected` in moq-tokio publishes the new session before each + per-token replay task reaches `add()`, so a woken app can send a request + while nothing is pending. Present every token the connection holds on the + new session's handle (queued, not awaited) before publishing the session; + [Auth outlives its session](/quest/m1/auth/issuer.md) does this by + construction once the handle spans sessions. js/net mirrors it if its + reconnect replays tokens the same way. +- Spec in lite-07-wip that the acceptor judges a request against the union + when it reads it, that its scope includes a grant no later than it sends + that AUTH_OK, and that a presenter does not send a request only an + unanswered token admits. Hold the publish-outside-the-union check to the + same rule, so it waits on every unanswered token rather than only the setup + ones. Mirror in `js/net`. +- Renewal under the union: present the new token, wait for its AUTH_OK + (`add()` already does), then drop the old one. The union never shrinks + under a live request the new grant also covers, and a narrower renewal ends + only what it no longer covers. +- Not carried from #5927: FIN-linger withdrawal, since nothing names the old + token and dropping it after the new AUTH_OK races nothing; per-token + wakeups and the `named` bench, since no request watches one token. A change + still recomputes the union, as today. Extend `rs/moq-net/benches/auth.rs` + only if the wait adds per-request work on an AUTH_OK. +- Tests that fail without the fix, in Rust and JS: a direct request made + the moment a reconnect publishes its session, relying on a replayed token, + is admitted; an acceptor's AUTH_OK + never precedes its scope; a live subscription survives a renewal. +- Docs: renewal and the wait in `doc/concept/moq-lite.md`'s Authorization + section. + +Public API: none. Wire: lite-07-wip draft text only, no new bytes. + +## Related + +- [#5927](https://github.com/moq-dev/moq/pull/5927) - the closed named-auth + version this replaces +- [Live requests follow their auth](/quest/m1/auth/request-update.md) - + moq-transport request renewal; lite renews through the union diff --git a/quest/m1/auth/request-update.md b/quest/m1/auth/request-update.md index 678097caccd..47249551aec 100644 --- a/quest/m1/auth/request-update.md +++ b/quest/m1/auth/request-update.md @@ -5,9 +5,10 @@ A publisher renews the credential behind a live announcement without reopening it. A `Route` holds an optional `moq_net::auth::Auth`; when the application swaps it, the session sends REQUEST_UPDATE (moq-transport) -carrying the new auth, and the request stays up. Lite renews by -ANNOUNCE_UPDATE once [Requests name their auth](/quest/m1/auth/request-auth-id.md) -gives it a way to name one. The first consumer is a client that keeps a +carrying the new auth, and the request stays up. Lite sends nothing: a +route's auth already sits in the session union through its AUTH stream, so +lite renews through the union as in +[A request right behind its token](/quest/m1/auth/request-race.md). The first consumer is a client that keeps a PUBLISH_NAMESPACE alive past its credential's expiry by sending REQUEST_UPDATE with a fresh token before it expires. @@ -67,20 +68,20 @@ because it has a consumer now. The decisions are recorded in the renewed. (From the deleted concurrent-renewal quest, which measured this against #5148's earlier serial refresh.) - On moq-transport the update carries the token as USE_VALUE and needs only - step 1, so the PUBLISH_NAMESPACE consumer doesn't wait on the lite wire. On - lite it names the auth registered through - [Requests name their auth](/quest/m1/auth/request-auth-id.md), so the lite - path follows that quest. A refused update ends only that request. + step 1. ✅ Decided 2026-10-19 (maintainer, closing + [#5927](https://github.com/moq-dev/moq/pull/5927)): lite requests never + name an auth, so on lite `Route::auth` puts nothing on the wire. A refused + update ends only that request. - Mirror `Auth` and `Route::auth` in `js/net`; the bindings expose no auth yet, so [Bindings](/quest/m1/auth/bindings.md) carries them. -- Describe request renewal in `doc/concept/moq-lite.md`'s Authorization - section, and in `doc/concept/standard.md`, which describes only incoming request - tokens; the moq-transport path can land before the lite one. +- Describe moq-transport request renewal in `doc/concept/moq-lite.md`'s + Authorization section, and in `doc/concept/standard.md`, which describes + only incoming request tokens. Public API: a new optional auth on routes in Rust and JS. Wire: none beyond the existing AUTHORIZATION TOKEN on PUBLISH_NAMESPACE and its -REQUEST_UPDATE; lite's ANNOUNCE_UPDATE waits on Requests name their auth. +REQUEST_UPDATE. ## Related -- [Requests name their auth](/quest/m1/auth/request-auth-id.md) - the lite path's prerequisite; moq-transport renewal doesn't wait on it +- [A request right behind its token](/quest/m1/auth/request-race.md) - lite renewal through the union diff --git a/quest/m1/auth/token-in-band.md b/quest/m1/auth/token-in-band.md index c6ffe22c3c2..016a939ad73 100644 --- a/quest/m1/auth/token-in-band.md +++ b/quest/m1/auth/token-in-band.md @@ -2,15 +2,13 @@ ## Goal -A client's credentials can travel inside the session instead of the URL, and -several of them can ride one connection. Every client in this repository -takes tokens as configuration separate from the address, presents each on its -own AUTH stream at setup, and the relay admits the session on what the URL -carried and widens it as the streams are answered. Peers without the AUTH -stream keep working unchanged: the client puts the first token in the URL whenever any -version it offers has no AUTH stream, so nothing is refused and nothing goes -silent, and the token leaves the URL for good only once the offered set is -AUTH-capable. +Several credentials can ride one connection. Every client in this repository +takes tokens as configuration separate from the address, puts the first in +its SETUP (the URL query when the negotiated version has no SETUP token), +presents each other one on its own AUTH stream at setup, and the relay admits +the session on that first token and widens it as the streams are answered. Peers without the AUTH stream keep +working unchanged, so nothing is refused and nothing goes silent, and a +session's first requests wait on no AUTH. ## Plan @@ -38,46 +36,57 @@ already carries the full pattern grant. its own AUTH stream so the accepted grant union remains live. Keep `?jwt=` as the fallback for peers without AUTH. Choose the public credential-source API while implementing this quest. -- Presenting: WebTransport negotiates the moq version as a subprotocol of - the CONNECT request that carries the URL, so the client cannot wait to - learn whether the peer speaks AUTH. The client copies the first configured - token into the URL query whenever any offered version lacks AUTH (every - published lite version, since AUTH lands in the wip one), and omits it once every offered version has the - stream. A token that went into the URL or the setup option is the - connection credential, and the empty-token stream is its one and only - stream; every other configured token gets its own AUTH stream on an - AUTH-capable session, so no token is ever granted twice. On moq-transport - the first token also rides the AUTHORIZATION TOKEN setup option - (`ietf::token::into_setup`, `USE_VALUE`, token type 0), which - scopes at accept the way the URL does. While the URL also carries it, the - auth server sees the same credential twice: `moq auth serve` admits a SETUP +- Presenting: ✅ Decided 2026-10-19 (maintainer, + [#5972](https://github.com/moq-dev/moq/pull/5972)): the first configured + token rides SETUP. lite-07-wip gains a SETUP token parameter, filling + `server::Handshake::token` the way moq-transport's AUTHORIZATION TOKEN + setup option (`ietf::token::into_setup`, `USE_VALUE`, token type 0) already + does, so the relay hands it to the auth server at accept. It costs no round + trip: the acceptor already reads the client's SETUP before serving, and a + lite client sends requests without waiting on the server's SETUP. The + version is negotiated (ALPN or the WebTransport subprotocol) before SETUP + is written, but the URL is fixed before negotiation, so the client also + copies the first token into the URL query while any offered version lacks + a SETUP token (every lite version before 07). On raw QUIC and Qmux the + query already rides SETUP's `Path`. A dial URL that already carries a + credential (a cluster's per-peer `?jwt=`) keeps it as the connection + credential instead, and then every configured token gets its own AUTH + stream: the client never appends a second `jwt` or sends a different SETUP + token. A token that went into the URL or SETUP is the connection + credential, and the empty-token stream is its one and only stream; every + other configured token gets its own AUTH stream on an AUTH-capable session, + so no token is ever granted twice. While the URL also carries it, the auth + server sees the same credential twice: `moq auth serve` admits a SETUP token equal to the `?jwt=` value and refuses two different ones - (`serve::Refusal::TwoTokens`). Never send different values in the two places. -- The relay admits on the URL, then widens. An anonymous connection today is - admitted with the public grant when one is configured and refused - otherwise; with this quest a connection with no URL credential and no - public grant is held for a short deadline after SETUP for its first - accepted AUTH before being refused, so an AUTH-capable client with tokens - only in band gets in and a client that never presents anything is still - refused. The URL query stays the connect-time credential in the `moq_auth::Request`. + (`serve::Refusal::TwoTokens`). Never send different values in the two + places. A token in SETUP is bounded by SETUP's Message Length cap and + reaches the auth server exactly as a URL token does, so an unauthenticated + client gains nothing it could not already send in the URL. Dropped: the + earlier "always in the CONNECT request" rule and its auth-header plan. +- The relay admits on the URL, then widens. An anonymous connection is + admitted with the public grant when one is configured and refused at + connect otherwise, as today: a client with tokens always carries one in + SETUP or the URL, so the relay needs no admission deadline. The URL query + and the SETUP token stay the connect-time credentials in the + `moq_auth::Request`. - A URL credential is still refused at connect when both arms reject it, and an in-band refusal is an AUTH_ERROR after connect. -- Docs: `doc/bin/cli.md`, `doc/bin/relay/auth.md` (the admission deadline and - that the URL token is one member of the union), `doc/lib/*` client +- Docs: `doc/bin/cli.md`, `doc/bin/relay/auth.md` (that the URL token is one + member of the union), `doc/lib/*` client configuration, and the example invocations carrying `?jwt=` in `doc/`, `demo/`, and the READMEs, keeping the URL form documented as the way to reach an older relay. -- Tests: a client with a configured token against an AUTH-capable relay is - scoped exactly as the URL variant and the URL carries the token only while - an old version is offered; the same client against a lite-05 relay still +- Spec the SETUP token parameter in `drafts/draft-lcurley-moq-lite.md`'s + lite-07-wip SETUP, and update `js/net` beside Rust. +- Tests: a client with a configured token offering only lite-07 against an + AUTH-capable relay is scoped exactly as the URL variant, with the token in + SETUP and none in the URL; the same client against a lite-05 relay still authenticates through the URL; a moq-transport client offering a draft without AUTH, carrying the token in both the URL and the setup option, is - admitted by `moq auth serve`; two configured tokens union; a client with - in-band tokens only and no public grant is admitted, and one that presents - nothing is refused at the deadline; the cross-language harness runs with - tokens configured. + admitted by `moq auth serve`; two configured tokens union; the + cross-language harness runs with tokens configured. -Additive. +Additive. Wire: a lite-07-wip SETUP parameter. ## Required