-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: Don't warn about expected user changes in safe-sessions #28983
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
Conversation
This adds a test around what actually happens when an unexpected user-change happens.
This is intended to silence a rare false positive that seems to happen when someone logs in on a browser that already has an active session for another user. We believe there should be no further positives once this case is handled. - login and logout views annotate the response to indicate the session user should be changing between the request and response phases - safe-sessions middleware skips the verify-user check when this annotation is present ref: ARCHBOM-1878
a9c1702 to
484b1d9
Compare
| # page is used during an active session. | ||
| # | ||
| # The relevant views set a flag to indicate the exemption. | ||
| if getattr(response, 'safe_sessions_expected_user_change', None): |
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.
This just checks if it is present, like a flag. I was thinking of actually using the new_user_id present in the dict to validate that it matches up, which would of course add a different thing we might alert on...
(and interpolate the actual user IDs rather than hardcoding)
|
Your PR has finished running tests. There were no failures. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
Description
This is intended to silence a rare false positive that seems to happen when someone logs in on a browser that already has an active session for another user. We believe there should be no further positives once this case is handled.
Also improve tests and docs and remove an old workaround for the logout case.
Affected roles
LMS operators.
Supporting information
Ticket: ARCHBOM-1878
Testing instructions
Deadline
None