Skip to content

Commit

Permalink
Merge pull request #77 from ConductorOne/ggreer/missing-group
Browse files Browse the repository at this point in the history
Don't error if group doesn't exist.
  • Loading branch information
ggreer authored Oct 28, 2024
2 parents 5321dac + 30c15d4 commit 4cef9ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/connector/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,14 @@ func (g *groupResourceType) Grants(ctx context.Context, resource *v2.Resource, t
nil,
)
if err != nil {
err := fmt.Errorf("ldap-connector: failed to list group members: %w", err)
l.Error("ldap-connector: failed to list group members", zap.Error(err))
l.Error("ldap-connector: failed to list group members", zap.String("group_dn", resource.Id.Resource), zap.Error(err))

// Some LDAP servers lie.
if ldap3.IsErrorAnyOf(err, ldap3.LDAPResultNoSuchObject) {
return nil, "", nil, nil
}

err := fmt.Errorf("ldap-connector: failed to list group %s members: %w", resource.Id.Resource, err)
return nil, "", nil, err
}

Expand Down

0 comments on commit 4cef9ab

Please sign in to comment.