Skip to content
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

bug: hmac-auth plugin will not sort array value in param #6313

Closed
kevinw66 opened this issue Feb 14, 2022 · 4 comments · Fixed by #6314
Closed

bug: hmac-auth plugin will not sort array value in param #6313

kevinw66 opened this issue Feb 14, 2022 · 4 comments · Fixed by #6314

Comments

@kevinw66
Copy link
Contributor

Issue description

When I passing url like /api/xxx?age=123&name=123&a=2&a=1
this should be sorted as a=1&a=2&age=123&name=123
but I got a=2&a=1&age=2&name=1

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):

Steps to reproduce

same as description

Actual result

same as description

Error log

same as description

Expected result

No response

@kevinw66
Copy link
Contributor Author

How to run tests in local MacOS machine?
I try to run prove -I. -I../test-nginx/inc -I../test-nginx/lib -r t/plugin/hmac-auth.t but got many errors
like

Failed test 'TEST 24: verify ok with signed headers - pattern "[error]" should not match any line in error.log but matches line "2022/02/14 16:15:18 [error] 39160\#5720660: *48 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:218):35: attempt to index local 't' (a number value)" (req 1)

Failed test 'TEST 25: add consumer with plugin hmac-auth - empty configuration - pattern "[error]" should not match any line in error.log but matches line "2022/02/14 16:15:19 [error] 39167\#5720674: *3 lua entry thread aborted: runtime error: ...ngye/Develop/Projects/Github/apisix/t/lib/test_admin.lua:18: module 'toolkit.json' not found:" (req 0)

@kevinw66
Copy link
Contributor Author

Can anyone help me ? The unit tests is the most difficult part when I want to submit a pr.
@spacewander @starsz @bisakhmondal

@kevinw66
Copy link
Contributor Author

Resolved by run git submodule update --init --recursive

@starsz
Copy link
Contributor

starsz commented Feb 16, 2022

Resolved by run git submodule update --init --recursive

Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants