2018-05-10 21:12:42 +00:00
|
|
|
package ldaputil
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/tls"
|
2019-11-20 19:26:13 +00:00
|
|
|
"time"
|
2018-05-10 21:12:42 +00:00
|
|
|
|
2019-11-08 16:18:36 +00:00
|
|
|
"github.com/go-ldap/ldap/v3"
|
2018-05-10 21:12:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Connection provides the functionality of an LDAP connection,
|
|
|
|
// but through an interface.
|
|
|
|
type Connection interface {
|
|
|
|
Bind(username, password string) error
|
|
|
|
Close()
|
|
|
|
Modify(modifyRequest *ldap.ModifyRequest) error
|
|
|
|
Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
|
|
|
|
StartTLS(config *tls.Config) error
|
2019-11-20 19:26:13 +00:00
|
|
|
SetTimeout(timeout time.Duration)
|
2018-05-10 21:12:42 +00:00
|
|
|
UnauthenticatedBind(username string) error
|
|
|
|
}
|