The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/setting/setting_anonymous.go

26 lines
841 B

package setting
type AnonymousSettings struct {
Enabled bool
OrgName string
OrgRole string
HideVersion bool
DeviceLimit int64
}
func (cfg *Cfg) readAnonymousSettings() {
anonSection := cfg.Raw.Section("auth.anonymous")
anonSettings := AnonymousSettings{}
anonSettings.Enabled = anonSection.Key("enabled").MustBool(false)
anonSettings.OrgName = valueAsString(anonSection, "org_name", "")
// Deprecated:
// only viewer role is supported
anonSettings.OrgRole = valueAsString(anonSection, "org_role", "")
if anonSettings.OrgRole != "Viewer" {
cfg.Logger.Warn("auth.anonymous.org_role is deprecated, only viewer role is supported")
}
anonSettings.HideVersion = anonSection.Key("hide_version").MustBool(false)
anonSettings.DeviceLimit = anonSection.Key("device_limit").MustInt64(0)
cfg.Anonymous = anonSettings
}