Skip to content

Make login session lifetime configurable - #997

Merged
hartikainen merged 2 commits into
mainfrom
kristian/xmc-session-lifetime
Sep 28, 2026
Merged

hartikainen merged 2 commits into
mainfrom
kristian/xmc-session-lifetime

Conversation

@hartikainen

@hartikainen hartikainen commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Add SESSION_TTL and Helm's auth.sessionTtl so deployments can choose longer login sessions. Keep the default at 1h, validate the duration at startup, and use the same expiry for the token and cookie.

Closes #996.

(Coded with help from Astra.)

Add `SESSION_TTL` and Helm's `auth.sessionTtl` so deployments can choose
longer login sessions. Keep the default at 1h, validate the duration at
startup, and use the same expiry for the token and cookie.
@github-actions
github-actions Bot requested a review from pachopepe September 26, 2026 18:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a configurable login session lifetime (SESSION_TTL) across the Helm chart and Go backend, allowing the absolute lifetime of session tokens and browser cookies to be customized. It includes validation logic, updated unit tests, and a new Helm integration test. The review feedback recommends additionally setting the MaxAge attribute on the session cookie to prevent potential issues with client clock drift.

Comment thread pkg/auth/oauth2/handlers.go Resolved
pachopepe
pachopepe previously approved these changes Sep 28, 2026
@hartikainen
hartikainen added this pull request to the merge queue Sep 28, 2026
@hartikainen
hartikainen removed this pull request from the merge queue due to a manual request Sep 28, 2026
Set the session cookie’s `MaxAge` from the configured lifetime in whole
seconds. Verify it in the serialized cookie for every tested lifetime.

#997 (comment)
@hartikainen

hartikainen commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

@pachopepe thanks for the quick review/approval! I pushed a fixup for the handlers.go comment and made your review stale. Would you mind taking another look?

@evanjpw evanjpw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@hartikainen
hartikainen added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 35f474d Sep 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow deployments to configure login session lifetime

3 participants