More work on ldap auth, got memberOf working in the docker ldap test server, playing with config options and structures, #1450

This commit is contained in:
Torkel Ödegaard
2015-07-13 14:23:59 +02:00
parent a69086a718
commit bfe7b77313
9 changed files with 125 additions and 182 deletions
+2 -5
View File
@@ -118,9 +118,8 @@ var (
GoogleAnalyticsId string
// LDAP
LdapEnabled bool
LdapHosts []string
LdapBindPath string
LdapEnabled bool
LdapServers []*LdapServerConf
// SMTP email settings
Smtp SmtpSettings
@@ -419,8 +418,6 @@ func NewConfigContext(args *CommandLineArgs) {
ldapSec := Cfg.Section("auth.ldap")
LdapEnabled = ldapSec.Key("enabled").MustBool(false)
LdapHosts = ldapSec.Key("hosts").Strings(" ")
LdapBindPath = ldapSec.Key("bind_path").String()
readSessionConfig()
readSmtpSettings()
+14 -8
View File
@@ -1,19 +1,25 @@
package setting
type LdapFilterToOrg struct {
Filter string
OrgId int
OrgRole string
type LdapMemberToOrgRole struct {
LdapMemberPattern string
OrgId int
OrgRole string
}
type LdapSettings struct {
Enabled bool
Hosts []string
type LdapServerConf struct {
Host string
Port string
UseSSL bool
BindDN string
BindPassword string
AttrUsername string
AttrName string
AttrSurname string
AttrMail string
Filters []LdapFilterToOrg
AttrMemberOf string
SearchFilter []string
SearchBaseDNs []string
LdapMemberMap []LdapMemberToOrgRole
}