mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Chore: Remove unnecessary usage of DynamicSection from SocialService (#82139)
Remove unnecessary usage of DynamicSection
This commit is contained in:
parent
36a1f28086
commit
4a7dde5b97
@ -84,11 +84,6 @@ func ProvideService(cfg *setting.Cfg,
|
|||||||
continue
|
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 {
|
if !info.Enabled {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -44,15 +44,6 @@ func TestSocialService_ProvideService(t *testing.T) {
|
|||||||
expectedSocialMapLength: 7,
|
expectedSocialMapLength: 7,
|
||||||
expectedGenericOAuthSkipOrgRoleSync: false,
|
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 := `
|
iniContent := `
|
||||||
[auth.azuread]
|
[auth.azuread]
|
||||||
|
Loading…
Reference in New Issue
Block a user