Skip to content

quest: lite drops per-request auth; plan the request-behind-its-token race - #5972

Merged
kixelated merged 5 commits into
mainfrom
quest-plan/request-auth-union
Oct 19, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest-plan/request-auth-union

Conversation

@kixelated

@kixelated kixelated commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The maintainer closed moq-dev/moq#5927 (lite-07 AUTH IDs and a per-request Auth field): no per-request auth on moq-lite, and no byte spent on every request. quest/m1/auth/request-auth-id.md and the auth README still plan that design, and request-update.md and token-in-band.md depend on it.

One problem survives: a presenter sends AUTH, then right away a request that only the new token admits, and the acceptor can judge the request before the AUTH settles.

Approach

  • Rename request-auth-id.md to quest/m1/auth/request-race.md, [S] A request right behind its token is admitted. The new name says what the quest does now; the old one described the dropped design.
  • What main has today (checked): no Auth ID or per-request field in the lite draft, rs/moq-net or js/net, so nothing needs removing. A lite acceptor judges SUBSCRIBE and FETCH against its scope when it decodes them. The presenter's gate refuses a request its known union does not cover before sending it. add() in Rust and JS resolves only after AUTH_OK. Announcements already recover: a withheld broadcast comes back when the scope widens.
  • What the quest does:
    • The presenter waits on its unanswered tokens instead of failing locally, and logs each wait.
    • Replayed tokens are registered on a new session before moq-tokio publishes it.
    • The lite-07-wip spec states the ordering: the acceptor judges on read, and widens its scope no later than it sends AUTH_OK.
  • Auth README: rewrote the "one kind of auth", "unnamed/named request" and steps decisions. moq-transport's per-request token stays an acceptor-side mapping onto lite (feat(auth): a request token is one more auth on requests() #5148). Step 2 (auth=id) is dropped. Step 3 is moq-transport only, through Route::auth.
  • request-update.md: on lite, Route::auth puts nothing on the wire, and lite renews through the union.
  • token-in-band.md: the first token rides SETUP (a new lite-07-wip SETUP parameter, or moq-transport's existing option), with the URL as the fallback. The relay's admission deadline goes away.
  • doc/concept/moq-lite.md: "no per-request token yet" becomes "no per-request token".

Decisions

  1. How does a request right behind its token avoid refusal?
    • (a) The acceptor waits on that peer's unanswered AUTHs. This does not close the race on lite: AUTH and the request ride different streams, so a lost AUTH packet lets the request arrive first. Abuse: a peer that keeps presenting AUTHs keeps something pending forever.
    • (b) AUTH_WAIT: a prefix on the request stream carrying how many Auth Streams the sender has opened. Exact, but it is a new message to save one RTT.
    • (c) The presenter waits ✅, logging each wait so we can see how often the extra RTT happens. Maintainer: "I want to make sure we're not adding dumb RTTs." There is no stats::Session counter (maintainer: "don't add to stats::Session"). It costs one RTT, only on the first request relying on a new token. No wire bytes, no acceptor state. Abuse: an acceptor that never answers stalls only our own requests. Revisit (b) only if the log shows the wait firing.
  2. Where the first token rides.
    • CONNECT only (URL now, an auth header later): superseded.
    • SETUP ✅ (maintainer: "we need to block on SETUP anyway"), with the URL as the fallback. Analysis:
      • No extra RTT. The acceptor already reads the client's SETUP before serving (Server::accept_request_lite pauses there), and a lite client never waits on the server's SETUP before sending requests.
      • Supported versions. lite-05/06/07 have a SETUP stream, lite-03/04 have none, and the older legacy ALPN has a different exchange. Only lite-07-wip gains the SETUP token. moq-transport already has AUTHORIZATION TOKEN in CLIENT_SETUP.
      • Fallback. The version is negotiated (ALPN or WebTransport subprotocol) before SETUP is written, but the URL is fixed before negotiation. So the URL carries the token while any offered version lacks the SETUP token, which is every lite version before 07.
      • Precedence. A dial URL that already carries a credential keeps it as the connection credential, and every configured token goes to AUTH streams. The client never sends two different values.
      • Raw QUIC and Qmux already carry the query in SETUP's Path.
      • Abuse. The token is bounded by SETUP's Message Length cap and reaches the auth server the same way a URL token does, so an unauthenticated client gains nothing new.
    • Dropped: the auth-header plan and "always in the CONNECT request".
  3. Drop feat(net): moq-lite-07 requests name their auth by AUTH ID #5927's FIN-linger withdrawal, per-token wakeups and named bench. ✅ Nothing names the old token under the union. Renewal is: present the new token, await its AUTH_OK, drop the old one.
  4. moq-transport token aliases. ✅ They stay unsupported (cache size 0).
  5. Quest path. ✅ Keep request-race.md. The name describes the work.
  6. Reconnect replay (Codex P2). ✅ moq-tokio's Shared::connected publishes a new session before its replay tasks reach add(), so the wait could see nothing pending. The quest now registers (queues) every replayed token on the new session's handle before publishing the session; issuer.md does this by construction later. With the first token in SETUP, only the extra tokens need this.

Impact

  • Public API: none in this quest.
  • Wire: request-race.md is lite-07-wip draft text only. token-in-band.md adds one lite-07-wip SETUP parameter. Published versions are unchanged.

Alternatives

Keep the named design from #5927 (rejected by the maintainer). Also: do nothing and let apps retry on UNAUTHORIZED. That is a retry workaround.

Follow-ups

  • Checks: quest check (438 documents ok) and just check both pass.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 19, 2026 11:34
… race

Rewrites quest/m1/auth/request-auth-id.md as quest/m1/auth/request-race.md
after the maintainer closed #5927: lite AUTH gets no ID and lite requests no
Auth field, so lite requests are judged by the session union alone. The
remaining race, a request sent right behind the token it relies on, gets
options (acceptor waits, AUTH_WAIT, presenter waits) with a recommendation.
The auth README, request-update and token-in-band follow: moq-transport
per-request tokens stay acceptor-side, and the first token stays in the
CONNECT request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated force-pushed the quest-plan/request-auth-union branch from 3408498 to 04576ec Compare October 19, 2026 18:35
@kixelated
kixelated marked this pull request as ready for review October 19, 2026 18:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T18:55:51.935659Z bdcdb7a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6161f383-d7df-4d80-9217-e0d84bf344f4
📥 Commits

Reviewing files that changed from the base of the PR and between 82c2d5d and bdcdb7a.

📒 Files selected for processing: 6
  • doc/concept/moq-lite.md
  • quest/m1/auth/README.md
  • quest/m1/auth/request-auth-id.md
  • quest/m1/auth/request-race.md
  • quest/m1/auth/request-update.md
  • quest/m1/auth/token-in-band.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04576ec65d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quest/m1/auth/token-in-band.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10be3b0c7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quest/m1/auth/request-race.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fddd31d630

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quest/m1/auth/request-race.md Resolved
…re the session is published

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: bdcdb7a261

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated
kixelated added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 6c35767 Oct 19, 2026
9 checks passed
@kixelated
kixelated deleted the quest-plan/request-auth-union branch October 19, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant