diff options
| author | Marin Ivanov <[email protected]> | 2019-02-13 07:20:14 +0200 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2019-02-13 07:26:13 +0200 |
| commit | a1a0a3aae7ef762250b9295985be1eee41d7a49e (patch) | |
| tree | 39accaebbd5c1fad072fc7ecb2360c0db6b21bef /server_bind.go | |
| parent | cb4f041b8be79b49eb046466ceb1bea9cfcaeb87 (diff) | |
Revert the simplification of Searcher and Binder interfaces
* Revert "Simplify sever search functions" commit 9402a7d580c2dd929c68cf8b3038a1e6496f607f.
* Revert "Simplify server bind functions" commit 82a8f44a2f4cf0686635d2a23ebb41a8f445194e.
* Fix tests
Diffstat (limited to 'server_bind.go')
| -rw-r--r-- | server_bind.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server_bind.go b/server_bind.go index c094b13..1684823 100644 --- a/server_bind.go +++ b/server_bind.go @@ -7,7 +7,7 @@ import ( "github.com/metala/ldap/internal/asn1-ber" ) -func HandleBindRequest(req *ber.Packet, fn BindFunc, conn net.Conn) (resultCode LDAPResultCode) { +func HandleBindRequest(req *ber.Packet, fns map[string]Binder, conn net.Conn) (resultCode LDAPResultCode) { defer func() { if r := recover(); r != nil { resultCode = LDAPResultOperationsError @@ -36,7 +36,12 @@ func HandleBindRequest(req *ber.Packet, fn BindFunc, conn net.Conn) (resultCode return LDAPResultInappropriateAuthentication case LDAPBindAuthSimple: if len(req.Children) == 3 { - resultCode, err := fn(bindDN, bindAuth.Data.String(), conn) + fnNames := []string{} + for k := range fns { + fnNames = append(fnNames, k) + } + fn := routeFunc(bindDN, fnNames) + resultCode, err := fns[fn].Bind(bindDN, bindAuth.Data.String(), conn) if err != nil { log.Printf("BindFn Error %s", err.Error()) return LDAPResultOperationsError |
