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:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user