internal/ldap: Remove unused search function
This commit is contained in:
parent
83e78da739
commit
2b8ce28a83
|
@ -28,11 +28,6 @@ func New(l hclog.Logger, nacl naClient) *server {
|
||||||
Filter("(objectclass=*)").
|
Filter("(objectclass=*)").
|
||||||
Label("Search - ROOT DSE")
|
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")
|
routes.Search(x.handleSearch).Label("Search - Generic")
|
||||||
|
|
||||||
x.Handle(routes)
|
x.Handle(routes)
|
||||||
|
|
|
@ -25,18 +25,6 @@ func (s *server) handleSearchDSE(w ldap.ResponseWriter, m *ldap.Message) {
|
||||||
w.Write(res)
|
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) {
|
func (s *server) handleSearch(w ldap.ResponseWriter, m *ldap.Message) {
|
||||||
r := m.GetSearchRequest()
|
r := m.GetSearchRequest()
|
||||||
log.Printf("Request BaseDn=%s", r.BaseObject())
|
log.Printf("Request BaseDn=%s", r.BaseObject())
|
||||||
|
|
Loading…
Reference in a new issue