feat: add continuation_token to ListObjects request and response
Add continuation_token field to enable resumable pagination for the ListObjects API. This allows clients to retrieve all accessible objects even when results are truncated due to deadline or max results limits.
Changes:
- ListObjectsRequest: add continuation_token field (field 9)
- ListObjectsResponse: add continuation_token field (field 2)
- Regenerate Go code and OpenAPI docs
This change works in conjunction with server-side changes in openfga/openfga that implement the pagination logic using gzip-compressed tokens containing previously returned object IDs for deduplication.
Relates to: openfga/openfga#2828
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
- [x] I have clicked on "allow edits by maintainers".
- [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
- [x] The correct base branch is being used, if not
main - [ ] I have added tests to validate that the change in functionality is working as expected
Summary by CodeRabbit
Release Notes
- New Features
- Added pagination continuation support for list operations. API responses now include continuation tokens that enable clients to resume paginated results from previous calls. Tokens are opaque strings that remain empty when all results have been returned, allowing efficient iteration through large datasets.
βοΈ Tip: You can customize this high-level summary in your review settings.
- :x: - login: @KTS-o7 / name: Krishnatejaswi S . The commit (ca3199bbcaf69c349a7a28a8fde87eb061ebdc04) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.
Walkthrough
Pagination continuation support has been added to the OpenFGA service by introducing continuation_token fields to ListObjectsRequest and ListObjectsResponse messages in the proto definition. Corresponding OpenAPI/Swagger documentation and validation file entries have been updated to reflect these changes.
Changes
| Cohort / File(s) | Summary |
|---|---|
Proto Service Definition openfga/v1/openfga_service.proto |
Added continuation_token (string, field 9) to ListObjectsRequest and continuation_token (string, field 2) to ListObjectsResponse with json_name annotations and OpenAPI descriptions for pagination support |
OpenAPI/Swagger Documentation docs/openapiv2/apidocs.swagger.json |
Added continuation_token property (type: string) to ListStoresResponse, ListObjectsResponse, and the POST /stores/{store_id}/list-objects request body schema to document pagination token support |
Proto Validation proto/openfga/v1/openfga_service.pb.validate.go |
Added documentation comments noting no validation rules for continuation_token in ListObjectsRequest.validate and ListObjectsResponse.validate |
Estimated code review effort
π― 2 (Simple) | β±οΈ ~8 minutes
- Homogeneous changes: same field addition (continuation_token) repeated across request/response message definitions
- No logic or control flow modifications; purely data model additions
- OpenAPI documentation changes are straightforward mirrors of proto definitions
- Validation file updates are comment-only additions with no functional impact
Possibly related issues
- openfga/openfga#2828: Directly addresses pagination support by adding continuation_token fields to ListObjects request/response protobufs and documentation, matching the objectives of this PR exactly.
Pre-merge checks and finishing touches
β Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The title accurately describes the main change: adding continuation_token fields to ListObjects request and response for pagination support. |
| Docstring Coverage | β Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
[!TIP]
π Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests β including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- π Description β Summarize the main change in 50β60 words, explaining what was done.
- π References β List relevant issues, discussions, documentation, or related PRs.
- π¦ Dependencies & Requirements β Mention any new/updated dependencies, environment variable changes, or configuration updates.
- π Contributor Summary β Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- βοΈ Additional Notes β Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.