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

compatibility with Werkzeug 2.2 and Flask 2.2 #691

Merged
merged 2 commits into from
Jul 25, 2022
Merged

Conversation

davidism
Copy link
Collaborator

@davidism davidism commented Jul 25, 2022

@coveralls
Copy link

coveralls commented Jul 25, 2022

Coverage Status

Coverage increased (+1.1%) to 99.81% when pulling 359fb00 on pallets-compat into 62c04f4 on main.

Fixes compatibility with Werkzeug 2.2. The change introduced by the
referenced PRs was incorrect, dynamic domains should be managed with
Flask's url callbacks instead of attempting to re-parse the rule.
Fixes compatibility with Flask 2.2
@davidism davidism merged commit b65e858 into main Jul 25, 2022
@davidism davidism deleted the pallets-compat branch July 25, 2022 14:43
@jwag956
Copy link

jwag956 commented Jul 26, 2022

I'd like to point out that this seriously breaks anyone who has a user_loader or request_loader - which I believe are public API entry points. While Flask 2.2 is going to deprecate using _app_ctx_stack - this change immediately forces anyone to either only support this latest version or do checks to see whether _login_user attribute is set.
Possibly an alternative change would be to ADD this new g._login_user and note in release notes that the other will be going away in the future....

In any case - thanks so much for keeping this package alive and up to date.

@davidism
Copy link
Collaborator Author

You should not be checking any internal values directly. This change should be invisible to the user. If you don't believe that's the case, open a discussion about that.

@potiuk
Copy link

potiuk commented Jul 26, 2022

Actually I have a strong case supporting it, This will break openid integration for users of Airlfow using google open id integration. It's not your fault of course here @davidism - it's the client's fault, but I just wanted you to know that it does affect your users (I am openinig discussion momentarily).

Repository owner locked as resolved and limited conversation to collaborators Jul 26, 2022
Repository owner unlocked this conversation Jul 26, 2022
@davidism
Copy link
Collaborator Author

  • This change is backwards compatible with existing versions of Flask and Werkzeug. user_loader, request_loader, and login_user continue to work as they always have.
  • In general, do not rely on internal implementation details, for Flask-Login or any other library. If you need functionality that is only available internally, make sure you really need that and can't rework your own code to use the library as expected, then open a feature request otherwise.
  • Use minimal, reproducible examples to demonstrate issues.

Repository owner locked as resolved and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants