-
Notifications
You must be signed in to change notification settings - Fork 40
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: add order of the JWT source header/cookie/query as config #71
Conversation
0698236
to
0bfb9ae
Compare
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.
- First issue is missing unit tests.
- Second I'd like propose a deeper change, instead of having several parameters to configure order and source of token extraction - i think about boling it down to one parameter that could look like
JwtSources:
- bearer:MyAuth # value from http header in format Bearer: TOKEN
- header:MyJwt # plain value of http header
- cookie:MyCookie # plain value of cookie
- query:MyQuery # plain value of query string parameter
WDYT ?
0bfb9ae
to
72addc1
Compare
I like the idea and i am working on it. I've pushed my progress so far. One problem is preserving the order, als pure maps can't do that. The current idea for the config is
|
42dc5c9
to
ed7fc6d
Compare
Ok, i think it is done. |
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.
- can you mark deprecated parameters also in plugin code, i think godoc should have some sort of deprecation tags.
- should not the default value of order be initialized in CreateConfig function ?
ed7fc6d
to
339b7af
Compare
The config field is called JwtSources, the format is [{type: ...., key: ...},] Possible types are bearer, header, cookie, query. The order of the list enty is the order in wich the JWT wil be tried to retrieved.
339b7af
to
cbc7555
Compare
|
understood, thanks |
Thanks for anither great contributions, availablein 0.9.0 version. |
With this PR it is posible to control the order how the JWT is resolved from header, cookie or query parameter.