Repository navigation
feat: allow get headers when decoding token - #442
vishwarajanand merged 10 commits into
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 <betterbrent@google.com>
vishwarajanand
left a comment
There was a problem hiding this comment.
Thanks @kpn13 for working on this. LGTM
I made some comments and doc suggestions and merged them too.
Co-authored-by: Vishwaraj Anand <vishwaraj.anand00@gmail.com> Co-authored-by: Brent Shaffer <betterbrent@google.com>
Co-authored-by: Vishwaraj Anand <vishwaraj.anand00@gmail.com> Co-authored-by: Brent Shaffer <betterbrent@google.com>
Co-authored-by: Vishwaraj Anand <vishwaraj.anand00@gmail.com> Co-authored-by: Brent Shaffer <betterbrent@google.com>
This PR in an enhancement to allow to get headers directly using JWT::decode() by allowing to pass a third param by reference.
#431