-
Notifications
You must be signed in to change notification settings - Fork 193
fix: make the session cookie last as long as Keycloak's #2135
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
fix: make the session cookie last as long as Keycloak's #2135
Conversation
WalkthroughUpdated session and token lifetimes: JWT default max age extended to 14 days; Keycloak realm settings adjusted to set ssoSessionIdleTimeout to 3 days and ssoSessionMaxLifespan to 14 days. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
StarpTech
left a comment
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.
LGTM
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
controlplane/src/core/crypto/jwt.ts(1 hunks)docker/keycloak/realm.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
helm/cosmo/templates/keycloak-realm.yml (1)
21-22: Parameterize SSO timeouts via Helm values (avoid magic numbers, ease customization)Hard-coding 259200 and 1209600 makes overrides harder. Suggest wiring these through chart values with sensible defaults.
Apply this diff here:
- "ssoSessionIdleTimeout": 259200, - "ssoSessionMaxLifespan": 1209600, + "ssoSessionIdleTimeout": {{ default 259200 .Values.global.keycloak.ssoSessionIdleTimeout | int }}, + "ssoSessionMaxLifespan": {{ default 1209600 .Values.global.keycloak.ssoSessionMaxLifespan | int }},And add to values.yaml (or document existing fields) to make the knobs visible:
global: keycloak: # Seconds. Defaults mirror current behavior: 3 days / 14 days ssoSessionIdleTimeout: 259200 ssoSessionMaxLifespan: 1209600I can follow up with a PR snippet updating values.yaml and the chart README if helpful.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
helm/cosmo/templates/keycloak-realm.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
helm/cosmo/templates/keycloak-realm.yml (1)
21-22: Session timeout settings are consistent across Helm and Docker realm definitions
- helm/cosmo/templates/keycloak-realm.yml and docker/keycloak/realm.json both use
• ssoSessionIdleTimeout = 259200 (3 days)
• ssoSessionMaxLifespan = 1209600 (14 days)- controlplane/src/core/crypto/jwt.ts sets DEFAULT_SESSION_MAX_AGE_SEC = 14 days, and auth-utils uses that for the cookie’s maxAge.
Please confirm whether the cookie should expire on Keycloak’s idle timeout (3 days) instead of its absolute max (14 days). If you want cookie expiry tied to idle, update DEFAULT_SESSION_MAX_AGE_SEC (or compute it from the idle timeout) accordingly.
Summary by CodeRabbit
Checklist