-
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
feat:As a user, I don't think allowlist and denylist of ua-restriction can be enabled at the same time #7467
Comments
Fair enough. But if we make |
if allowlist and denylist are both on, ua-restriction only uses allowlist, and User-Agents that are not in allowlist are rejected. How about this? |
Look like if the allowlist is matched, the denylist will be skipped? |
Another problem: If I only configure allowlist , User-Agent is not on allowlist will also be released. this code in apisix/plugins/ua-restriction.lua(apisix 2.13) ` if match > MATCH_ALLOW then I looked at the code, If User-Agent on allowlist, the value of match becomes MATCH_ALLOW. If User-Agent not on allowlist, the value of match is MATCH_NONE. In both cases, User-Agent will be released. |
So we need an allowlist-only mode. When only allowlist is given, |
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. |
I think the allowlist and denylist should be exclusive, it they exist at the same time, it is very difficult to understand |
I think it could go either way:
The second is simpler and easier to understand. I'm not sure there is a need for the first way of this plugin. |
@bzp2010 The first one looks meanless, if you set a allowlist, all you want is for the allowlist to pass, why do you set a blacklist at all? to block the one in the allowlist? |
1.I also agree with second way. |
I think we can work on this now |
Ok, I will raise a new PR for it. |
Description
I found other restriction plugin has a logic:Either one of whitelist or blacklist attribute must be specified。
But in ua-restriction, both allowlist and denylist can be used on their own.
If User-Agent is neither on the allowlist nor the denylist , the processing logic is the same as that of the allowlist .
So why do we still use the allowlist ?
The text was updated successfully, but these errors were encountered: