Skip to content

feat(limit-req): support variables for rate/burst and multi-rules configuration#13297

Open
niemne wants to merge 8 commits intoapache:masterfrom
niemne:limit-req-rules
Open

feat(limit-req): support variables for rate/burst and multi-rules configuration#13297
niemne wants to merge 8 commits intoapache:masterfrom
niemne:limit-req-rules

Conversation

@niemne
Copy link
Copy Markdown

@niemne niemne commented Apr 24, 2026

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:

  1. Dynamic Variables: The rate and burst parameters now accept string variables (e.g. ${http_rate}), enabling dynamic threshold adjustments based on request attributes.

  2. 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.

  3. 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

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant