feat(generated): UserManagement (batch 535653ab)#696
feat(generated): UserManagement (batch 535653ab)#696workos-sdk-automation[bot] wants to merge 2 commits into
Conversation
Greptile SummaryThis PR regenerates shared SDK exports and tests for the UserManagement specification update. The main changes are:
Confidence Score: 5/5The changed runtime exports look safe, with non-blocking test coverage loss to clean up.
tests/test_common_models_round_trip.py and tests/test_connect_models_round_trip.py Important Files Changed
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
tests/test_common_models_round_trip.py:7-12
**Common Model Coverage Disappears**
This regeneration removes round-trip, nullable-field, omitted-field, and unknown-enum tests for roughly 200 unrelated common models without adding replacements. A later serialization regression in event, directory, agent-registration, feature-flag, or vault models can therefore pass CI unnoticed.
### Issue 2 of 2
tests/test_connect_models_round_trip.py:9-10
**Connect Serialization Coverage Disappears**
This regeneration removes the serialization tests for `RedirectUriInput`, `ExternalAuthCompleteResponse`, `NewConnectApplicationSecret`, consent models, and user models without adding replacements. Incorrect handling of optional or nullable fields in these public models can now pass CI.
Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile |
| MagicAuthCreated, | ||
| MagicAuthCreatedData, | ||
| OrganizationCreated, | ||
| OrganizationCreatedData, | ||
| OrganizationCreatedDataDomain, | ||
| OrganizationDeleted, | ||
| OrganizationDeletedData, | ||
| OrganizationDeletedDataDomain, | ||
| OrganizationDomainCreated, | ||
| OrganizationDomainCreatedData, | ||
| OrganizationDomainDeleted, | ||
| OrganizationDomainDeletedData, | ||
| OrganizationDomainUpdated, | ||
| OrganizationDomainUpdatedData, | ||
| OrganizationDomainVerificationFailed, | ||
| OrganizationDomainVerificationFailedData, | ||
| OrganizationDomainVerificationFailedDataOrganizationDomain, | ||
| OrganizationDomainVerified, | ||
| OrganizationDomainVerifiedData, | ||
| OrganizationMembershipCreated, | ||
| OrganizationMembershipCreatedData, | ||
| OrganizationMembershipDeleted, | ||
| OrganizationMembershipDeletedData, | ||
| OrganizationMembershipUpdated, | ||
| OrganizationMembershipUpdatedData, | ||
| OrganizationRoleCreated, | ||
| OrganizationRoleCreatedData, | ||
| OrganizationRoleDeleted, | ||
| OrganizationRoleDeletedData, | ||
| OrganizationRoleUpdated, | ||
| OrganizationRoleUpdatedData, | ||
| OrganizationUpdated, | ||
| OrganizationUpdatedData, | ||
| OrganizationUpdatedDataDomain, | ||
| PasswordResetCreated, | ||
| PasswordResetCreatedData, | ||
| PasswordResetSucceeded, | ||
| PasswordResetSucceededData, | ||
| PermissionCreated, | ||
| PermissionCreatedData, | ||
| PermissionDeleted, | ||
| PermissionDeletedData, | ||
| PermissionUpdated, | ||
| PermissionUpdatedData, | ||
| PipeConnectedAccount, | ||
| PipesConnectedAccountConnected, | ||
| PipesConnectedAccountConnectionFailed, | ||
| PipesConnectedAccountConnectionFailedData, | ||
| PipesConnectedAccountDisconnected, | ||
| PipesConnectedAccountReauthorizationNeeded, | ||
| RadarChallengeCreated, | ||
| RadarChallengeCreatedData, | ||
| RoleCreated, | ||
| RoleCreatedData, | ||
| RoleDeleted, | ||
| RoleDeletedData, | ||
| RoleUpdated, | ||
| RoleUpdatedData, | ||
| SessionCreated, | ||
| SessionCreatedData, | ||
| SessionCreatedDataImpersonator, | ||
| SessionRevoked, | ||
| SessionRevokedData, | ||
| SessionRevokedDataImpersonator, | ||
| UserApiKeyCreatedDataOwner, | ||
| UserApiKeyRevokedDataOwner, | ||
| UserApiKeyUpdatedDataOwner, | ||
| UserCreated, | ||
| UserDeleted, | ||
| UserUpdated, | ||
| VaultByokKeyDeleted, | ||
| VaultByokKeyDeletedData, | ||
| VaultByokKeyVerificationCompleted, | ||
| VaultByokKeyVerificationCompletedData, | ||
| VaultDataCreated, | ||
| VaultDataCreatedData, | ||
| VaultDataDeleted, | ||
| VaultDataDeletedData, | ||
| VaultDataRead, | ||
| VaultDataReadData, | ||
| VaultDataUpdated, | ||
| VaultDataUpdatedData, | ||
| VaultDekDecrypted, | ||
| VaultDekDecryptedData, | ||
| VaultDekRead, | ||
| VaultDekReadData, | ||
| VaultKekCreated, | ||
| VaultKekCreatedData, | ||
| VaultKekDeleted, | ||
| VaultKekDeletedData, | ||
| VaultMetadataRead, | ||
| VaultMetadataReadData, | ||
| VaultNamesListed, | ||
| VaultNamesListedData, | ||
| WaitlistUser, | ||
| WaitlistUserApproved, | ||
| WaitlistUserCreated, | ||
| WaitlistUserDenied, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Common Model Coverage Disappears
This regeneration removes round-trip, nullable-field, omitted-field, and unknown-enum tests for roughly 200 unrelated common models without adding replacements. A later serialization regression in event, directory, agent-registration, feature-flag, or vault models can therefore pass CI unnoticed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_common_models_round_trip.py
Line: 7-12
Comment:
**Common Model Coverage Disappears**
This regeneration removes round-trip, nullable-field, omitted-field, and unknown-enum tests for roughly 200 unrelated common models without adding replacements. A later serialization regression in event, directory, agent-registration, feature-flag, or vault models can therefore pass CI unnoticed.
How can I resolve this? If you propose a fix, please make it concise.| from workos.common.models import ConnectApplicationM2M | ||
| from workos.connect.models import ( | ||
| ApplicationCredentialsListItem, | ||
| ConnectApplication, | ||
| ConnectApplicationUnknown, | ||
| ExternalAuthCompleteResponse, | ||
| NewConnectApplicationSecret, | ||
| RedirectUriInput, | ||
| UserConsentOption, | ||
| UserConsentOptionChoice, | ||
| UserObject, | ||
| ) | ||
|
|
||
|
|
||
| class TestModelRoundTrip: | ||
| def test_user_object_round_trip(self): | ||
| data = load_fixture("user_object.json") | ||
| instance = UserObject.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = UserObject.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_user_object_minimal_payload(self): | ||
| data = {"id": "user_12345", "email": "marcelina.davis@example.com"} | ||
| instance = UserObject.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["id"] == data["id"] | ||
| assert serialized["email"] == data["email"] | ||
|
|
||
| def test_user_object_omits_absent_optional_non_nullable_fields(self): | ||
| data = {"id": "user_12345", "email": "marcelina.davis@example.com"} | ||
| instance = UserObject.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert "first_name" not in serialized | ||
| assert "last_name" not in serialized | ||
| assert "name" not in serialized | ||
| assert "metadata" not in serialized | ||
|
|
||
| def test_user_consent_option_round_trip(self): | ||
| data = load_fixture("user_consent_option.json") | ||
| instance = UserConsentOption.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = UserConsentOption.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_user_consent_option_minimal_payload(self): | ||
| data = { | ||
| "claim": "tos_accepted", | ||
| "type": "enum", | ||
| "label": "Terms of Service", | ||
| "choices": [ | ||
| {"value": "accepted", "label": "I accept the Terms of Service"} | ||
| ], | ||
| } | ||
| instance = UserConsentOption.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["claim"] == data["claim"] | ||
| assert serialized["type"] == data["type"] | ||
| assert serialized["label"] == data["label"] | ||
| assert serialized["choices"] == data["choices"] | ||
|
|
||
| def test_redirect_uri_input_round_trip(self): | ||
| data = load_fixture("redirect_uri_input.json") | ||
| instance = RedirectUriInput.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = RedirectUriInput.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_redirect_uri_input_minimal_payload(self): | ||
| data = {"uri": "https://example.com/callback"} | ||
| instance = RedirectUriInput.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["uri"] == data["uri"] | ||
|
|
||
| def test_redirect_uri_input_preserves_nullable_fields(self): | ||
| data = {"uri": "https://example.com/callback", "default": None} | ||
| instance = RedirectUriInput.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["default"] is None | ||
|
|
||
| def test_external_auth_complete_response_round_trip(self): | ||
| data = load_fixture("external_auth_complete_response.json") | ||
| instance = ExternalAuthCompleteResponse.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = ExternalAuthCompleteResponse.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_external_auth_complete_response_minimal_payload(self): | ||
| data = { | ||
| "redirect_uri": "https://your-authkit-domain.workos.com/oauth/authorize/complete?state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdGF0ZSI6InJhbmRvbV9zdGF0ZV9zdHJpbmciLCJpYXQiOjE3NDI2MDQ4NTN9.abc123def456ghi789" | ||
| } | ||
| instance = ExternalAuthCompleteResponse.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["redirect_uri"] == data["redirect_uri"] | ||
|
|
||
| def test_new_connect_application_secret_round_trip(self): | ||
| data = load_fixture("new_connect_application_secret.json") | ||
| instance = NewConnectApplicationSecret.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = NewConnectApplicationSecret.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_new_connect_application_secret_minimal_payload(self): | ||
| data = { | ||
| "object": "connect_application_secret", | ||
| "id": "secret_01J9Q2Z3X4Y5W6V7U8T9S0R1Q", | ||
| "secret_hint": "abc123", | ||
| "last_used_at": None, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z", | ||
| "secret": "abc123def456ghi789jkl012mno345pqr678stu901vwx234yz", | ||
| } | ||
| instance = NewConnectApplicationSecret.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["object"] == data["object"] | ||
| assert serialized["id"] == data["id"] | ||
| assert serialized["secret_hint"] == data["secret_hint"] | ||
| assert serialized["last_used_at"] == data["last_used_at"] | ||
| assert serialized["created_at"] == data["created_at"] | ||
| assert serialized["updated_at"] == data["updated_at"] | ||
| assert serialized["secret"] == data["secret"] | ||
|
|
||
| def test_new_connect_application_secret_preserves_nullable_fields(self): | ||
| data = { | ||
| "object": "connect_application_secret", | ||
| "id": "secret_01J9Q2Z3X4Y5W6V7U8T9S0R1Q", | ||
| "secret_hint": "abc123", | ||
| "last_used_at": None, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z", | ||
| "secret": "abc123def456ghi789jkl012mno345pqr678stu901vwx234yz", | ||
| } | ||
| instance = NewConnectApplicationSecret.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["last_used_at"] is None | ||
|
|
||
| def test_user_consent_option_choice_round_trip(self): | ||
| data = load_fixture("user_consent_option_choice.json") | ||
| instance = UserConsentOptionChoice.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = UserConsentOptionChoice.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_user_consent_option_choice_minimal_payload(self): | ||
| data = {} | ||
| instance = UserConsentOptionChoice.from_dict(data) | ||
| assert instance.to_dict() is not None | ||
|
|
||
| def test_user_consent_option_choice_omits_absent_optional_non_nullable_fields(self): | ||
| data = {} | ||
| instance = UserConsentOptionChoice.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert "value" not in serialized | ||
| assert "label" not in serialized | ||
|
|
||
| def test_application_credentials_list_item_round_trip(self): | ||
| data = load_fixture("application_credentials_list_item.json") | ||
| instance = ApplicationCredentialsListItem.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized == data | ||
| restored = ApplicationCredentialsListItem.from_dict(serialized) | ||
| assert restored.to_dict() == serialized | ||
|
|
||
| def test_application_credentials_list_item_minimal_payload(self): | ||
| data = { | ||
| "object": "connect_application_secret", | ||
| "id": "secret_01J9Q2Z3X4Y5W6V7U8T9S0R1Q", | ||
| "secret_hint": "abc123", | ||
| "last_used_at": None, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z", | ||
| } | ||
| instance = ApplicationCredentialsListItem.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["object"] == data["object"] | ||
| assert serialized["id"] == data["id"] | ||
| assert serialized["secret_hint"] == data["secret_hint"] | ||
| assert serialized["last_used_at"] == data["last_used_at"] | ||
| assert serialized["created_at"] == data["created_at"] | ||
| assert serialized["updated_at"] == data["updated_at"] | ||
|
|
||
| def test_application_credentials_list_item_preserves_nullable_fields(self): | ||
| data = { | ||
| "object": "connect_application_secret", | ||
| "id": "secret_01J9Q2Z3X4Y5W6V7U8T9S0R1Q", | ||
| "secret_hint": "abc123", | ||
| "last_used_at": None, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z", | ||
| } | ||
| instance = ApplicationCredentialsListItem.from_dict(data) | ||
| serialized = instance.to_dict() | ||
| assert serialized["last_used_at"] is None | ||
| from workos.connect.models import ConnectApplication, ConnectApplicationUnknown |
There was a problem hiding this comment.
Connect Serialization Coverage Disappears
This regeneration removes the serialization tests for RedirectUriInput, ExternalAuthCompleteResponse, NewConnectApplicationSecret, consent models, and user models without adding replacements. Incorrect handling of optional or nullable fields in these public models can now pass CI.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_connect_models_round_trip.py
Line: 9-10
Comment:
**Connect Serialization Coverage Disappears**
This regeneration removes the serialization tests for `RedirectUriInput`, `ExternalAuthCompleteResponse`, `NewConnectApplicationSecret`, consent models, and user models without adding replacements. Incorrect handling of optional or nullable fields in these public models can now pass CI.
How can I resolve this? If you propose a fix, please make it concise.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@341b7f0