Skip to content

feat: Implement cursor-based pagination for SCIM#14

Open
git-it127 wants to merge 2 commits into
coreweavefrom
cursor
Open

feat: Implement cursor-based pagination for SCIM#14
git-it127 wants to merge 2 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>
# 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

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