open-vault/sdk/helper/ldaputil/connection.go
Calvin Leung Huang 7009dcc432
sdk/ldaputil: add request_timeout configuration option (#7909)
* sdk/ldaputil: add request_timeout configuration option

* go mod vendor
2019-11-20 11:26:13 -08:00

21 lines
489 B
Go

package ldaputil
import (
"crypto/tls"
"time"
"github.com/go-ldap/ldap/v3"
)
// 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
SetTimeout(timeout time.Duration)
UnauthenticatedBind(username string) error
}