From 4a7dde5b9790405b29a6a1003d2b33e389b56b27 Mon Sep 17 00:00:00 2001 From: Misi Date: Thu, 8 Feb 2024 16:53:51 +0100 Subject: [PATCH] Chore: Remove unnecessary usage of DynamicSection from SocialService (#82139) Remove unnecessary usage of DynamicSection --- pkg/login/social/socialimpl/service.go | 5 ----- pkg/login/social/socialimpl/service_test.go | 9 --------- 2 files changed, 14 deletions(-) diff --git a/pkg/login/social/socialimpl/service.go b/pkg/login/social/socialimpl/service.go index b62201c3bd9..3dc66ff819e 100644 --- a/pkg/login/social/socialimpl/service.go +++ b/pkg/login/social/socialimpl/service.go @@ -84,11 +84,6 @@ func ProvideService(cfg *setting.Cfg, continue } - // Workaround for moving the SkipOrgRoleSync setting to the OAuthInfo struct - withOverrides := cfg.SectionWithEnvOverrides("auth." + name) - info.Enabled = withOverrides.Key("enabled").MustBool(false) - info.SkipOrgRoleSync = withOverrides.Key("skip_org_role_sync").MustBool(false) - if !info.Enabled { continue } diff --git a/pkg/login/social/socialimpl/service_test.go b/pkg/login/social/socialimpl/service_test.go index 9dc51e9448e..a1c703ea1ba 100644 --- a/pkg/login/social/socialimpl/service_test.go +++ b/pkg/login/social/socialimpl/service_test.go @@ -44,15 +44,6 @@ func TestSocialService_ProvideService(t *testing.T) { expectedSocialMapLength: 7, expectedGenericOAuthSkipOrgRoleSync: false, }, - { - name: "should load Enabled and SkipOrgRoleSync parameters from environment variables when ssoSettingsApi is disabled", - setup: func(t *testing.T, env *testEnv) { - t.Setenv("GF_AUTH_GENERIC_OAUTH_ENABLED", "true") - t.Setenv("GF_AUTH_GENERIC_OAUTH_SKIP_ORG_ROLE_SYNC", "true") - }, - expectedSocialMapLength: 2, - expectedGenericOAuthSkipOrgRoleSync: true, - }, } iniContent := ` [auth.azuread]