mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Merge pull request #15196 from sixeIa/fix-basedn-empty
Add SearchDN error, mark field as required in UI
This commit is contained in:
commit
3e502ec9a4
@ -53,6 +53,9 @@ var ErrInvalidFilter = errors.New("invalid filter syntax")
|
||||
// ErrEmptyBaseDN ...
|
||||
var ErrEmptyBaseDN = errors.New("empty base dn")
|
||||
|
||||
// ErrEmptySearchDN ...
|
||||
var ErrEmptySearchDN = errors.New("empty search dn")
|
||||
|
||||
// Session - define a LDAP session
|
||||
type Session struct {
|
||||
basicCfg models.LdapConf
|
||||
@ -125,7 +128,7 @@ func TestConfig(ldapConfig models.LdapConf) (bool, error) {
|
||||
defer ts.Close()
|
||||
|
||||
if ts.basicCfg.SearchDn == "" {
|
||||
return false, ErrEmptyBaseDN
|
||||
return false, ErrEmptySearchDN
|
||||
}
|
||||
if err := ts.Bind(ts.basicCfg.SearchDn, ts.basicCfg.SearchPassword); err != nil {
|
||||
if goldap.IsErrorWithCode(err, goldap.LDAPResultInvalidCredentials) {
|
||||
|
@ -61,7 +61,7 @@
|
||||
<clr-control-error>{{'TOOLTIP.ITEM_REQUIRED' | translate}}</clr-control-error>
|
||||
</clr-input-container>
|
||||
<clr-input-container>
|
||||
<label for="ldapSearchDN" >{{'CONFIG.LDAP.SEARCH_DN' | translate}}
|
||||
<label for="ldapSearchDN" class="required">{{'CONFIG.LDAP.SEARCH_DN' | translate}}
|
||||
<clr-tooltip>
|
||||
<clr-icon clrTooltipTrigger shape="info-circle" size="24"></clr-icon>
|
||||
<clr-tooltip-content clrPosition="top-right" clrSize="lg" *clrIfOpen>
|
||||
|
Loading…
Reference in New Issue
Block a user