mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: add session expiry control flags (#5976)
Adds --session-duration which lets admins customize the default session expiration for browser sessions. Adds --disable-session-expiry-refresh which allows admins to prevent session expiry from being automatically bumped upon the API key being used.
This commit is contained in:
@ -486,7 +486,7 @@ func newConfig() *codersdk.DeploymentConfig {
|
||||
},
|
||||
MaxTokenLifetime: &codersdk.DeploymentConfigField[time.Duration]{
|
||||
Name: "Max Token Lifetime",
|
||||
Usage: "The maximum lifetime duration for any user creating a token.",
|
||||
Usage: "The maximum lifetime duration users can specify when creating an API token.",
|
||||
Flag: "max-token-lifetime",
|
||||
Default: 24 * 30 * time.Hour,
|
||||
},
|
||||
@ -538,6 +538,18 @@ func newConfig() *codersdk.DeploymentConfig {
|
||||
Flag: "disable-path-apps",
|
||||
Default: false,
|
||||
},
|
||||
SessionDuration: &codersdk.DeploymentConfigField[time.Duration]{
|
||||
Name: "Session Duration",
|
||||
Usage: "The token expiry duration for browser sessions. Sessions may last longer if they are actively making requests, but this functionality can be disabled via --disable-session-expiry-refresh.",
|
||||
Flag: "session-duration",
|
||||
Default: 24 * time.Hour,
|
||||
},
|
||||
DisableSessionExpiryRefresh: &codersdk.DeploymentConfigField[bool]{
|
||||
Name: "Disable Session Expiry Refresh",
|
||||
Usage: "Disable automatic session expiry bumping due to activity. This forces all sessions to become invalid after the session expiry duration has been reached.",
|
||||
Flag: "disable-session-expiry-refresh",
|
||||
Default: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user