-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Compatibility changes for upcoming flask version 2.3 #493
Conversation
Created a copy of the deprecated JSONEncoder used by flask and use this as a default for PyJWT. This might break for some installations which further extended the flask provided JSONEncoder. To get this working again the extension must be adjusted such that a custom Encoder can be configured.
Thanks for looking into this!
Edit: Should have had my coffee. I didn't look at this closely enough to realize why we have this option, it's to bridge the gap between flask and pyjwt. |
Actually many other extensions will also run into problems: Flask-SQLALchemy (pallets-eco/flask-sqlalchemy#1068), Flask-Security / Flask-Security-Too (pallets/flask#4711) just to name the few I use most. Flask 2.3 will require quite a bit of changes in extensions as so many things will be removed / restructured / change. Maybe it's worth to keep an eye on other extensions and see how they handle the issues. |
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.
Added notes on some little canonicalization things
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.
Sorry this took me so long to look at, it's been a crazy week over here.
I'm right now working on this to fix the reviewd changes. Don't expect the optimal solution but I try to at least reach these goals:
I think this would be a good starting point to going further. |
Sounds great to me! I'll be around to help this get merged and a new release cut, and then digging into a more optimal solution can happen after. Thanks for your work on this!! 🥳 👍 |
I pushed some new code:
|
Damn, now you where faster than me... I was working on a simmilar idea, with the additional benefit that the new |
Sorry, didn't mean to step on your toes here, just had some time so figured I would take a stab at it! If you have a different idea please feel free to revert that last commit and push your stuff up! |
No problem at all! Nice to see other motivated devs working on this! Things in my latest commit:
If this sound reasonable I will push the changes. I have also updated |
That would be awesome! Thank you for the very thorough work you're doing on this!! 👍 |
Respect the json_provider_class when available and stay compatible with flask < 2.2. Extended tox configuration to also test with flask < 2.2.
Ok, I force-pushed my changes. Let's see what you think. |
Looks good. Left one small thought that I think is probably worth changing just to be safe, but overall I like the approach. Thanks! |
The code in question was a runtime check which is no longer necesary.
- Added tests to check the config.json_encoder - Don't create the JSONEncoder class on the fly, instead get the JSON provider class at runtime.
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.
LGTM ! Can't wait to get this release :D
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.
LGTM
Amazing ! Could you release this soon ? :) |
It's up as version |
This PR addresses the issues mentioned in #492