-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(key-auth): supporting key-auth plugin to get key from query string #4490
Conversation
@wisdom-yzh From the changes I guess you tried to introduce an using order between the |
@tokers Accord to description of #4421, I guess @forgaoqiang wants to get key from both query string and headers, not exclusive. Maybe I can define one field instead of two fields, and check key from both query and headers? |
I think "header and query string" is OK, as jwt-auth plugin does it: apisix/apisix/plugins/jwt-auth.lua Line 154 in 07bfe5b
|
t/plugin/key-auth.t
Outdated
@@ -300,7 +300,45 @@ passed | |||
|
|||
|
|||
|
|||
=== TEST 11: valid consumer | |||
=== TEST 11: customize querystring |
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.
Please don't add the test in the middle of the other test. And we need to verify it via GET /hello?xxx
in its own version of "valid consumer"
@spacewander hi~I have changed strategy to "header and query string", and then rename field from "header" to "key_name“. |
@wisdom-yzh |
ok, i'll restore the origin commit and fix the test case issue soon |
Great, this feature is what I needed, thanks |
What this PR does / why we need it:
fixes issue #4421
Adding a new
query
property to key-auth plugin, which can get key value from http query stringPre-submission checklist: