Skip to content

feat: Implement cursor-based pagination for SCIM#14

Merged
git-it127 merged 3 commits into
coreweavefrom
cursor
Jun 16, 2026
Merged

feat: Implement cursor-based pagination for SCIM#14
git-it127 merged 3 commits into
coreweavefrom
cursor

Conversation

@git-it127

Copy link
Copy Markdown
Collaborator

This includes cursor based pagination logic for SCIM. This also includes a quick unit test fix for sshkey listings

@git-it127 git-it127 requested a review from a team June 9, 2026 21:15
Comment thread nss_cache/sources/scimsource.py Outdated
git-it127 added a commit that referenced this pull request Jun 10, 2026
Replace the parse_qsl loop in _UrlHasCursorParam with a single dict
membership check via parse_qs. parse_qs with keep_blank_values=True
covers every shape we accept (cursor=, bare cursor, repeated cursor=)
without iterating the rest of the query string.

Addresses PR #14 review comment from bradbeam.

Co-authored-by: Cursor <cursoragent@cursor.com>
bradbeam
bradbeam previously approved these changes Jun 10, 2026
Comment thread nss_cache/sources/scimsource.py Outdated
# final page, which omits it.
if _UrlHasCursorParam(url):
current_url = url
while True:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: Should we also add circuit breaker, like max pages could be some number 100? If there is a upstream bug, don't want this to go infinite looop.

page_map = parser.GetMap(cache_info=scim_body_bytes, data=page_map)

next_cursor = parser._pagination_metadata.get('nextCursor')
if not next_cursor:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: Should we instead check for none specifically?

if next_cursor is None:
        break

shiv2909
shiv2909 previously approved these changes Jun 10, 2026
@git-it127 git-it127 dismissed stale reviews from shiv2909 and bradbeam via d412a4c June 16, 2026 18:21
@git-it127 git-it127 merged commit c73b571 into coreweave Jun 16, 2026
@git-it127 git-it127 deleted the cursor branch June 16, 2026 18:34
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.

3 participants