Skip to content

fix: list_client_secrets returns raw list, not paginated response#586

Merged
gjtorikian merged 6 commits intoworkos:mainfrom
blackmad-cradle:fix/list-client-secrets-raw-list
Mar 9, 2026
Merged

fix: list_client_secrets returns raw list, not paginated response#586
gjtorikian merged 6 commits intoworkos:mainfrom
blackmad-cradle:fix/list-client-secrets-raw-list

Conversation

@blackmad-cradle
Copy link
Contributor

@blackmad-cradle blackmad-cradle commented Mar 7, 2026

The API endpoint returns a plain JSON array for client secrets, not a paginated response object. Updated to match the pattern used by other raw-list endpoints (e.g. fga.batch_check, vault.list_object_versions).

Apologies, got this one wrong in my last MR. Interactively tested that this works.

Description

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[x] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

The API endpoint returns a plain JSON array for client secrets, not a
paginated response object. Updated to match the pattern used by other
raw-list endpoints (e.g. fga.batch_check, vault.list_object_versions).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blackmad-cradle blackmad-cradle requested review from a team as code owners March 7, 2026 20:58
The API expects redirect_uris as an array of {uri, default} objects,
not plain strings. Added RedirectUriInput TypedDict and updated
create_application/update_application signatures to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR corrects list_client_secrets in both Connect and AsyncConnect to match the actual API contract: the endpoint returns a plain JSON array, not a paginated list object. The fix replaces the WorkOSListResource wrapper (with its pagination parameters and cursor logic) with a simple list comprehension that validates each item against the ClientSecret model.

Key changes:

  • list_client_secrets signature simplified — pagination kwargs (limit, before, after, order) removed from both the ConnectModule protocol and the two concrete implementations
  • Return type changed from ClientSecretsListResource (a WorkOSListResource generic) to Sequence[ClientSecret]
  • ClientSecretsListResource type alias and its ClientSecretListFilters import removed from connect.py
  • Tests updated: mock fixture is now a plain list; auto-pagination tests are correctly removed
  • ClientSecretListFilters class in src/workos/types/connect/list_filters.py is now orphaned dead code and should be deleted as cleanup

Confidence Score: 5/5

  • Safe to merge — the change is a straightforward bug fix that aligns the SDK with the actual API response shape.
  • The change is minimal, well-scoped, and consistent with how other raw-list endpoints are handled in the codebase. Both sync and async paths are updated symmetrically, and the tests correctly validate the new behavior. The only leftover is the now-unused ClientSecretListFilters class in list_filters.py, which is dead code but does not affect runtime correctness.
  • src/workos/types/connect/list_filters.py — ClientSecretListFilters is unused dead code and should be removed.

Comments Outside Diff (1)

  1. src/workos/types/connect/list_filters.py, line 10-11 (link)

    ClientSecretListFilters is no longer used. The ClientSecretsListResource type alias that previously depended on it was removed as part of this PR, and this class is not imported anywhere else in the codebase.

Last reviewed commit: 5a04c49

gjtorikian and others added 3 commits March 9, 2026 12:46
The list_client_secrets endpoint no longer uses pagination, so this
filter class is dead code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use TypedDict inheritance pattern (Python 3.8+ compatible) so that
uri is a required key while default remains optional.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gjtorikian gjtorikian merged commit ccc8cd5 into workos:main Mar 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants