-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cycle session ID on login #2813
Conversation
fb59be6
to
6a85ed6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2813 +/- ##
==========================================
+ Coverage 57.10% 57.14% +0.03%
==========================================
Files 567 567
Lines 41275 41275
==========================================
+ Hits 23570 23585 +15
+ Misses 17705 17690 -15 ☔ View full report in Codecov by Sentry. |
f99a74c
to
7737eab
Compare
9c07866
to
d4916f8
Compare
The codecov complaints are irrelevant for this pr |
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.
Looks great to me!
Just naming nitpicks, and one potential corner case for cycling a session id.
Does not do antyhing for logging out(i.e. removing account) just when changing from either no account to an account or from one account to another
97c62c4
to
fd4883e
Compare
this func is imported alot of places, makes no sense for this to be marked as private
have to mock away the cycle_key thingy else existing tests fail. Will probably need separate integration tests to test session ID cycling
Avoids session id changing on every request. session will still be cycled on login by the functions that directly handle login. ensure_account either just sets the request.account field to the match the already logged in user, or sets the account to be the anonymous user. Neither should trigger a session_id.
got some issues testing session stuff when the client was shared amongst all tests, maybe it got old or something as well. Getting a fresh client for each test was a lot better
Co-authored-by: Morten Brekkevold <[email protected]>
Co-authored-by: Morten Brekkevold <[email protected]>
fd4883e
to
19c5d84
Compare
Quality Gate passedIssues Measures |
Rebased on master to get in #2835 |
For #2804 (might not solve it fully depending on how many changes to session id we want to do)
Cycles session ID on login. Or more generally, every time a different user is made into the active account for the session, so this includes the sudo/desudo functions where the logged in account is changed.
Had some issues testing against sessions with a session scoped
client
fixture. Changing this tofunction
scoped and ensuring I get a fresh client for each test was a lot better