From 2b8ce28a831454d3408202d7b3606fdd1b0b4718 Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Sat, 22 Aug 2020 20:50:38 -0700 Subject: [PATCH] internal/ldap: Remove unused search function --- internal/ldap/ldap.go | 5 ----- internal/ldap/search.go | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/internal/ldap/ldap.go b/internal/ldap/ldap.go index 3fca128..deed242 100644 --- a/internal/ldap/ldap.go +++ b/internal/ldap/ldap.go @@ -28,11 +28,6 @@ func New(l hclog.Logger, nacl naClient) *server { Filter("(objectclass=*)"). Label("Search - ROOT DSE") - routes.Search(x.handleSearchMyCompany). - BaseDn("o=My Company, c=US"). - Scope(ldap.SearchRequestScopeBaseObject). - Label("Search - Compagny Root") - routes.Search(x.handleSearch).Label("Search - Generic") x.Handle(routes) diff --git a/internal/ldap/search.go b/internal/ldap/search.go index fbddf5e..e64d32f 100644 --- a/internal/ldap/search.go +++ b/internal/ldap/search.go @@ -25,18 +25,6 @@ func (s *server) handleSearchDSE(w ldap.ResponseWriter, m *ldap.Message) { w.Write(res) } -func (s *server) handleSearchMyCompany(w ldap.ResponseWriter, m *ldap.Message) { - r := m.GetSearchRequest() - log.Printf("handleSearchMyCompany - Request BaseDn=%s", r.BaseObject()) - - e := ldap.NewSearchResultEntry(string(r.BaseObject())) - e.AddAttribute("objectClass", "top", "organizationalUnit") - w.Write(e) - - res := ldap.NewSearchResultDoneResponse(ldap.LDAPResultSuccess) - w.Write(res) -} - func (s *server) handleSearch(w ldap.ResponseWriter, m *ldap.Message) { r := m.GetSearchRequest() log.Printf("Request BaseDn=%s", r.BaseObject())