-
Notifications
You must be signed in to change notification settings - Fork 504
Implement server-side session invalidation using token_invalid_before #1593
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
Closed
Oykunle
wants to merge
19
commits into
OpenEnergyDashboard:development
from
Oykunle:oed-session-invalidation-clean2
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
83a9a93
Implement server-side session invalidation using token_invalid_before
Oykunle 53b5fd8
Implement server-side session invalidation with token_invalid_before
Oykunle c5eb0f7
Address review comments: fix race condition, improve auth logic, and …
Oykunle 12f5b00
Address review comments for session invalidation auth and tests
Oykunle ec6dcd2
Restore non-root web container runtime user
Oykunle bd1e3a2
Remove unrelated Dockerfile change from session invalidation PR
Oykunle c50b6ef
Add explicit explanation for logout route authentication handling
Oykunle bfd6a48
Use generic authentication failure response in verification route
Oykunle 78c3d32
Remove testUser2 from common test setup
Oykunle 7e2a6a1
Create CSV test user locally in session invalidation tests
Oykunle c6a70cb
Use millisecond precision for token invalidation comparison
Oykunle faa7977
Update login route to /api/login/login across tests and API usage
Oykunle 0b70722
Fix session invalidation test setup
Oykunle 24e6a16
Update client login route to match /api/login/login
Oykunle 3e15866
Rename login route file to loginLogout
Oykunle 25ac170
Resolve merge conflicts with upstream/development and integrate sessi…
Oykunle 242472f
Remove unused import and clean up usersTest assertions
Oykunle c707bfc
Update session invalidation tests to use HTTP_CODES
Oykunle 5224d21
Merge remote-tracking branch 'origin/development' into pr/Oykunle/1593
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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 2 additions & 0 deletions
2
src/server/migrations/1.0.0-2.0.0/sql/users/add_token_invalid_before.sql
This file contains hidden or 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,2 @@ | ||
| ALTER TABLE users | ||
| ADD COLUMN IF NOT EXISTS token_invalid_before TIMESTAMP NOT NULL DEFAULT TIMESTAMP 'epoch'; |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
While I think I see the appeal of leaving the name as login so all the current routes work, I think making the actual server route file differ from the route name is confusing and prone to mistakes. The only other case of doing this is for readings where the actual name is used in the app.use(). I think this was an attempt to decouple the two names but it was not done in any consistent way. Something that can be fixed. For now, I think it should become loginLogout with all uses updated including app.use below.