Skip to content

fix(iam): return paginationToken from listPolicies - #206

Merged
designcode merged 1 commit into
mainfrom
fix/pagination-tokens-in-lists
Jul 24, 2026
Merged

fix(iam): return paginationToken from listPolicies#206
designcode merged 1 commit into
mainfrom
fix/pagination-tokens-in-lists

Conversation

@designcode

@designcode designcode commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

@tigrisdata/iam's listPolicies never returned a paginationToken, so tigris iam policies list could not page past the first result set — reported when 6 policies with --limit 3 yielded no page token, in both table and --json output.

The AWS-standard ListPolicies response nests IsTruncated and Marker inside ListPoliciesResult, but the code read them from the top level, so Marker was always undefined. This matches the already-correct listPoliciesForAccessKey (ListUserPolicies) handling.

Verification

Verified live: --limit 3 now returns a paginationToken, and paging with it fetches a genuinely different second page (0 overlap) plus a further token.

Audit

Swept every other list path (storage buckets/forks/objects/versions/snapshots/stats, iam access-keys, and all CLI list commands incl. --json/--xml) — no other pagination-token gaps found.

🤖 Generated with Claude Code


Note

Low Risk
Narrow response-parsing fix in IAM policy listing with no auth or data-mutation changes; behavior only affects multi-page policy lists.

Overview
Fixes listPolicies pagination so callers (e.g. tigris iam policies list) can page past the first result set.

The ListPolicies API nests IsTruncated and Marker under ListPoliciesResult, but the client typed and read them at the top level, so paginationToken was always missing. The response type and mapping now use ListPoliciesResult, and the next-page token is only set when IsTruncated is true—aligned with listPoliciesForAccessKey.

Reviewed by Cursor Bugbot for commit b2f0db0. Bugbot is set up for automated code reviews on this repo. Configure here.

The AWS-standard ListPolicies response nests IsTruncated and Marker
inside ListPoliciesResult, but they were read from the top level, so the
next-page token was always undefined — callers could never page past the
first result set. Read them from ListPoliciesResult, gated on IsTruncated,
matching the existing listPoliciesForAccessKey handling.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

Corrects IAM policy pagination by reading IsTruncated and Marker from ListPoliciesResult.

  • Returns the nested marker as paginationToken when additional results are available.
  • Adds a patch changeset for @tigrisdata/iam.

Confidence Score: 5/5

The PR appears safe to merge, with the focused pagination fix and package changeset aligned with existing IAM list behavior.

The implementation reads both pagination fields from the documented nested result, suppresses tokens when the response is not truncated, and preserves existing policy mapping behavior.

Important Files Changed

Filename Overview
packages/iam/src/lib/policy/list.ts Aligns the response type and pagination-token extraction with the nested AWS-style ListPoliciesResult response.
.changeset/iam-list-policies-pagination-token.md Adds the appropriate patch release note for the IAM pagination fix.

Reviews (1): Last reviewed commit: "fix(iam): return paginationToken from li..." | Re-trigger Greptile

@designcode
designcode merged commit e44ef8a into main Jul 24, 2026
3 checks passed
@designcode
designcode deleted the fix/pagination-tokens-in-lists branch July 24, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants