fix(auth): fail closed on rate limiter errors#5109
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5109 +/- ##
=======================================
Coverage 94.13% 94.13%
=======================================
Files 466 466
Lines 39573 39573
Branches 14436 14436
=======================================
Hits 37254 37254
Misses 1664 1664
Partials 655 655
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 01:10:44 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
Description
enforceRateLimitinsrc/auth/rate-limit.tsto return a structured503JSON response{ error: "rate_limiter_unavailable" }with aRetry-After: 5header when the Durable ObjectidFromName/get/fetchpath throws.rate_limit.deniedaudit write does not convert an already-denied429into a crash.test/unit/auth.test.tsto assert the new fail-closed behavior for bothErrorand non-ErrorDurable Object failures and adjust test names/comments to match the structured response expectation.Testing
npx vitest run test/unit/auth.test.ts -t "REGRESSION (#5000)" --reporter=verbose, which passed the updated regression checks.npx vitest run test/unit/auth.test.ts --reporter=verbose, which passed (allauth.test.tscases passed locally).npm run test:coveragein this environment but the complete repo-wide coverage run could not be completed here due to unrelated long-running/timeout failures in other unit shards; recommend running the full local gate (npm run test:ci/npm run test:coverage) before pushing.Codex Task