Add controls for verify_sub option in PyJWT#562
Merged
vimalloc merged 1 commit intovimalloc:masterfrom Nov 20, 2024
jlucier:master
Merged
Add controls for verify_sub option in PyJWT#562vimalloc merged 1 commit intovimalloc:masterfrom jlucier:master
verify_sub option in PyJWT#562vimalloc merged 1 commit intovimalloc:masterfrom
jlucier:master
Conversation
vimalloc
approved these changes
Nov 20, 2024
Owner
vimalloc
left a comment
There was a problem hiding this comment.
Looks great, thanks for putting this together!
3 tasks
Domar95
added a commit
to Domar95/simply-unified-organizer
that referenced
this pull request
Feb 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the discussion in this issue: #561
For people who have historically been using values for the
subclaim other than strings, they may need or want the ability to control PyJWT's new behavior (as of 2.10.0) which is to reject those tokens as invalid.This work adds a new option
JWT_VERIFY_SUBwhich can be used to control theverify_suboption when callingjwt.decode(...)from the PyJWT library.The default value for
JWT_VERIFY_SUBisTrue, which results in thesubclaim being verified. This default results in no change to how the library behaved prior to this addition. By choosing to setJWT_VERIFY_SUBtoFalse, the user can turn off theverify_suboption in thejwt.decodecall.I welcome feedback on the naming or anything else regarding the implementation. Also, please let me know if I missed any places where this needs to be tested or documented. Thanks!