feat(limit-req): support variables for rate/burst and multi-rules configuration#13297
Open
niemne wants to merge 8 commits intoapache:masterfrom
Open
feat(limit-req): support variables for rate/burst and multi-rules configuration#13297niemne wants to merge 8 commits intoapache:masterfrom
niemne wants to merge 8 commits intoapache:masterfrom
Conversation
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
This PR enhances the limit-req plugin by introducing support for dynamic variables and multiple rule sets, allowing for more flexible and granular rate limiting strategies.
Key Changes:
Dynamic Variables: The rate and burst parameters now accept string variables (e.g. ${http_rate}), enabling dynamic threshold adjustments based on request attributes.
Multi-Rule Support: Introduced a new rules configuration array. This allows defining multiple rate limiting rules (containing rate, burst, and key) within a single plugin instance.
Logic Refactoring: Core logic has been refactored into apisix/plugins/limit-req/init.lua to handle the new rule resolution and processing.
Which issue(s) this PR fixes:
relate issue: #13179
Checklist