-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Remove legacy session identifier support #3866
Conversation
redash/authentication/__init__.py
Outdated
user = models.User.get_by_id_and_org(user_id, org) | ||
if user.is_disabled or user.get_id() != user_id_with_identity: | ||
return None | ||
|
||
return user | ||
except models.NoResultFound: | ||
except (models.NoResultFound, Exception): |
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.
Maybe we should only catch SyntaxError
instead of Exception
here?
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 it could be either a ValueError
when user_id_with_identity
isn't hyphenated or a AttributeError
when user_id_with_identity
is an integer, so I thought I'd just catch all. I could wrap only line 47, which might make it more explanatory.
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.
My concern here is that it might swallow some unrelated exceptions and make debugging future issues harder. Aside from this there is not much harm in catching Exception
here.
👍 |
* remove legacy session identifier support * remove redundant test * redirect to login to support any invalid session identifiers * be more specific with caught errors
What type of PR is this? (check all applicable)
Description
Users who logged in prior to #3174 going live have their (integer) user_id as their session user identifier.
This no longer needs to be supported.
Related Tickets & Documents
#3174
Mobile & Desktop Screenshots/Recordings (if there are UI changes)