// HandleError suppresses member lookup errors caused by out-of-bounds queries, func (h *memberLookupOutOfBoundsSuppressor) HandleError(err error) (bool, error) { memberLookupError, isMemberLookupError := err.(*memberLookupError) if !isMemberLookupError { return false, nil } if ldaputil.IsQueryOutOfBoundsError(memberLookupError.causedBy) { fmt.Fprintf(h.err, "For group %q, ignoring member %q: %v\n", memberLookupError.ldapGroupUID, memberLookupError.ldapUserUID, memberLookupError.causedBy) return true, nil } return false, nil }
func (l *MemberBasedDetector) Exists(ldapGrouUID string) (bool, error) { members, err := l.memberExtractor.ExtractMembers(ldapGrouUID) if ldaputil.IsQueryOutOfBoundsError(err) || ldaputil.IsEntryNotFoundError(err) || ldaputil.IsNoSuchObjectError(err) { return false, nil } if err != nil { return false, err } if len(members) == 0 { return false, nil } return true, nil }
func (l *GroupBasedDetector) Exists(ldapGroupUID string) (bool, error) { group, err := l.groupGetter.GroupEntryFor(ldapGroupUID) if ldaputil.IsQueryOutOfBoundsError(err) || ldaputil.IsEntryNotFoundError(err) || ldaputil.IsNoSuchObjectError(err) { return false, nil } if err != nil { return false, err } if group == nil { return false, nil } return true, nil }