AuthN: Support reloading SSO config after the sso settings have changed (#80734)
* Add AuthNSvc reload handling * Working, need to add test * Remove commented out code * Add Reload implementation to connectors * Align and add tests, refactor * Add more tests, linting * Add extra checks + tests to oauth client * Clean up based on reviews * Move config instantiation into newSocialBase * Use specific error
This commit is contained in:
@@ -84,7 +84,7 @@ func (s *SSOSettingsStore) List(ctx context.Context) ([]*models.SSOSettings, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s *SSOSettingsStore) Upsert(ctx context.Context, settings models.SSOSettings) error {
|
||||
func (s *SSOSettingsStore) Upsert(ctx context.Context, settings *models.SSOSettings) error {
|
||||
if settings.Provider == "" {
|
||||
return ssosettings.ErrNotFound
|
||||
}
|
||||
@@ -110,13 +110,10 @@ func (s *SSOSettingsStore) Upsert(ctx context.Context, settings models.SSOSettin
|
||||
}
|
||||
_, err = sess.UseBool(isDeletedColumn).Update(updated, existing)
|
||||
} else {
|
||||
_, err = sess.Insert(&models.SSOSettings{
|
||||
ID: uuid.New().String(),
|
||||
Provider: settings.Provider,
|
||||
Settings: settings.Settings,
|
||||
Created: now,
|
||||
Updated: now,
|
||||
})
|
||||
settings.ID = uuid.New().String()
|
||||
settings.Created = now
|
||||
settings.Updated = now
|
||||
_, err = sess.Insert(settings)
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user