is_authenticated() etc. methods break with Flask-Login 0.3.0
Which changes them to properties and causes them to raise TypeErrors all over the place.
Relevant Flask-Login changelog: https://github.com/maxcountryman/flask-login/blob/5415c146df9dd560cc9475227c34866851532e9e/test_login.py
@mattupstate – happy to draft a PR here, but I think a design decision needs to be answered first:
- Specifically, do you want to have this coincide with a point release update that also requires
Flask-Login>=0.3.0, or whether you want to instead handle both the case whereis_anonymousis a property and a method?
I would simply change the source to use the property and release with a new Flask-Login dependency spec.
I made a PR based on the conversation let me know if we need to change something else to merge it.
https://github.com/mattupstate/flask-security/pull/417
+1 for creating a point release anchoring this change
Oh thanks @ialex – sorry I didn't get back to checking in on this until now. And appreciate the patch!
great, would be nice to merge the PR. cc @mattupstate
You could probably keep backwards compatibility by checking to see if is_authenticated is callable first, then returning the appropriate value based on that.
@dreucifer please see #393, which already does this check and will be compatible across versions. I like this solution for the moment because it allows users / developers to upgrade Flask Security without imposing other changes on them.
I think its nice to keep backward compatibility. +1 #393
I have this problem too.
I hate it when projects do that, messing with properties and predicates. Now whenever someone changes their code to reflect that but forget to bump the dependency, they have a security breach because they're checking the truthfulness of a method...
:+1: #393
#393 +1
@jonafato I'm going to leave it to you to handle this one. I'm getting married this weekend and I'll be off in Scotland until October 5th. I'm going to try and touch my computer as little as possible, but if you prepare a release, and I have a moment, I'll publish it to pypi.
+1 backwards compat!
Why is it a problem to break backward compatibility? And this issue shows, that better have a freezed versions of depenend packages and updates them accordingly
Short term solution, for those, who came from google search:
pip install Flask-Login==0.2.11
Hi,
Anyone know the status of this one? I did a quick patch but should have checked the issue first, as you guys already are miles ahead of me with the backward compatibility and the glaven! Thanks, and not submitting a PR because it sounds like there are better ones ahead of mine.
@citizen-stig I have this problem too. rollback the flask-login to 0.2.11 can solve the issue.
I understand the patch is ready. Is there an ETA for it to be merged?