mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 20:32:24 +08:00
Password policy (#82268)
* add password service interface * add password service implementation * add tests for password service * add password service wiring * add feature toggle * Rework from service interface to static function * Replace previous password validations * Add codeowners to password service * add error logs * update config files --------- Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
@ -218,24 +218,25 @@ type Cfg struct {
|
||||
DefaultHomeDashboardPath string
|
||||
|
||||
// Auth
|
||||
LoginCookieName string
|
||||
LoginMaxInactiveLifetime time.Duration
|
||||
LoginMaxLifetime time.Duration
|
||||
TokenRotationIntervalMinutes int
|
||||
SigV4AuthEnabled bool
|
||||
SigV4VerboseLogging bool
|
||||
AzureAuthEnabled bool
|
||||
AzureSkipOrgRoleSync bool
|
||||
BasicAuthEnabled bool
|
||||
AdminUser string
|
||||
AdminPassword string
|
||||
DisableLogin bool
|
||||
AdminEmail string
|
||||
DisableLoginForm bool
|
||||
SignoutRedirectUrl string
|
||||
IDResponseHeaderEnabled bool
|
||||
IDResponseHeaderPrefix string
|
||||
IDResponseHeaderNamespaces map[string]struct{}
|
||||
LoginCookieName string
|
||||
LoginMaxInactiveLifetime time.Duration
|
||||
LoginMaxLifetime time.Duration
|
||||
TokenRotationIntervalMinutes int
|
||||
SigV4AuthEnabled bool
|
||||
SigV4VerboseLogging bool
|
||||
AzureAuthEnabled bool
|
||||
AzureSkipOrgRoleSync bool
|
||||
BasicAuthEnabled bool
|
||||
BasicAuthStrongPasswordPolicy bool
|
||||
AdminUser string
|
||||
AdminPassword string
|
||||
DisableLogin bool
|
||||
AdminEmail string
|
||||
DisableLoginForm bool
|
||||
SignoutRedirectUrl string
|
||||
IDResponseHeaderEnabled bool
|
||||
IDResponseHeaderPrefix string
|
||||
IDResponseHeaderNamespaces map[string]struct{}
|
||||
// Not documented & not supported
|
||||
// stand in until a more complete solution is implemented
|
||||
AuthConfigUIAdminAccess bool
|
||||
@ -1591,6 +1592,7 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) {
|
||||
// basic auth
|
||||
authBasic := iniFile.Section("auth.basic")
|
||||
cfg.BasicAuthEnabled = authBasic.Key("enabled").MustBool(true)
|
||||
cfg.BasicAuthStrongPasswordPolicy = authBasic.Key("password_policy").MustBool(false)
|
||||
|
||||
// Extended JWT auth
|
||||
authExtendedJWT := cfg.SectionWithEnvOverrides("auth.extended_jwt")
|
||||
|
Reference in New Issue
Block a user