mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-28 22:35:43 +01:00
parent
a6a4a1fc18
commit
84509fbb3e
@ -18,11 +18,11 @@ package models
|
||||
// LdapConf holds information about repository that accessed most
|
||||
type LdapConf struct {
|
||||
LdapURL string `json:"ldap_url"`
|
||||
LdapSearchDn string `json:"ldap_searchdn"`
|
||||
LdapSearchPwd string `json:"ldap_search_pwd"`
|
||||
LdapBaseDn string `json:"ldap_basedn"`
|
||||
LdapSearchDn string `json:"ldap_search_dn"`
|
||||
LdapSearchPassword string `json:"ldap_search_password"`
|
||||
LdapBaseDn string `json:"ldap_base_dn"`
|
||||
LdapFilter string `json:"ldap_filter"`
|
||||
LdapUID string `json:"ldap_uid"`
|
||||
LdapScope int `json:"ldap_scope"`
|
||||
LdapConnectTimeout int `json:"ldap_connect_timeout"`
|
||||
LdapConnectionTimeout int `json:"ldap_connection_timeout"`
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ func validateLdapReq(ldapConfs models.LdapConf) error {
|
||||
}
|
||||
log.Debug("ldapURL:", ldapURL)
|
||||
|
||||
ldapConnectTimeout := ldapConfs.LdapConnectTimeout
|
||||
log.Debug("ldapConnectTimeout:", ldapConnectTimeout)
|
||||
ldapConnectionTimeout := ldapConfs.LdapConnectionTimeout
|
||||
log.Debug("ldapConnectionTimeout:", ldapConnectionTimeout)
|
||||
|
||||
return nil
|
||||
|
||||
@ -128,8 +128,8 @@ func connectTest(ldapConfs models.LdapConf) error {
|
||||
}
|
||||
|
||||
// Sets a Dial Timeout for LDAP
|
||||
connectTimeout := ldapConfs.LdapConnectTimeout
|
||||
goldap.DefaultTimeout = time.Duration(connectTimeout) * time.Second
|
||||
connectionTimeout := ldapConfs.LdapConnectionTimeout
|
||||
goldap.DefaultTimeout = time.Duration(connectionTimeout) * time.Second
|
||||
|
||||
switch protocol {
|
||||
case "ldap":
|
||||
@ -146,8 +146,8 @@ func connectTest(ldapConfs models.LdapConf) error {
|
||||
ldapSearchDn := ldapConfs.LdapSearchDn
|
||||
if ldapSearchDn != "" {
|
||||
log.Debug("Search DN: ", ldapSearchDn)
|
||||
ldapSearchPwd := ldapConfs.LdapSearchPwd
|
||||
err = ldap.Bind(ldapSearchDn, ldapSearchPwd)
|
||||
ldapSearchPassword := ldapConfs.LdapSearchPassword
|
||||
err = ldap.Bind(ldapSearchDn, ldapSearchPassword)
|
||||
if err != nil {
|
||||
log.Debug("Bind search dn error", err)
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user