-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[key-auth]: Query parameters truncated to first 100 when hide_credentials
is set to true
#13635
Comments
Hi @dingjiayi ! Thank you for sending this issue. I'm wondering - have you configured the mentioned parameter: Here's some info on the Kong Conifguration File and here's a link to a template with the option that you might want to change: |
they are not truncated if we get this in (though I am not 100% sure if there is some truncation in nginx or ada for too long strings): though I am not sure should they. |
Hi @nowNick , Thank you for your response. I have been using the default value for That's why i created this issue. I would like to understand whether this is a bug or an issue with the documentation description. Thank you! |
Hi @bungle I believe that merging this PR (#13619) will indeed resolve the issue mentioned above. The lua-resty-ada solution is very efficient and useful. Thank you. |
Additionally, would the Kong team plan to adding a function in For instance, this could be achieved using the get_all function from lua-resty-ada or ngx.var.http_$name from OpenResty. Thank you. |
This I have been thinking. I personally think that
I think you mean |
Hi @bungle Yes, you are correct; it should be I'm looking forward to seeing the improvements that the integration of Ada will bring. Thanks again! |
Is there an existing issue for this?
Kong version (
$ kong version
)3.7.1
Current Behavior
When I configure a route with the key-auth plugin and set the
hide_credentials
option to true, the upstream server only receives the first 100 query parameters. Any query parameters beyond the first 100 are missing.Expected Behavior
When proxying, Kong should send all the request query arguments
Steps To Reproduce
Deploy and start Kong 3.7.1
Configure a route.
Apply the key-auth plugin to the route and set the hide_credentials option to true.
Make a request to the configured route that includes more than 100 query parameters.
Anything else?
Root Cause:
kong.request.get_query()
.kong/kong/plugins/key-auth/handler.lua
Line 116 in e89feb5
apikey
from the query_args and then calls kong.service.request.set_query(query) to set the modified query arguments.kong/kong/plugins/key-auth/handler.lua
Line 147 in e89feb5
Due to the behavior of kong.request.get_query():
This results in the loss of query arguments beyond the first 100.
Additional:
Other plugins that use similar functionality may also be affected by this issue.
The text was updated successfully, but these errors were encountered: