Repository navigation
fix: rotate login sessions and stop revoked auth work - #19
Merged
Merged
Conversation
linkdata
force-pushed
the
fix/7-session-lifecycle
branch
from
October 5, 2026 13:10
7a5bd26 to
f6674ec
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Successful OIDC login rotates the JaWS session after token and nonce verification and UserInfo preparation. The return target survives rotation; pre-login application data does not. Rotation requires a spare session slot. If capacity is unavailable, the default response is 503 while existing authentication and its refresh timer are preserved; the user must restart login.
Refresh commits and logout serialize timer checks, auth writes, and timer replacement/removal. Closed or expired sessions discard auth and timers at the next scheduled refresh. Logout, expired auth, and loss of admin access cancel live JaWS requests. Demoted users remain authenticated for ordinary pages; anonymous pages stay open. Protected handlers recheck authorization after rendering to catch requests attached during a concurrent revocation. Repeated login emits cleanup for the retired authenticated session.
The simplification pass removes the always-true logout flag and the wrapper's redundant handler variable. Admin revocation shares the normal session policy, including verified-email requirements and already-parsed addresses. UserInfo is prepared before rotation so provider latency cannot consume the replacement session's idle lifetime. A failed initial auth store does not emit a logout event for an unauthenticated session.
README and API comments describe capacity, discarded application data, lifecycle callbacks, and HTTP logout redirects. The branch is restacked on main after PRs #16, #17, and #18, preserving the exact tested file tree.
Validation from each Go module root:
go generate ./...go test -race ./...(including demo and Keycloak integration tests)go vet ./...andgo build ./...golangci-lint run,staticcheck ./..., andgosec -quiet ./...Regression coverage includes strict admin revocation, quoted addresses, slow UserInfo before rotation, capacity failure, logout during claim preparation, closed sessions, and live-request cancellation. GitHub CI also exercises Docker bridge networking.
Closes #7
Closes #8
Closes #9
Closes #10