File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ func IsProviderEnabled(cfg *setting.Cfg, authModule string) bool {
133133 case GithubAuthModule :
134134 return cfg .GitHubAuthEnabled
135135 case GrafanaComAuthModule :
136- return cfg .GrafanaComAuthEnabled
136+ return cfg .GrafanaComAuthEnabled || cfg . GrafanaNetAuthEnabled
137137 case GenericOAuthModule :
138138 return cfg .GenericOAuthAuthEnabled
139139 }
Original file line number Diff line number Diff line change @@ -494,6 +494,9 @@ type Cfg struct {
494494 // skip the org roles coming from GrafanaCom
495495 GrafanaComSkipOrgRoleSync bool
496496
497+ // Grafana.com Auth enabled through [auth.grafananet] config section
498+ GrafanaNetAuthEnabled bool
499+
497500 // Geomap base layer config
498501 GeomapDefaultBaseLayerConfig map [string ]interface {}
499502 GeomapEnableCustomBaseLayers bool
@@ -1452,6 +1455,11 @@ func readAuthGrafanaComSettings(cfg *Cfg) {
14521455 cfg .GrafanaComSkipOrgRoleSync = sec .Key ("skip_org_role_sync" ).MustBool (false )
14531456}
14541457
1458+ func readAuthGrafanaNetSettings (cfg * Cfg ) {
1459+ sec := cfg .SectionWithEnvOverrides ("auth.grafananet" )
1460+ cfg .GrafanaNetAuthEnabled = sec .Key ("enabled" ).MustBool (false )
1461+ }
1462+
14551463func readAuthGithubSettings (cfg * Cfg ) {
14561464 sec := cfg .SectionWithEnvOverrides ("auth.github" )
14571465 cfg .GitHubAuthEnabled = sec .Key ("enabled" ).MustBool (false )
@@ -1559,6 +1567,7 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) {
15591567
15601568 // GrafanaCom
15611569 readAuthGrafanaComSettings (cfg )
1570+ readAuthGrafanaNetSettings (cfg )
15621571
15631572 // Github
15641573 readAuthGithubSettings (cfg )
You can’t perform that action at this time.
0 commit comments