Added user profile page, prepped for TOTP 2fa
This commit is contained in:
@@ -18,10 +18,31 @@ type Group struct {
|
||||
Permissions []string `json:"permissions"`
|
||||
}
|
||||
|
||||
// SecuritySettings holds session and re-auth policy for the admin UI / auth middleware.
|
||||
type SecuritySettings struct {
|
||||
IdleTimeoutMinutes int `json:"idle_timeout_minutes"`
|
||||
SessionLifetimeHours int `json:"session_lifetime_hours"`
|
||||
ReauthSensitiveActions bool `json:"reauth_sensitive_actions"`
|
||||
ReauthGraceMinutes int `json:"reauth_grace_minutes"`
|
||||
TotpEnabled bool `json:"totp_enabled"`
|
||||
}
|
||||
|
||||
// DefaultSecuritySettings returns the built-in security defaults.
|
||||
func DefaultSecuritySettings() SecuritySettings {
|
||||
return SecuritySettings{
|
||||
IdleTimeoutMinutes: 30,
|
||||
SessionLifetimeHours: 24,
|
||||
ReauthSensitiveActions: false,
|
||||
ReauthGraceMinutes: 15,
|
||||
TotpEnabled: false,
|
||||
}
|
||||
}
|
||||
|
||||
// Settings holds plain (non-secret) base/CLI configuration.
|
||||
type Settings struct {
|
||||
LogLevel string `json:"log_level"`
|
||||
Groups []Group `json:"groups"`
|
||||
LogLevel string `json:"log_level"`
|
||||
Groups []Group `json:"groups"`
|
||||
Security SecuritySettings `json:"security"`
|
||||
}
|
||||
|
||||
// Secrets holds sensitive configuration encrypted at rest.
|
||||
|
||||
Reference in New Issue
Block a user