flask-security icon indicating copy to clipboard operation
flask-security copied to clipboard

is_authenticated() etc. methods break with Flask-Login 0.3.0

Open boydgreenfield opened this issue 11 years ago • 26 comments

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

boydgreenfield avatar Sep 10 '15 21:09 boydgreenfield

@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 where is_anonymous is a property and a method?

boydgreenfield avatar Sep 10 '15 21:09 boydgreenfield

I would simply change the source to use the property and release with a new Flask-Login dependency spec.

mattupstate avatar Sep 10 '15 21:09 mattupstate

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

ialex avatar Sep 11 '15 15:09 ialex

+1 for creating a point release anchoring this change

vmalloc avatar Sep 11 '15 19:09 vmalloc

Oh thanks @ialex – sorry I didn't get back to checking in on this until now. And appreciate the patch!

boydgreenfield avatar Sep 16 '15 00:09 boydgreenfield

great, would be nice to merge the PR. cc @mattupstate

ialex avatar Sep 16 '15 00:09 ialex

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 avatar Sep 16 '15 20:09 dreucifer

@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.

jonafato avatar Sep 16 '15 20:09 jonafato

I think its nice to keep backward compatibility. +1 #393

ialex avatar Sep 17 '15 00:09 ialex

I have this problem too.

drsounds avatar Sep 17 '15 12:09 drsounds

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...

vmalloc avatar Sep 17 '15 12:09 vmalloc

:+1: #393

taliastocks avatar Sep 17 '15 19:09 taliastocks

#393 +1

luckenbach avatar Sep 17 '15 22:09 luckenbach

@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.

mattupstate avatar Sep 17 '15 23:09 mattupstate

+1 backwards compat!

mafrosis avatar Sep 21 '15 10:09 mafrosis

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

citizen-stig avatar Sep 21 '15 15:09 citizen-stig

Short term solution, for those, who came from google search: pip install Flask-Login==0.2.11

citizen-stig avatar Sep 21 '15 16:09 citizen-stig

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.

JohnLockwood avatar Sep 24 '15 14:09 JohnLockwood

@citizen-stig I have this problem too. rollback the flask-login to 0.2.11 can solve the issue.

elvisw avatar Sep 26 '15 09:09 elvisw

I understand the patch is ready. Is there an ETA for it to be merged?

velochy avatar Oct 07 '15 08:10 velochy