-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support global plugin #820
Comments
We need to list the plug-in as an object separately, at this time etcd may not be convenient to use directly |
got it |
why remove from MS? |
@juzhiyuan you need to submit your design for this issue and update the title |
Of course, the proposal would be finished and discuss completed no longer than next week. |
@juzhiyuan the Admin API has implemented the So I think we'd better use the existing APIs. |
@membphis np, I just updated the proposal about the API part.
|
I think the APIs should be consistent with the existing, refer to: API: set global rule
{
"plugins": {
"limit-count": {
"time_window": 60,
"policy": "local",
"count": 2,
"key": "remote_addr",
"rejected_code": 503
}
}
} API: get global rule
{
"plugins": {
"limit-count": {
"time_window": 60,
"policy": "local",
"count": 2,
"key": "remote_addr",
"rejected_code": 503
}
}
} API: get global rule list(new)
{
"code": 0,
"message": "",
"data": {
"rows": [
{
"id": 1,
"plugins": {
"limit-count": {
"time_window": 60,
"policy": "local",
"count": 2,
"key": "remote_addr",
"rejected_code": 503
}
}
}
]
}
} |
This comment has been minimized.
This comment has been minimized.
There is a more obvious problem in this design: The global plug-in is just an attribute of the plug-in, and it is not worth a separate menu. |
I have a peculiar situation in my project where I am trying to replace my existing old Proxy code with APISIX. my current proxy backtrack the versions apis and services in a different way. for example. Routes should be created in below format V2 API routing, fallback and backtracking rules to follow Invoke V2/API1/Service1/ will be redirected to V1/API1/Service1, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service1 in API1. Invoke V2/API1/Service2/ will be redirected to V1/API1/Service2, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service2 in API1. Invoke V2/API2/Service3/ will be redirected to V1/API2/Service3, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service3 in API2. Invoke V2/API2/Service4/ will be redirected to V2/API2/Service4, As it is present in V2 Invoke V2/API3/Service5/ will be redirected to V1/API3/Service5, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service5 in API3. Invoke V2/API4/Service6/ will be redirected to V2/API4/Service6, As it is present in V2 case 2: Invoke V3/API1/Service1/ will be redirected to V1/API1/Service1, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service1 in API1. Invoke V3/API1/Service2/ will be redirected to V1/API1/Service2, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service2 in API1. Invoke V3/API2/Service3/ will be redirected to V1/API2/Service3, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service3 in API2. Invoke V3/API2/Service4/ will be redirected to V3/API2/Service4, As it is present in V3 Invoke V3/API3/Service5/ will be redirected to V1/API3/Service5, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service5 in API3. Invoke V3/API4/Service6/ will be redirected to V2/API4/Service6, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V2 and search for the Service6 in API4. Invoke V3/API4/Service7/ will be redirected to V3/API5/Service7, As it is present in V3 I would like to ask how can i define a customer global plugin which is work when for any incoming request from client and rewrite the URL as per above rule. |
Background
The global plugin acts on every request and it is not bound to any Service, Route, or Consumer, which reduces the need to set up the same plugin configuration repeatedly for multiple resources.
Solution
Frontend
In the plug-in module, we will first support the global plugin, and in-scope plugin in the future. In this proposal, the focus will be on the global plugin.
3 pages are involved:
In this revision, the plugin list page and plugin configuration page will be adjusted, and the following are the changes:
Use process
NOTE
We will modify 3 modules:
Backend
refer to https://github.com/apache/apisix/blob/5de6ee467f83c38f31eff6cfd683736b441ac9c2/doc/zh-cn/architecture-design.md#global-rule
API: set global plugins
API: get global plugins
Reference
The text was updated successfully, but these errors were encountered: