-
Notifications
You must be signed in to change notification settings - Fork 367
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
Evict user from auth-cache on reset password #3407
Merged
idanovo
merged 11 commits into
master
from
3404-evict-user-from-auth-cache-on-reset-password
May 24, 2022
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1a30b6f
Evict user from auth-cache on reset password design
idanovo b4d0bcf
Update design/open/evict-user-from-auth-cache-on-reset-password.md
idanovo 35bd2cd
Update design/open/evict-user-from-auth-cache-on-reset-password.md
idanovo 9ddb9a7
Fixed tesxt
idanovo 4578540
Not using auth cache for email authentication
idanovo f6fcc28
Split authenticator to middleware and controller authenticators
idanovo 2e2c78f
Merge from master
idanovo a591e2a
Fix tests
idanovo 75a7b1c
Merge branch 'master' of https://github.com/treeverse/lakeFS into 340…
idanovo b578190
Removed unused method from cache interface
idanovo 44bc2a4
Moved design to accepted
idanovo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
design/open/evict-user-from-auth-cache-on-reset-password.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## The problem: | ||
When a user logs in to lakeFS we save their credentials in the auth-cache. | ||
This way, we avoid checking the usr credentials through the DB on each call the user makes. | ||
Currently, when users try to reset their password, their old password is still stored in the auth-cache, so they have to wait till it's evicted before they log in using the new password. | ||
|
||
|
||
## The suggested solution: | ||
The intuitive solution is just to evict the users from the auth cache when resetting their password. | ||
The problem with this solution is that we might not necessarily have a centralized cache, so we might need to evict the user for every auth cache he exists in. | ||
This is why the simpler solution here might be just to not use auth cache for email-password authentication. | ||
This way, we still won't need to authenticate when users use API calls that use access-key and secret for authentication and won't need to do the effort of evicting the user auth from all the auth cache instances. | ||
In case we decide to go with this solution, we have to enable email/password authentication only through the UI. | ||
Otherwise, user might try to use email/password authentication with our Python/Java client and won't have their credentials cached. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
And why is that so bad?
We already state in the docs that email+password should be used only for the UI.
If the user decides to use them for the API, an extra DB call will happen for every request - I think it will not cause a bottleneck. If it does in the future - we can solve it.
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.
Think of a Spark app reading from multiple workers. One user in one org makes a mistake, and all users get rate limited.
A shared auth server will have this problem in trumps, even more so if it fails to protect its DB access.