Skip to content

[batch/auth] Making session timeout duration configurable #14810

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

grohli
Copy link
Contributor

@grohli grohli commented Feb 4, 2025

Change Description

Adding SESSION_MAX_AGE_SECS environment variable, allowing this session timeout window to be configurable in different deployments. This is set to 30 minutes by default.

Testing results:

  • Am able to retrieve user info from the /api/v1alpha/userinfo api call, am no longer able to after timeout;
  • Session timeout defaults properly in absence of a proper k8s secret/environment variable; and
  • Jobs are not cancelled as a result of session timeout.

Security Assessment

  • This change has a low security impact

Impact Description

Enables configuration of this timeout duration, however we already have had a notion of timing out sessions. Additionally, this will shorten our default timeout window from 30 days to 30 minutes.

(Reviewers: please confirm the security impact before approving)

@grohli grohli requested review from ehigham and cjllanwarne February 4, 2025 16:04
Copy link
Member

ehigham commented Feb 4, 2025

Not sure i particularly like the idea of an environment variable for this. Why did you opt for this solution over editing the existing configuration file?

@grohli
Copy link
Contributor Author

grohli commented Feb 4, 2025

Not sure i particularly like the idea of an environment variable for this. Why did you opt for this solution over editing the existing configuration file?

There's currently no existing config file for auth, but long-ish term we probably should have one. In any case, we grab the environment variable here in the same manner we do in other auth scripts (e.g. here).

Copy link
Member

ehigham commented Feb 4, 2025

makes sense. thanks for the explanation

Copy link
Member

@ehigham ehigham left a comment

Choose a reason for hiding this comment

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

approvedarthvader

@grohli grohli changed the title Making session timeout duration configurable [batch/auth] Making session timeout duration configurable Feb 4, 2025
Comment on lines 58 to 60
name: auth-oauth2-client-secret
key: sp_oauth_scope
optional: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tried setting this in a developer environment to see it working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, there's now a proper Kubernetes secret for this (see the auth-config portion of the current deployment.yaml). Also noted in the updated description

@cjllanwarne
Copy link
Collaborator

Mostly good, just want to see it working in a developer environment before giving the 👍

@grohli grohli requested a review from cjllanwarne May 5, 2025 16:20
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.

3 participants