-
Notifications
You must be signed in to change notification settings - Fork 846
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
[auth] Fix session token refresh #2474
Conversation
Signed-off-by: Seltyk <whhacker.dcx@gmail.com>
- error states should not HTTP return 200, they should always be 4xx - "dictionairy" typo Signed-off-by: Seltyk <whhacker.dcx@gmail.com>
Actually, I misunderstood the changes made here. Reference for this behavior can be found here: https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.filter |
At a glance, the
There were two EDIT: there is already a bug report |
See chaoss#2474 (comment) Signed-off-by: Seltyk <whhacker.dcx@gmail.com>
"It won't be inexcept... unexcept... it won't throw an exception" --Ulincsys Signed-off-by: Seltyk <whhacker.dcx@gmail.com>
Description
Refreshing session tokens first loads the authenticated client application from a SQL query, then verifies it against the user's browser session, and finally refreshes the token. The verification step uses a simple inequality check between two
ClientApplication
objects. Because this class does not have a definition for (in)equality (i.e. the__eq__
and__ne__
methods are not implemented), that inequality only checks the objects' pointers/addresses*, which is guaranteed to fail. Thankfully, theClientApplication
class has anid
field which matches the primary key in the associated database row. Comparing the underlying hex string values should make correct equality checks. This PR's main change is a simple implementation of__eq__
forClientApplication
as described. Because__ne__
is not implemented, inequality defers to this method and inverts the output, so both==
and!=
are well-defined.*I presume, based on zero evidence
This request also makes some nitpick changes, listed here:
/^\s+$/
value == False
andvalue == True
are replaced (resolving the last lint)Notes for Reviewers
Signed commits