-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
help request: about the field allowed_by_methods
of the plugin consumer-restriction cause unexpected behavior
#8792
Comments
The
|
@mscb402 yes, but if use
|
I know what happens. |
So please use |
@mscb402 maybe it's not the point, but you can test like below. After create consumer
you will see POST method is allowed but we don't set it in the |
Yes, you are right
At APISIX lua code. When whitelisted is set, the allowed_by_methods will ineffective |
https://github.com/apache/apisix/blob/master/apisix/plugins/consumer-restriction.lua#L151 |
@ronething As it stands now, we may not have any ways to do this (we cannot use a global rule to setup a consumer whitelist, as the global rules run before the route match). |
@tokers I mean one route but not any route. And i wonder if the
if yes, i will change PR status to ready for review #8795 |
Emmm. Not sure if this is a deliberated feature. |
This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
Description
I want to restrict a user to access the route only by a certain method(like GET) and deny other users to access the route via set
allowed_by_methods
, configured as follows1、restrict a user to access the route only by a certain method(like GET) is ok
2、Deny other users to access this route, this does not work
If this is a bug, i would like to help and fix it
Environment
apisix version
): 3.1.0uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: