Add pagination support for Collection APIs - #6378
Conversation
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 2a631dd. ⛔ Hard block: Issues at High severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 94a2be6)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 94a2be6 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 6fe9022
Suggestions up to commit 6fe9022
Suggestions up to commit 3585239
Suggestions up to commit decd858
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6378 +/- ##
==========================================
+ Coverage 75.51% 75.76% +0.25%
==========================================
Files 456 461 +5
Lines 30282 30555 +273
Branches 4574 4626 +52
==========================================
+ Hits 22866 23150 +284
+ Misses 5284 5279 -5
+ Partials 2132 2126 -6
🚀 New features to boost your workflow:
|
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
|
Persistent review updated to latest commit 3585239 |
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
|
Persistent review updated to latest commit 6fe9022 |
1 similar comment
|
Persistent review updated to latest commit 6fe9022 |
Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
|
Persistent review updated to latest commit 94a2be6 |
Description
Large deployments can have thousands of security configuration entities (users, roles, mappings, etc.). Returning everything in one response creates unbounded payloads. This PR adds opt-in cursor-based pagination to the six Security configuration collection APIs, using the same surface contract (size, sort, next_token) as OpenSearch core's _list APIs.
Without pagination parameters, all six collection endpoints behave identically to before — fully backward compatible.
With the new opt-in parameters, responses use a paginated envelope:
{ "next_token": "<cursor or null>", "roles": { "role_a": {}, "role_b": {} } }Affected endpoints: internalusers, roles, rolesmapping, actiongroups, tenants, nodesdn.
Pagination applies after authorization and redaction — hidden entities cannot leak through page contents or cursor values.
Cursors are bound to endpoint and sort direction; misuse returns 400.
Pagination params on single-entity GETs return 400.
Lexicographic cursor continuation - safe across additions and deletions between page requests.
Issues Resolved
#6339
Is this a backport? If so, please add backport PR # and/or commits #, and remove
backport-failedlabel from the original PR.Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here
Testing
Unit tests, Integration tests and manual testing.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.