-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: allow get headers when decoding token #442
feat: allow get headers when decoding token #442
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Extracting headers would be useful, since they might contain hints to used key identifiers. |
This is interesting, thx for your feedback. But is decoding header really a side effect? Couldn't we consider decoding a token is both decoding header and payload? |
Ah sorry, I was not clear on that. I'm referring to Side effect (computer science). It's about how the header is decoded. In the current patch, it's not done explicitly - e.g. decoding a JWT with an invalid signing hash would change the |
Co-authored-by: Brent Shaffer <[email protected]>
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.
Thanks @kpn13 for working on this. LGTM
I made some comments and doc suggestions and merged them too.
This PR in an enhancement to allow to get headers directly using JWT::decode() by allowing to pass a third param by reference.
#431