Skip to content

Commit

Permalink
Feed the correct next page token to ListAllAccessListsMembers
Browse files Browse the repository at this point in the history
This PR fixes a typo when listing all members across all Access Lists
because when the number of members is bigger than the default page size
(1000), `nextToken` is not empty but we always pass the an empty value
to the `ListResources` call. This results in the callers to constantly
call `ListAllAccessListMembers` until they run out of memory.

Signed-off-by: Tiago Silva <[email protected]>
  • Loading branch information
tigrato authored and github-actions committed Apr 30, 2024
1 parent 7bd8976 commit 28b2d3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/services/simple/access_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (a *AccessListService) DeleteAllAccessListReviews(ctx context.Context) erro
}

// ListAllAccessListMembers returns a paginated list of all access list members for all access lists.
func (a *AccessListService) ListAllAccessListMembers(ctx context.Context, pageSize int, pageToken string) (members []*accesslist.AccessListMember, nextToken string, err error) {
members, nextToken, err = a.memberService.ListResources(ctx, pageSize, nextToken)
func (a *AccessListService) ListAllAccessListMembers(ctx context.Context, pageSize int, pageToken string) ([]*accesslist.AccessListMember, string, error) {
members, nextToken, err := a.memberService.ListResources(ctx, pageSize, pageToken)
return members, nextToken, trace.Wrap(err)
}

0 comments on commit 28b2d3d

Please sign in to comment.