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:
@@ -105,7 +105,7 @@ func TestIntegrationUpsertSSOSettings(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := ssoSettingsStore.Upsert(context.Background(), settings)
|
||||
err := ssoSettingsStore.Upsert(context.Background(), &settings)
|
||||
require.NoError(t, err)
|
||||
|
||||
actual, err := getSSOSettingsByProvider(sqlStore, settings.Provider, false)
|
||||
@@ -143,7 +143,7 @@ func TestIntegrationUpsertSSOSettings(t *testing.T) {
|
||||
"client_secret": "this-is-a-new-secret",
|
||||
},
|
||||
}
|
||||
err = ssoSettingsStore.Upsert(context.Background(), newSettings)
|
||||
err = ssoSettingsStore.Upsert(context.Background(), &newSettings)
|
||||
require.NoError(t, err)
|
||||
|
||||
actual, err := getSSOSettingsByProvider(sqlStore, provider, false)
|
||||
@@ -181,7 +181,7 @@ func TestIntegrationUpsertSSOSettings(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err = ssoSettingsStore.Upsert(context.Background(), newSettings)
|
||||
err = ssoSettingsStore.Upsert(context.Background(), &newSettings)
|
||||
require.NoError(t, err)
|
||||
|
||||
actual, err := getSSOSettingsByProvider(sqlStore, provider, false)
|
||||
@@ -217,7 +217,7 @@ func TestIntegrationUpsertSSOSettings(t *testing.T) {
|
||||
"client_secret": "this-is-my-new-secret",
|
||||
},
|
||||
}
|
||||
err = ssoSettingsStore.Upsert(context.Background(), newSettings)
|
||||
err = ssoSettingsStore.Upsert(context.Background(), &newSettings)
|
||||
require.NoError(t, err)
|
||||
|
||||
actual, err := getSSOSettingsByProvider(sqlStore, providers[0], false)
|
||||
@@ -254,7 +254,7 @@ func TestIntegrationUpsertSSOSettings(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err = ssoSettingsStore.Upsert(context.Background(), settings)
|
||||
err = ssoSettingsStore.Upsert(context.Background(), &settings)
|
||||
require.Error(t, err)
|
||||
require.ErrorIs(t, err, ssosettings.ErrNotFound)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user