ldap: Implement missing methods for 3.4.5 go-ldap in ldap reconnect wrapper

This commit is contained in:
Ralf Haferkamp
2023-07-10 12:09:50 +02:00
committed by Ralf Haferkamp
parent 6989b17a13
commit b74eeed359

View File

@@ -277,7 +277,25 @@ func (c ConnWithReconnect) StartTLS(*tls.Config) error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
func (c ConnWithReconnect) Close() {}
// Close implements the ldap.Client interface
func (c ConnWithReconnect) Close() (err error) {
conn, err := c.GetConnection()
if err != nil {
return err
}
return conn.Close()
}
// GetLastError implements the ldap.Client interface
func (c ConnWithReconnect) GetLastError() error {
conn, err := c.GetConnection()
if err != nil {
return err
}
return conn.GetLastError()
}
func (c ConnWithReconnect) IsClosing() bool {
return false
@@ -332,3 +350,8 @@ func (c ConnWithReconnect) TLSConnectionState() (tls.ConnectionState, bool) {
func (c ConnWithReconnect) Unbind() error {
return ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}
// DirSync implements the ldap.Client interface
func (c ConnWithReconnect) DirSync(searchRequest *ldap.SearchRequest, flags, maxAttrCount int64, cookie []byte) (*ldap.SearchResult, error) {
return nil, ldap.NewError(ldap.LDAPResultNotSupported, fmt.Errorf("not implemented"))
}