-
This commit is contained in:
@ -38,7 +38,7 @@ type TenantSettings struct {
|
||||
OAuth2Settings *OAuth2Settings `json:"oauth2_settings,omitempty"`
|
||||
|
||||
// Session settings
|
||||
SessionTimeout time.Duration `json:"session_timeout,omitempty"`
|
||||
SessionTimeout Duration `json:"session_timeout,omitempty"`
|
||||
MaxConcurrentSessions int `json:"max_concurrent_sessions,omitempty"`
|
||||
|
||||
// Security settings
|
||||
@ -47,8 +47,8 @@ type TenantSettings struct {
|
||||
PasswordPolicy *PasswordPolicy `json:"password_policy,omitempty"`
|
||||
|
||||
// Token settings
|
||||
DefaultTokenDuration time.Duration `json:"default_token_duration,omitempty"`
|
||||
MaxTokenDuration time.Duration `json:"max_token_duration,omitempty"`
|
||||
DefaultTokenDuration Duration `json:"default_token_duration,omitempty"`
|
||||
MaxTokenDuration Duration `json:"max_token_duration,omitempty"`
|
||||
|
||||
// Feature flags
|
||||
Features map[string]bool `json:"features,omitempty"`
|
||||
@ -83,7 +83,7 @@ type PasswordPolicy struct {
|
||||
RequireLowercase bool `json:"require_lowercase"`
|
||||
RequireNumbers bool `json:"require_numbers"`
|
||||
RequireSymbols bool `json:"require_symbols"`
|
||||
MaxAge time.Duration `json:"max_age,omitempty"`
|
||||
MaxAge Duration `json:"max_age,omitempty"`
|
||||
PreventReuse int `json:"prevent_reuse"` // Number of previous passwords to prevent reuse
|
||||
}
|
||||
|
||||
@ -225,8 +225,8 @@ func (t *Tenant) GetAuthProvider() string {
|
||||
|
||||
// GetSessionTimeout returns the session timeout for the tenant
|
||||
func (t *Tenant) GetSessionTimeout() time.Duration {
|
||||
if t.Settings.SessionTimeout > 0 {
|
||||
return t.Settings.SessionTimeout
|
||||
if t.Settings.SessionTimeout.Duration > 0 {
|
||||
return t.Settings.SessionTimeout.Duration
|
||||
}
|
||||
return 8 * time.Hour // default
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user