From 3c3d6979bcd29ad0701111776693d852a3beaf49 Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Sun, 23 Aug 2020 15:11:14 -0700 Subject: [PATCH] internal/ldap: Improve search debugging --- internal/ldap/search.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ldap/search.go b/internal/ldap/search.go index 99e609d..48b36e5 100644 --- a/internal/ldap/search.go +++ b/internal/ldap/search.go @@ -1,6 +1,7 @@ package ldap import ( + "fmt" "context" "errors" "strconv" @@ -45,6 +46,8 @@ func (s *server) handleSearchEntities(w ldap.ResponseWriter, m *ldap.Message) { f := r.Filter().(message.FilterEqualityMatch) expr, err = entitySearchExprHelper(string(f.AttributeDesc()), "=", string(f.AssertionValue())) default: + s.l.Warn("Unsupported entity search filter", "type", fmt.Sprintf("%T", r.Filter())) + s.l.Debug("Unsupported search filter", "filter", r.FilterString()) err = errors.New("unsupported filter type") } if err != nil { @@ -144,6 +147,8 @@ func (s *server) handleSearchGroups(w ldap.ResponseWriter, m *ldap.Message) { f := r.Filter().(message.FilterEqualityMatch) expr, err = groupSearchExprHelper(string(f.AttributeDesc()), "=", string(f.AssertionValue())) default: + s.l.Warn("Unsupported group search filter", "type", fmt.Sprintf("%T", r.Filter())) + s.l.Debug("Unsupported search filter", "filter", r.FilterString()) err = errors.New("unsupported filter type") } if err != nil {