mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Initial work on ldap support, #1450
This commit is contained in:
@@ -114,6 +114,10 @@ var (
|
||||
|
||||
ReportingEnabled bool
|
||||
GoogleAnalyticsId string
|
||||
|
||||
// LDAP
|
||||
LdapEnabled bool
|
||||
LdapUrls []string
|
||||
)
|
||||
|
||||
type CommandLineArgs struct {
|
||||
@@ -406,6 +410,10 @@ func NewConfigContext(args *CommandLineArgs) {
|
||||
ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
|
||||
GoogleAnalyticsId = analytics.Key("google_analytics_ua_id").String()
|
||||
|
||||
ldapSec := Cfg.Section("auth.ldap")
|
||||
LdapEnabled = ldapSec.Key("enabled").MustBool(false)
|
||||
LdapUrls = ldapSec.Key("urls").Strings(" ")
|
||||
|
||||
readSessionConfig()
|
||||
}
|
||||
|
||||
|
||||
19
pkg/setting/setting_ldap.go
Normal file
19
pkg/setting/setting_ldap.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package setting
|
||||
|
||||
type LdapFilterToOrg struct {
|
||||
Filter string
|
||||
OrgId int
|
||||
OrgRole string
|
||||
}
|
||||
|
||||
type LdapSettings struct {
|
||||
Enabled bool
|
||||
Hosts []string
|
||||
UseSSL bool
|
||||
BindDN string
|
||||
AttrUsername string
|
||||
AttrName string
|
||||
AttrSurname string
|
||||
AttrMail string
|
||||
Filters []LdapFilterToOrg
|
||||
}
|
||||
Reference in New Issue
Block a user