-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fixes #1193: deprecated JWT decode. #1194
Conversation
376db45
to
34dc327
Compare
@jensens thanks for creating this Pull Request and help improve Plone! To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass. Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:
With this simple comment all the jobs will be started automatically. Happy hacking! |
5e1a135
to
4d044a4
Compare
4d044a4
to
9a2ccf0
Compare
|
||
# recent pyjwt | ||
pyjwt = 2.1.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.
I would put a comment here to remove this pin after release Plone version with coredev PR.
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.
It is needed for Plone 5.2 - which is still supported with Py3 here at master.
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.
You won't update the version in the 5.2 branch of coredev? At least for Python 3?
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.
Well, with conditional version sections this would be technically possible.
Since the 8.x series is not part of the release of Plone 5.2 (see https://github.com/plone/buildout.coredev/blob/5.2/versions.cfg#L197 and https://github.com/plone/buildout.coredev/blob/5.2/sources.cfg#L118, it uses the 7.x) I do not think this is possible.
We could add a note to the README which versions/ preconditions are needed for use of the 8 series in Plone 5.2.
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.
Anyway, it's weird to say that version 8.x is compatible with Plone 5.2 and it will not be tested on coredev. If any unreleased changes in any package, break the version 8.x, we won't know about it until the Plone version is released.
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.
@jensens @mauritsvanrees I am wondering if we should defer this to the next major release of plone.restapi (9.x). Once plone.volto has seen a first release, we will need to move some things around (e.g. the block behavior needs to move from restapi to plone.volto). The plan is to have stuff ready for the conference, so it won't take so long. What do you think?
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.
It looks like the new code from this PR also works with the old PyJWT. At least the tests pass.
So I think we can include this code even in 7.x.x. Just don't touch setup.py
.
On PY3, token.decode("utf-8")
should still be done, but only if the token is bytes, which PyJWT 1.7.1 gives us.
So that is one option: be a bit smarter in the code so we can support both versions of PyJWT.
Other option is to only merge the current PR when plone.restapi
master only targets PY 3, which seems to be what Timo is saying.
I don't really mind either way.
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.
@jensens is there a way we can support both PyJWT versions as @mauritsvanrees suggests?
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 would still be good to have, fixing a minor pain point and getting rid of an old dependency version.
But this seems like the kind of change we could do in a Plone 6.0 beta.
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.
I rebased the branch.
@jenkins-plone-org please run jobs |
1855487
to
094db97
Compare
@jenkins-plone-org please run jobs |
Jenkins will always fail here. There no easy way to test a branch on buildout.coredev together with branch on a package. Except on an own branch of the branch of buildout.coredev - I did this here plone/buildout.coredev#737 |
094db97
to
968d314
Compare
Nope, won't work as well. |
- Document usage of version 8 with Plone 5.2. - Bumb version on feature level.
cc0c76e
to
4b0d5ac
Compare
Summary:
|
For me, it would be fine to let You changed the |
"Framework :: Plone :: Core", | ||
"Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", |
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.
@jensens Python 3.9 is not officially supported or tested with plone.restapi yet: https://github.com/plone/plone.restapi/blob/master/.github/workflows/tests.yml#L9
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.
It is tested in coredev.
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.
Yes, Python 3.9 must work for Plone 6, so running tests with it here is important. I added issue #1345 to not forget about it.
Otherwise the buildout fails since the ES6 merges yesterday. See [this GHA run](https://github.com/plone/plone.restapi/runs/5687219593?check_suite_focus=true#step:11:203).
Green now. |
I am tired of waiting on someone to either approve and merge this, or say what needs to change. |
Branch: refs/heads/master Date: 2022-04-19T17:46:53+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.restapi@8a3c019 Make the PAS plugin compatible with PyJWT 1 and 2. Takes code from plone/plone.restapi#1194 Fixes plone/plone.restapi#1193 Files changed: A news/1193.bugfix M setup.py M src/plone/restapi/pas/plugin.py Repository: plone.restapi Branch: refs/heads/master Date: 2022-04-22T11:34:51+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.restapi@30ec4d8 Merge pull request #1377 from plone/maurits-support-pyjwt-1-and-2 Make the PAS plugin compatible with PyJWT 1 and 2. Files changed: A news/1193.bugfix M setup.py M src/plone/restapi/pas/plugin.py
solved with bbb #1377 |
verify
as kwarg ofdecode
was already deprecated in PyJWT and was removed in 2.0. Uses nowoptions
style to pass this on.encode
returns a str (Py3!) which can not be decoded again.Note:
After merge, buildout.coredev needs to be updated.
I prepared an separate PR for this: plone/buildout.coredev#735
This is difficult to test with our current Jenkins setup.