-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
anonymous consumer don't trigger ip restriction plugins with this consumer id set #2414
Comments
No #2222 is related to multiple auth, here there seems to be only 1 auth method. |
Yes only 1 auth method is used. |
Let me get this correct:
correct? |
yes, exactly. |
The auth plugins run at priority 1000, while the ip-restriction has priority 990. So that doesn't seem to be the issue. |
so I recreated the issue (using key-auth instead). I first tested the ip-ranges by configuring them on the api, and then it gets blocked properly. When I configure the same ip's on the consumer (anonymous) then it does not block them. This confirms the issue @pheex is seeing. When looking at the logs I only see the
Cause:In the access phase the iterator that runs the plugins creates a list to run and then executes them one by one. What this iterator doesn't take into account is that during this loop the conditions change (the consumer is identified), and new plugins should be added to the list it is executing. |
forget about the above, sorry for the noise. Culprit is in the iterator for plugin execution, it checks on |
thanks @Tieske for explanations |
fix is in #2424. Closing this now. |
Credentials will not always be set, hence the iterator should base itself on the consumer id set. fixes #2414
Credentials will not always be set, hence the iterator should base itself on the consumer id set. fixes #2414
Credentials will not always be set, hence the iterator should base itself on the consumer id set. fixes #2414
Summary
I try to use Kong for my internal clients and my external clients, i want no auth for my internal clients and basic auth for externals.
I enable basic auth with anonymous defined to a consumer
I enable ip restriction with the consumer id set (with the consumer defined in basic auth anonymous field)
to blacklist WAN ip only if no auth is provided
I expected when no basic auth is supply, the anonymous consumer "trigger" the ip restriction plugin but that's not the case.
If i call my api with basic auth header (with the consumer defined in ip restriction) then the ip restriction works (LAN authorized, WAN unauthorized). but that's not my need.
Is it an issue ? There is another way to achieve my goal ?
The text was updated successfully, but these errors were encountered: