Skip to content

FIX Follow pagination when listing targets - #3975

Open
Aman (its-amann) wants to merge 1 commit into
microsoft:mainfrom
its-amann:fix/listing-pagination-3704
Open

Aman (its-amann) wants to merge 1 commit into
microsoft:mainfrom
its-amann:fix/listing-pagination-3704

Conversation

@its-amann

Copy link
Copy Markdown
Contributor

Description

Fixes #3704. The API client now follows the server's cursor when listing targets, scenarios, and initializers. Calls without a limit return the full catalog. An explicit limit still caps the total number of results.

If the server reports another page without supplying a usable new cursor, the client raises an error instead of returning an incomplete list.

Roman Lutz (@romanlutz) would appreciate a review when you get a chance.

Tests and Documentation

Added tests for all three paginated endpoints, the total limit, and missing or repeated cursors. The CLI and related backend service suites passed (949 tests, 1 skipped).

Created 205 text targets on a local backend and checked both the SDK and pyrit_scan list-targets. Both previously stopped at 200 and now return all 205. Updated the SDK docstrings to explain the limit.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

CLI and API client silently truncate target listings at 200 entries

2 participants