Skip to content

fix: rotate login sessions and stop revoked auth work - #19

Merged
linkdata merged 1 commit into
mainfrom
fix/7-session-lifecycle
Oct 5, 2026
Merged

linkdata merged 1 commit into
mainfrom
fix/7-session-lifecycle

Conversation

@linkdata

@linkdata linkdata commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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 ./... and go build ./...
  • golangci-lint run, staticcheck ./..., and gosec -quiet ./...
  • Clean gofmt and separate rendered godoc review

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

@linkdata
linkdata changed the base branch from fix/6-admin-email-policy to main October 5, 2026 10:08
@linkdata
linkdata force-pushed the fix/7-session-lifecycle branch from 7a5bd26 to f6674ec Compare October 5, 2026 13:10
@linkdata
linkdata merged commit 5f39a82 into main Oct 5, 2026
3 checks passed
@linkdata
linkdata deleted the fix/7-session-lifecycle branch October 5, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant