func (e *LDAPInterface) ExtractMembers(ldapGroupUID string) ([]*ldap.Entry, error) {
	group, err := e.GroupEntryFor(ldapGroupUID)
	if err != nil {
		return nil, err
	}
	var ldapMemberUIDs []string
	for _, attribute := range e.groupMembershipAttributes {
		ldapMemberUIDs = append(ldapMemberUIDs, group.GetAttributeValues(attribute)...)
	}
	members := []*ldap.Entry{}
	for _, ldapMemberUID := range ldapMemberUIDs {
		memberEntry, err := e.userEntryFor(ldapMemberUID)
		if err == nil {
			members = append(members, memberEntry)
			continue
		}
		if ldapquery.IsQueryOutOfBoundsError(err) {
			continue
		}
		err = syncerror.NewMemberLookupError(ldapGroupUID, ldapMemberUID, err)
		handled, fatalErr := e.errorHandler.HandleError(err)
		if fatalErr != nil {
			return nil, fatalErr
		}
		if !handled {
			return nil, err
		}
	}
	return members, nil
}
ExtractMembers returns the LDAP member entries for a group specified with a ldapGroupUID
package rfc2307
import (
	"fmt"
	"gopkg.in/ldap.v2"
	"k8s.io/apimachinery/pkg/util/sets"
	"github.com/openshift/library-go/pkg/security/ldapclient"
	ldapquery "github.com/openshift/library-go/pkg/security/ldapquery"
	"github.com/openshift/library-go/pkg/security/ldaputil"
	"github.com/redhat-cop/group-sync-operator/pkg/provider/ldap/helpers/groupdetector"
	"github.com/redhat-cop/group-sync-operator/pkg/provider/ldap/helpers/interfaces"
	"github.com/redhat-cop/group-sync-operator/pkg/provider/ldap/helpers/syncerror"
)
func NewLDAPInterface(clientConfig ldapclient.Config,
	groupQuery ldapquery.LDAPQueryOnAttribute,
	groupNameAttributes []string,
	groupMembershipAttributes []string,
	userQuery ldapquery.LDAPQueryOnAttribute,
	userNameAttributes []string,
	errorHandler syncerror.Handler) *LDAPInterface {
	return &LDAPInterface{
		clientConfig:              clientConfig,
		groupQuery:                groupQuery,
		groupNameAttributes:       groupNameAttributes,
		groupMembershipAttributes: groupMembershipAttributes,
		userQuery:                 userQuery,
		userNameAttributes:        userNameAttributes,
		cachedUsers:               map[string]*ldap.Entry{},
		cachedGroups:              map[string]*ldap.Entry{},
		errorHandler:              errorHandler,
	}
}
type LDAPInterface struct {
	clientConfig ldapclient.Config
	groupQuery ldapquery.LDAPQueryOnAttribute
	groupNameAttributes []string
	groupMembershipAttributes []string
	userQuery ldapquery.LDAPQueryOnAttribute
	userNameAttributes []string
	cachedGroups map[string]*ldap.Entry
	cachedUsers map[string]*ldap.Entry
	errorHandler syncerror.Handler
}
var _ interfaces.LDAPMemberExtractor = &LDAPInterface{}
var _ interfaces.LDAPGroupGetter = &LDAPInterface{}
var _ interfaces.LDAPGroupLister = &LDAPInterface{}