Repository navigation
fix(plugin-auth): degraded rate-limit warning names the cache registration that boots - #25434
Conversation
…ation that boots
The per-process fallback warning prescribed "Redis via
@objectstack/service-cache", whose Redis adapter throws at init. It now
names the working path: a shared ICacheService registered as `cache`
(ctx.registerService('cache', impl)), and promises no bundled adapter.
ADR-0069 D2 reference and degradedImpact suffix kept. Pins flipped in
plugin-auth and runtime; otp-send-guard doc comment corrected.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin bac46b16f3663377813a58190d0151b9cbf46d53 && git checkout bac46b16f3663377813a58190d0151b9cbf46d53
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 77392e901cce58316e803144971f2741ef049fc4 ff4e36d9cceebd49d09077fb4c97e25c7a0092a2 && git checkout -B drift-repro 77392e901cce58316e803144971f2741ef049fc4 && git merge --no-ff ff4e36d9cceebd49d09077fb4c97e25c7a0092a2
node scripts/docs-audit/affected-docs.mjs --json 77392e901cce58316e803144971f2741ef049fc4 |
席位核对 · ACCEPT · 2026-10-23T13:56Z
Generated by Claude Code |
Requested by Sales · project thread
Fixes #25329
Clause-②: no
Metadata-protocol: none
What changed
With no
cacheservice registered,createLazyCounterStore(plugin-authrate-limit-storage.ts) falls back to a per-process store and warns once. That warning told a multi-node deployment to use "Redis via @objectstack/service-cache".CacheServicePlugin.initthrows whenadapter: 'redis'is set ("Redis cache adapter is not yet implemented"), so an operator who followed the warning got a boot failure.The warning now names the path that boots today, and promises no bundled adapter, so it cannot go stale when one ships:
The ADR-0069 D2 reference and the per-caller
degradedImpactsuffix are unchanged. This is fix option (a) of the card. Option (b), implementing the Redis adapter inservice-cache, is not taken here.Every caller of
createLazyCounterStoreprints this text: better-auth's rate limit, the per-number OTP send budget, the SMS quotas, and the runtime's inbound and endpoint limiters.Files
packages/plugins/plugin-auth/src/rate-limit-storage.ts: the warning text.packages/plugins/plugin-auth/src/rate-limit-storage.test.ts: new pin. The warning names thecacheregistration, does not name@objectstack/service-cache, does not say Redis, and keeps(ADR-0069 D2).packages/runtime/src/security/inbound-rate-limit.test.ts: this pin quoted the old remedy (/Redis via @objectstack\/service-cache/). It is flipped to the new one plus a negative on@objectstack/service-cache.packages/plugins/plugin-auth/src/otp-send-guard.ts: a doc comment that repeated the same Redis-via-service-cache claim..changeset/25329-rate-limit-cache-warning-remedy.md:@objectstack/plugin-authpatch.Out-of-bounds files were not touched:
auth-manager.tsandpackages/spec. PR #25328 (docs for the same thread) is merged and edits onlycontent/docs/api/wire-format.mdx,content/docs/deployment/production-readiness.mdxanddocs/HARDENING.md, so it does not overlap.Verification (head ff4e36d)
@objectstack/runtime^...plus@objectstack/plugin-authunder the verify lock: VERDICT command-exit 0.dist/rate-limit-storage.jscarries the new text, and no file in plugin-authdist/carries the old text.pnpm --filter @objectstack/plugin-auth test: Test Files 189 passed (189), Tests 3580 passed, 10 skipped.pnpm --filter @objectstack/plugin-auth typecheck: exit 0, check:test-typecheck OK.pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/security/inbound-rate-limit.test.ts: 25/25 passed. Runtime reads plugin-auth through itsexports, so this ran against the rebuiltdist.pnpm --filter @objectstack/runtime typecheck: exit 0.scripts/ablation-replace.mjs: the src remedy was put back to "(Redis via @objectstack/service-cache)". The anchor went 1 to 0 and the blob changed.src/rate-limit-storage.test.tswent red, 1 failed / 19 passed, on the newtoContainassertion. The file was then restored, blob equal to HEAD andgit diff HEADempty.Acceptance notes
These are not filed here, because they are read-only text drift, not a reproduced defect at a public door:
README.md:415lists@objectstack/service-cacheas "Cache — in-memory and Redis".content/docs/kernel/services-checklist.mdx:522and:543advertise a Redis adapter in the same package.content/docs/kernel/services.mdx:130andcontent/docs/kernel/cluster.mdx:720already say that the Redis adapter is a skeleton.🤖 Generated with Claude Code
https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy