From d6283ee9136ff270b7965ec13db9710fdb3d48c6 Mon Sep 17 00:00:00 2001
From: Alexis <60alexis@gmail.com>
Date: Thu, 1 Jul 2021 10:42:15 +0200
Subject: [PATCH] Add SearchDN error, mark field as required in UI
Signed-off-by: Alexis <60alexis@gmail.com>
---
src/pkg/ldap/ldap.go | 5 ++++-
.../left-side-nav/config/auth/config-auth.component.html | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/pkg/ldap/ldap.go b/src/pkg/ldap/ldap.go
index f8941e6ff..925167a9c 100644
--- a/src/pkg/ldap/ldap.go
+++ b/src/pkg/ldap/ldap.go
@@ -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) {
diff --git a/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html
index 60b269741..16a2ef0a9 100644
--- a/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html
+++ b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html
@@ -61,7 +61,7 @@
{{'TOOLTIP.ITEM_REQUIRED' | translate}}
-