-
Notifications
You must be signed in to change notification settings - Fork 670
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
Allow version 1.7 of pyjwt (Please help!) #465
Conversation
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 for this!
has_pyjwt_client = True | ||
except ImportError: | ||
# For jwt<2.0 | ||
has_pyjwt_client = False |
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.
This does not seem implemented yet?
|
||
from .exceptions import TokenBackendError | ||
from .utils import format_lazy | ||
|
||
|
||
try: | ||
# For jwt>=2.0 |
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 try to install the different pyjwt versions. Thanks!
@@ -129,9 +129,14 @@ def test_decode_hmac_with_expiry(self): | |||
|
|||
def test_decode_hmac_with_invalid_sig(self): | |||
self.payload['exp'] = aware_utcnow() + timedelta(days=1) | |||
token_1 = jwt.encode(self.payload, SECRET, algorithm='HS256') | |||
|
|||
token_1 = jwt.encode(self.payload.copy(), SECRET, algorithm='HS256') |
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.
Is there a reason we need to copy now? If so, then please use a property instead.
@Andrew-Chen-Wang Closing this because allowing PyJWT<2 takes much more effort than |
@unmonoqueteclea if you are able to continue so long as you have time, I'd like to help guide. Thank you for the contribution thus far though! Additionally, I've re-opened this PR for visibility purposes. If anyone would like to continue this PR, open a draft PR and I'd be more than happy to help guide. |
Closing in favor of #536 I'm so sorry this took forever. I finally finished my exams 😭 |
This is the first step to allow version 1.7 of
pyjwt
. [NOT READY FOR MERGE YET]All tests but one succeeded.
The test that fails is the one that uses
PyJWKCent
, that was added inpyjwt
2.0.Before I manually take that little class from
pyjwt
and add it to this project,I would like to know your opinion.
I think that, if adding this class will ensure compatibility with all the libraries depending
on
pyjwt
<2, it worths the effort.