Auth: configure SSO settings reload interval from the ini file (#80290)
* configure sso reload interval from ini file * change section name to sso_settings
This commit is contained in:
@@ -252,7 +252,12 @@ func (s *SSOSettingsService) encryptSecrets(ctx context.Context, settings map[st
|
||||
}
|
||||
|
||||
func (s *SSOSettingsService) Run(ctx context.Context) error {
|
||||
ticker := time.NewTicker(1 * time.Minute)
|
||||
interval := s.cfg.SSOSettingsReloadInterval
|
||||
if interval == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(interval)
|
||||
|
||||
// start a background process for reloading the SSO settings for all providers at a fixed interval
|
||||
// it is useful for high availability setups running multiple Grafana instances
|
||||
|
||||
@@ -342,6 +342,9 @@ type Cfg struct {
|
||||
ExtendedJWTExpectIssuer string
|
||||
ExtendedJWTExpectAudience string
|
||||
|
||||
// SSO Settings Auth
|
||||
SSOSettingsReloadInterval time.Duration
|
||||
|
||||
// Dataproxy
|
||||
SendUserHeader bool
|
||||
DataProxyLogging bool
|
||||
@@ -1623,6 +1626,10 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) {
|
||||
|
||||
cfg.AuthProxyHeadersEncoded = authProxy.Key("headers_encoded").MustBool(false)
|
||||
|
||||
// SSO Settings
|
||||
ssoSettings := iniFile.Section("sso_settings")
|
||||
cfg.SSOSettingsReloadInterval = ssoSettings.Key("reload_interval").MustDuration(1 * time.Minute)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user