Add per-route rate-limit overrides on map-form routes - #193
Open
williamthome wants to merge 2 commits into
Open
Conversation
williamthome
force-pushed
the
feat/per-route-limits
branch
from
August 2, 2026 14:58
5703256 to
7eb517d
Compare
williamthome
force-pushed
the
feat/per-route-limits
branch
from
August 3, 2026 01:25
7eb517d to
3d71f6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
rate_limitguard is listener-global, so a cheap health check and an expensive report endpoint share one budget. Arate_limitkey on a map-form route now overrides the listener default for that path, with its own bucket namespace so the two do not contend. Routes that declare no override keep using the listener-global limit, and when no route declares one the compiled subset isundefinedand the lookup is skipped entirely. Matching reuses the same path and method matchers as dispatch, first-match-wins in declaration order; a path match whose method falls outside the route's allowlist keeps scanning, so an override only applies to the methods that route declares.Per-route configs are validated and derived to their
{Rate, Cap, Cost}triple at listener init, so a bad config raises there rather than on the request path.