Conversation
…ude paths This annotation defines a list of path suffixes, typically static asset extensions, that are excluded from rate limiting. Matching requests are neither counted against the rate nor denied. Without it, a page load that pulls in many assets consumes the limit on its own, so the browser renders a broken page with only some assets loaded. With the assets excluded, the limit applies to the page requests themselves and a client over the limit gets a clean error page instead. The value is a comma or space separated list of suffixes. Entries are restricted to letters, digits, dots, underscores, slashes and dashes so an annotation cannot inject arbitrary configuration into the generated conditions. The annotation works on the configmap and on an ingress. An ingress value starting with a plus sign extends the configmap default instead of replacing it.
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.
Adds a
rate-limit-exclude-path-endannotation that lists path suffixes (typically static asset extensions) excluded from rate limiting. Matching requests are neither tracked nor denied.Motivation. With a request limit in place, a single page load that pulls in many assets consumes the limit on its own, so the browser ends up rendering a partially broken page. Having the ability to exclude the assets makes the limit apply to page requests themselves, and a client over the limit can get a clean error page instead of a broken one.
Implementation.
ReqTrackgains anExcludePathEndfield and emits!{ path_end ... }on thetrack-sc0rule, so excluded requests never increment the counter.ReqRateLimitgains the same field and appends!{ path_end ... }to the deny condition, so they are never denied either.^[A-Za-z0-9._/-]+$so annotation values cannot inject configuration into the generated conditions.+extends the ConfigMap default instead of replacing it.doc.yaml; unit tests added for parsing, cascading, and the generated conditions.