Skip to content

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

Closed
unmonoqueteclea wants to merge 1 commit intojazzband:masterfrom
unmonoqueteclea:master
Closed

Allow version 1.7 of pyjwt (Please help!)#465
unmonoqueteclea wants to merge 1 commit intojazzband:masterfrom
unmonoqueteclea:master

Conversation

@unmonoqueteclea
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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?



try:
# For jwt>=2.0
Copy link
Copy Markdown
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!

Comment thread tests/test_backends.py
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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