Repository navigation
refactor: distinct auth refusal names and mirrored clock names - #6510
Conversation
Quest-Claim: 1581661f17f06f4a
Rename moq_auth::serve::Refusal to serve::Denial and moq_net::stats::Refusal to stats::RefusalKind, so Refusal names only the shared 403 body. Rename moq_clock::anchor() to origin() to match @moq/clock, return an Installed handle from the JS Manual.install() like Rust's, and drop moq_net::time::now() in favor of Instant::now(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
c4358b0 to
8eb8789
Compare
|
Status: the implementation is done and
(Written by Claude Opus 5.5) |
…th-clock-names # Conflicts: # js/watch/src/sync.test.ts # rs/moq-audio/src/decode/consumer.rs # rs/moq-mux/src/container/test_util.rs # rs/moq-net/MIGRATE.md # rs/moq-relay/src/uring.rs # rs/moq-room/src/chat.rs # rs/moq-stats/MIGRATE.md # rs/moq-uring/benches/session_lite.rs # rs/moq-uring/tests/integration/session.rs # rs/moq-uring/tests/integration/web.rs
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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 40 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 667f4450d6
ℹ️ 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".
…th-clock-names # Conflicts: # rs/moq-net/MIGRATE.md
|
Merging. Records the module-qualified Reason names and Installed.close(), as the maintainer chose. CI is green, the current head has a non-Grok review, and (Written by Claude Opus 5.5) |
# Conflicts: # quest/m1/api-audit/README.md # rs/moq-auth/MIGRATE.md # rs/moq-auth/src/serve.rs
# Conflicts: # rs/moq-net/MIGRATE.md
|
Merging. Merged (Written by Claude Opus 5.5) |
Main renamed the free function in #6510. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carry the Wall times through #6510's Denial and Instant::now renames, and keep both MIGRATE.md entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finishes quest/m1/api-audit/auth-clock-names.md, following its 2026-10-22 decisions.
Changes
serve::Refusal(the reference server's policy enum) is nowserve::Denial, soRefusalonly names the shared 403 body,moq_auth::Refusal.stats::Refusal(the counter kind) is nowstats::RefusalKind. moq-stats re-exports it under the new name. moq-relay's internal uses follow.time::now()re-export.time::Instant::now()is now the only way to read the clock, and every caller across the workspace switched to it.anchor()is noworigin(), matching@moq/clock. Rustdoc spells out the unit split: Rust returns a nanosecondWallpaired with an instant, because a runtime clock's instant zero is before 1970 (the clock leads by 2^32 s). JS returns the wall time of instant zero in milliseconds. The JS TSDoc points back to Rust.Manual.install()returns anInstalledhandle instead of a restore closure, mirroring Rust'sManual::install -> Installed. The handle has an idempotentclose(), and every caller switched to it.Installeddeliberately does not implementDisposable:@moq/authtype-checks@moq/clockagainst ES2022 libs, which have noSymbol.dispose. Tests that useusingwrap the handle themselves.SystemTimes (Claims::{expires, issued, not_before}andGrant::expires) are added to quest/m1/time/wall.md, as the plan asked. The finished quest is deleted.Dropped:
lease::Reasonandrefusal::Reasonkeep their names (decision 1 below).Public API and wire impact
Breaking renames, each with a
MIGRATE.mdentry under## Unreleased:serve::Refusal->serve::Denialstats::Refusal->stats::RefusalKind;time::nowremovedRefusal->RefusalKindanchor()->origin()Manual.install()returnsInstalled(new exported type)Wire: none. JSON shapes, stats track names, and metric labels are unchanged. js/auth has no counterpart to the server policy enum, so the Cross-Package Sync rows (js/auth, doc/bin/relay/auth.md) need no edits.
Decisions
Reasonenums. The quest Goal says reason types should have distinct names, but the decision only renamed the twoRefusals. BothReasons live in public modules and are always written qualified (refusal::Reason,lease::Reason), which follows the "short names under a module namespace" rule.lease::Reasontolease::End. That touches about 50 sites, mostly in moq-relay's auth code, which conflicts with moq-dev/moq#6509.Installedhandle. Rust'sInstalledhas no counterpart, because a Rust install lasts for the life of its runtime.[Symbol.dispose]is left out so@moq/clockkeeps building against ES2022 libs.close(), the JS convention for an idempotent terminal op.uninstall().Checks
just checkpasses locally after mergingmain(Rust, JS, Python, Go, Kotlin, Dart, C++, OBS, docs, and lint), except theflakestage, which cannot build the github-runner VM check in a sandbox without user namespaces; CI covers it. The merges switched callersmainadded since (moq-net session setup in tests and benches, four JSinstall()callers) toInstant::now()andInstalled.close(), and quest/m1/auth/token-in-band.md now namesserve::Denial::TwoTokens(Codex finding).just test interop --allwas not run, since nothing on the wire changed and moq-ffi only switched one internaltime::now()call.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code