-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-21768: Add SCIM get/filter groups response pagination #4874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aee32ca to
d313e58
Compare
d313e58 to
9498a50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds pagination support to the SCIM API's GET /Groups and filter groups endpoints. Previously, these endpoints returned all groups in a single response. The implementation adds startIndex and count query parameters following the SCIM specification's 1-based index pagination model.
Key Changes:
- Added
startIndexandcountparameters to SCIM group listing endpoints - Implemented offset-based pagination in the database layer using SQL OFFSET/LIMIT
- Updated the internal Brig API to accept pagination parameters
- Added comprehensive integration tests for pagination behavior
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/hscim/src/Web/Scim/Class/Group.hs | Extended GroupDB interface to accept startIndex and count parameters |
| libs/hscim/src/Web/Scim/Schema/ListResponse.hs | Added toPage helper function for creating paginated responses |
| libs/hscim/src/Web/Scim/Server/Mock.hs | Updated mock implementation to support pagination parameters |
| libs/wire-subsystems/src/Wire/ScimSubsystem.hs | Updated type signature to include pagination parameters |
| libs/wire-subsystems/src/Wire/ScimSubsystem/Interpreter.hs | Modified to construct ListResponse with correct pagination metadata |
| libs/wire-subsystems/src/Wire/UserGroupSubsystem.hs | Extended GetGroupsInternal to accept startIndex and count |
| libs/wire-subsystems/src/Wire/UserGroupSubsystem/Interpreter.hs | Implemented offset-based pagination using PaginationOffset |
| libs/wire-subsystems/src/Wire/UserGroupStore.hs | Removed unused helper functions toSortBy and mkPaginationState |
| libs/wire-subsystems/src/Wire/UserGroupStore/Postgres.hs | Added SQL offset clause and modified ORDER BY for offset pagination |
| libs/wire-subsystems/src/Wire/PaginationState.hs | Added PaginationOffset constructor and updated paginationClause |
| libs/wire-subsystems/src/Wire/Postgres.hs | Added offset query fragment helper function |
| libs/wire-subsystems/src/Wire/BrigAPIAccess.hs | Updated GetGroupsInternal signature with pagination parameters |
| libs/wire-subsystems/src/Wire/BrigAPIAccess/Rpc.hs | Added startIndex and count query parameters to HTTP request |
| libs/wire-subsystems/test/unit/Wire/MockInterpreters/UserGroupStore.hs | Implemented offset-based pagination in mock with sorting logic |
| libs/wire-api/src/Wire/API/Routes/Internal/Brig.hs | Added startIndex and count query parameters to route definition |
| services/brig/src/Brig/API/Internal.hs | Updated handler to accept and pass through pagination parameters |
| services/spar/src/Spar/Scim/Group.hs | Added Natural type conversions for pagination parameters |
| integration/test/Test/Spar.hs | Added comprehensive pagination test with multiple pages |
| integration/test/API/Spar.hs | Added filterScimUserGroupPaginate helper function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
libs/wire-subsystems/src/Wire/UserGroupSubsystem/Interpreter.hs
Outdated
Show resolved
Hide resolved
libs/wire-subsystems/src/Wire/UserGroupSubsystem/Interpreter.hs
Outdated
Show resolved
Hide resolved
libs/wire-subsystems/test/unit/Wire/MockInterpreters/UserGroupStore.hs
Outdated
Show resolved
Hide resolved
libs/wire-subsystems/src/Wire/UserGroupSubsystem/Interpreter.hs
Outdated
Show resolved
Hide resolved
a32e1c4 to
67b0c15
Compare
- say directly what the pagination state is, don't go through a function - `toSortBy` isn't used anywhere and won't fit with changes to PaginationState either - inline `mkPaginationState`
.. by being lazy and just using Int32 in wire-server interfaces, as this is what PageSize internally is anyway.
67b0c15 to
46e8534
Compare
(reaching a fix-point there somehow seems harder than it should be...)
|
I don't understand this error: if it were a "normal" constraint, just switch off the warning in this module? 76d187b |
The warning is about the import, not about a redundant constraint. |
.. as the arguments are already of the correct type.
- actually check startIndex defaulting when out of range - remove separate test where startIndex and count are provided as this is already tested above - add a second test with negative startIndex - fix comments
we've taken care of all your suggestions 👍
Checklist
changelog.d