Skip to content

fix(auth): keep accepted grants on fixed expiry deadlines - #4237

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/auth-expiry-clock
Sep 26, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/auth-expiry-clock

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

The auth client recomputes expiry from the wall clock each time its recheck loop runs, restarting the timer when the wall clock does not advance with Tokio. The relay also rejects an otherwise valid grant immediately when its expiry falls inside moq-auth's five-second skew allowance.

Approach

Share expiry conversion through Grant::deadline(), snapshot it once per accepted grant in the client and relay, and schedule client rechecks on Tokio's clock. Keep paused-clock HTTP fixtures on the same runtime and isolate their transport timeout from the lease clock.

Impact

  • Add Grant::deadline() -> Optiontokio::time::Instant under the existing tokio feature; client and serve enable that feature.
  • Past expiry within five seconds gets the remaining skew window on both sides; future expiry keeps its existing deadline.
  • Lease holders continue to enforce fixed grants. No wire-format or grant JSON changes.

Alternatives

Moving clock ownership into lease::Producer would change fixed-lease behavior and require a broader API change. The approved additive helper keeps deadline ownership in the existing client and relay drivers.

Validation

  • Before the fix, the relay skew regression failed and the paused client outage test missed expiry. With the fix, all five focused clock regressions pass.
  • Core-only, tokio-only, and serve-only moq-auth library builds pass.
  • nix develop --command just check: passed (527 default tests, 107 feature tests, docs, formatting, and packaging checks).

Follow-ups

None. Completes the auth-expiry-clock quest.

(Written by GPT-6)

@kixelated
kixelated marked this pull request as ready for review September 26, 2026 02:55
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

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

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b4a2532d-e5d2-46ea-9e88-e10209a80d68

📥 Commits

Reviewing files that changed from the base of the PR and between b99cad9 and 15be2ce.

📒 Files selected for processing (8)
  • doc/bin/relay/auth.md
  • doc/lib/rs/moq-auth.md
  • quest/m1/README.md
  • quest/m1/auth-expiry-clock.md
  • rs/moq-auth/Cargo.toml
  • rs/moq-auth/src/client.rs
  • rs/moq-auth/src/grant.rs
  • rs/moq-relay/src/auth.rs

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 commented Sep 26, 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-09-26T02:59:00.918948Z 15be2ce Draft marked ready
ℹ️ 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge check: CI green, Codex approved with no findings, no conflicts with main. Docs in doc/lib/rs/moq-auth.md and doc/bin/relay/auth.md match the new Grant::deadline() behavior (additive, tokio feature). No overlap with #4244, which only uses future expiries. No changes needed; enabling auto-merge.

(Written by Claude Opus 5.5)

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