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

Remove legacy session identifier support #3866

Merged
merged 5 commits into from
Jun 3, 2019

Conversation

rauchy
Copy link
Contributor

@rauchy rauchy commented Jun 2, 2019

What type of PR is this? (check all applicable)

  • Other

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)

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):
Copy link
Member

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?

Copy link
Contributor Author

@rauchy rauchy Jun 2, 2019

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.

Copy link
Member

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.

@arikfr arikfr merged commit 05f6ef0 into master Jun 3, 2019
@arikfr arikfr deleted the remove-legacy-session-identifier-support branch June 3, 2019 19:18
@arikfr
Copy link
Member

arikfr commented Jun 3, 2019

👍

harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
* remove legacy session identifier support

* remove redundant test

* redirect to login to support any invalid session identifiers

* be more specific with caught errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants