You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Global rate_limit config is documented and parsed but never read — enabling it does nothing #127
Meanwhile four keys are documented in docs/CONFIG_REFERENCE.md:500-503 — rate_limit.enabled, .max, .interval, .key — described as "Enable rate limiting globally".
Measured
Server with a global limit of 2 per 60s and no per-endpoint rate-limit::
With the same numbers moved into the endpoint's own rate-limit: block, request 3 is refused. So the feature works per-endpoint and is inert globally.
Why it matters
An operator who configures global rate limiting — the documented way to protect a whole deployment — gets no rate limiting at all, with no warning at startup and no error. They believe they are protected and are not.
This is the exact failure mode CLAUDE.md's documentation checklist calls out: "Every config key you document, grep for a reader in src/, not just a parser. Three keys once shipped documented and parsed but never read; operators could set them and nothing happened."
Suggested fix
Fall back to the global config when an endpoint declares no rate-limit: of its own, so per-endpoint overrides global. That is what the documentation already promises.
Not fixed in passing: making it live means deployments that set the global block — and are currently unlimited — start returning 429s. That is a real behaviour change and needs an owner decision, plus a release note. The alternative is to delete the keys and the docs, which is worse: the global option is the one that should exist.
Found during an architecture review round on the request hot path, while verifying #127.
The global rate_limit: block now applies to endpoints that declare no rate-limit: of their own. Per-endpoint config still wins.
Behaviour change: deployments that set the global block and are unlimited today will start returning 429s — the documented behaviour finally happening.
A crew review of that change caught a second defect before it merged: rate-limit: {enabled: false} could not opt out, because an explicit off was indistinguishable from "never declared" (both leave enabled false). RateLimitConfig gained a declared flag, and the middleware treats declared || enabled as endpoint ownership so a config built in code still behaves.
Covered by test_rate_limit_enforcement.py: the global block applies, a per-endpoint block overrides it (both configured and different, which the first version of that test failed to do), and an explicit opt-out is honoured.
Activity
fix: the rate limiter must stop the request, not relabel it (#128)
fix: three open issues that were filed because they change behaviour (#…
jrosskopf commentedon Sep 22, 2026
Fixed in #135 (merged as 23bd0f0).
The global
rate_limit:block now applies to endpoints that declare norate-limit:of their own. Per-endpoint config still wins.Behaviour change: deployments that set the global block and are unlimited today will start returning 429s — the documented behaviour finally happening.
A crew review of that change caught a second defect before it merged:
rate-limit: {enabled: false}could not opt out, because an explicit off was indistinguishable from "never declared" (both leaveenabledfalse).RateLimitConfiggained adeclaredflag, and the middleware treatsdeclared || enabledas endpoint ownership so a config built in code still behaves.Covered by
test_rate_limit_enforcement.py: the global block applies, a per-endpoint block overrides it (both configured and different, which the first version of that test failed to do), and an explicit opt-out is honoured.