feat: As a user, I want to add metadata to routes, so that I can filter global plugins configuration by _meta.filter with this metadata
- Dominant language
- Lua
- Stars
- 17.1k
- Forks
- 2.9k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 63
Description
### Description
### Problem description
We are using apisix with global configuration for a huge number of routes created by different teams. In this context, a global rate limit configuration plugin was deployed, but there are instances were this global configuration should be skipped in favor of a different, more permissive one.
We know it's possible to remove the global configuration and make plugin configurations shared and referenced between routes, but we want to still preserve the global rule as a default, instead of relying on routes to attach to a plugin definition, because otherwise we can't enforce that.
We came to a solution where we append special string on route names to be able to disable this global rate limit configuration on some routes, by using the _meta.filter property, and matching this special string on the $route_name variable.
### Feature request
Having done this, it occurred to us that it may be useful to add metadata to a route, and be able to use it in the plugin's _meta.filter property, so we can share a common default behavior, but also skippable if requested.
I wanted to discuss if it's a common case, enough to justify this as a new feature, or maybe I'm just guessing too much and there are different solutions to this problem.
Thank you.
Contributor guide
Research direction
Start by reviewing the existing route configuration and global plugin _meta.filter behavior, especially how $route_name is currently used. Clarify the proposed route metadata shape and filtering semantics with maintainers before identifying implementation entry points. Done should include an agreed feature design and corresponding behavior for matching metadata in global plugin filters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100