Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Allow version 1.7 of pyjwt (Please help!) #465

wants to merge 1 commit into from

Conversation

unmonoqueteclea
Copy link

@unmonoqueteclea unmonoqueteclea commented Oct 5, 2021

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 in pyjwt 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.

Copy link
Member

@Andrew-Chen-Wang Andrew-Chen-Wang left a 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
Copy link
Member

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
Copy link
Member

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')
Copy link
Member

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.

@unmonoqueteclea
Copy link
Author

@Andrew-Chen-Wang Closing this because allowing PyJWT<2 takes much more effort than
I thought and I don't think I am able to do it. I hope someone is able to do it

@Andrew-Chen-Wang Andrew-Chen-Wang changed the title Allow version 1.7 of pyjwt Allow version 1.7 of pyjwt (Please help!) Oct 24, 2021
@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Oct 24, 2021

@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.

@Andrew-Chen-Wang
Copy link
Member

Closing in favor of #536 I'm so sorry this took forever. I finally finished my exams 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants