We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
all consumers don't share the same counter when use the limit-count plugin
No response
=== TEST 1: add consumer jack1 --- config location /t { content_by_lua_block { local t = require("lib.test_admin").test local code, body = t('/apisix/admin/consumers', ngx.HTTP_PUT, [[{ "username": "jack1", "plugins": { "basic-auth": { "username": "jack2019", "password": "123456" } } }]] ) if code >= 300 then ngx.status = code end ngx.say(body) } } --- request GET /t --- response_body passed === TEST 2: add consumer jack2 --- config location /t { content_by_lua_block { local t = require("lib.test_admin").test local code, body = t('/apisix/admin/consumers', ngx.HTTP_PUT, [[{ "username": "jack2", "plugins": { "basic-auth": { "username": "jack2020", "password": "123456" } } }]] ) if code >= 300 then ngx.status = code end ngx.say(body) } } --- request GET /t --- response_body passed === TEST 3: set route with consumers --- config location /t { content_by_lua_block { local t = require("lib.test_admin").test local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, [[{ "uri": "/hello", "plugins": { "basic-auth": {}, "consumer-restriction":{ "whitelist":[ "jack1", "jack2" ], "rejected_code": 403, "type":"consumer_name" }, "limit-count": { "count": 1, "time_window": 60, "rejected_code": 429 } }, "upstream": { "nodes": { "127.0.0.1:1980": 1 }, "type": "roundrobin" } }]] ) if code >= 300 then ngx.status = code end ngx.say(body) } } --- response_body passed === TEST 4: hit jack1, pass --- request GET /hello --- more_headers Authorization: Basic amFjazIwMTk6MTIzNDU2 --- response_body hello world === TEST 5: hit jack2, reject, the two consumers share the same counter --- request GET /hello --- more_headers Authorization: Basic amFjazIwMjA6MTIzNDU2 --- error_code: 429
apisix version
uname -a
openresty -V
nginx -V
curl http://127.0.0.1:9090/v1/server_info
luarocks --version
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Current Behavior
all consumers don't share the same counter when use the limit-count plugin
Expected Behavior
all consumers don't share the same counter when use the limit-count plugin
Error Logs
No response
Steps to Reproduce
Environment
apisix version
): 3.6.0uname -a
): ubuntu 20.04openresty -V
ornginx -V
): openresty/1.21.4.2curl http://127.0.0.1:9090/v1/server_info
): 3.5.4luarocks --version
):The text was updated successfully, but these errors were encountered: