Skip to content

Commit 1d6ac25

Browse files
committed
feat(acls): ListUserAccessLists rpc
1 parent e1bb7ba commit 1d6ac25

File tree

9 files changed

+534
-137
lines changed

9 files changed

+534
-137
lines changed

api/client/accesslist/accesslist.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,3 +475,22 @@ func (c *Client) GetSuggestedAccessLists(ctx context.Context, accessRequestID st
475475

476476
return accessLists, nil
477477
}
478+
479+
// ListUserAccessLists returns a paginated list of all access lists where the
480+
// user is explicitly an owner or member.
481+
func (c *Client) ListUserAccessLists(ctx context.Context, req *accesslistv1.ListUserAccessListsRequest) ([]*accesslist.AccessList, string, error) {
482+
resp, err := c.grpcClient.ListUserAccessLists(ctx, req)
483+
if err != nil {
484+
return nil, "", trace.Wrap(err)
485+
}
486+
487+
accessLists := make([]*accesslist.AccessList, len(resp.AccessLists))
488+
for i, accessList := range resp.AccessLists {
489+
accessLists[i], err = conv.FromProto(accessList, conv.WithOwnersIneligibleStatusField(accessList.GetSpec().GetOwners()))
490+
if err != nil {
491+
return nil, "", trace.Wrap(err)
492+
}
493+
}
494+
495+
return accessLists, resp.GetNextPageToken(), nil
496+
}

api/gen/proto/go/teleport/accesslist/v1/accesslist.pb.go

Lines changed: 104 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)