-
Notifications
You must be signed in to change notification settings - Fork 33
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
default dynamic wasm rule data to empty string #232
Closed
+4
−1
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I set as counter
request.headers.My-Custom-Header-01
? All the requests not having that header will contribute to a single (limitador's internal hit) counterThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requests that do not have that header are treated as requests that have that header with an empty value, therefore sharing the same counter.
If what you want is to trigger or not trigger a limit based on the presence or absence of a header, use a condition instead; not a counter qualifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, what you say is correct, but I do not fully agree on this UX: if you set a counter based on a header, add a condition on the header existence.
For me, adding a counter implicitly tells I only want to rate limit traffic that is qualified by the counter.
Let's see what @didierofrivia and @alexsnaps have to say about this
Let's say we have this RLP
What would you expect from this RLP? rate limiting traffic authenticated (hence, the
auth.identify.username
exists in the metadata) is expected. So far so good. What about traffic not authenticated (hence, theauth.identify.username
does not exist in the metadata)?? With this PR approved, the traffic which is not authenticated will be rate limited because the username es""
. Without the changes of this PR, if the request is not authenticated, rate limiting will not be triggered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eguzki, coincidently, this was exactly the example that made us1 want to default to an empty string in the wasm-shim (what Kuadrant/wasm-shim#39 wants to revert now).
Footnotes
Discussed offline with @alexsnaps and @didierofrivia on 2023-07-27, and implemented by @alexsnaps on 2023-07-28. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kuadrant/wasm-shim#39 does not revert entirely that commit. Only reverts the behavior when the descriptor is not found in the module generating RLS descriptors. For the conditions, Kuadrant/wasm-shim#39 keeps the changes to allow operators to be meaningful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that. But, most importantly, I also understand that setting the default value to
""
, so some RL is enforced, is one approach. In itself, it is nor better, nor worse than setting no default at all. If most people prefers the contrary of what's proposed here, I'm good with that too obviously.