-
Notifications
You must be signed in to change notification settings - Fork 458
Unify handling of the current user of a request #4803
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
8f1da08
to
ed3da3f
Compare
- database: prevent rollbacks - test client: run each request in a separate app context - add `make_test_client` fixture to create new clients
In that case the original exception is likely more relevant so we avoid re-raising the authentication error but rather silently discard the user that failed to authenticate.
ed3da3f
to
3d8d787
Compare
We keep accepting the old links for the dashboard ical feed but no longer generate such URLs.
We do not need to encode the data in the token, a simple signature is actually enough since the user id is prepended to the signature part of the token Also use sha256 instead of sha1 for the HMAC signature. While SHA1 is still fine for HMAC purposes, using a stronger algorithm doesn't have any disadvantages and the tokens are still reasonably short.
Happened if someone had no title
To be removed when cc2cab2 gets reverted (or earlier if we can ditch tokens-in-querystring before the implicit flow itself)
The CSRF checks no longer need to be disabled manually because any oauth-authenticated request is no longer subject to CSRF checks.
We always put a user id in that url, and accessing it without one actually failed with a KeyError
Looks like we don't need it in the end...
The oauth RFCs actually specify statuscodes, so replacing everything with 400 is ugly
11fd0dc
to
bb9eba3
Compare
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.
Nice, I like the way this is heading 👍
For future reference, we talked about the possibility of keeping the simple assignment session.user =
instead of the setter, but that behaviour is only meant to be restored later when session.user
is replaced and setting and reading to the exact same thing.
My approach is to first use the slightly ugly solution where
session.user
returns the current user, and then later (in a separate PR) replacesession.user
with something else.