Skip to content

feat(generated): regenerate from spec (9 changes)#665

Merged
gjtorikian merged 12 commits into
mainfrom
oagen/spec-update-dee95fc33c4f813ac60adfa8c57d210db8183dd8
Jun 17, 2026
Merged

feat(generated): regenerate from spec (9 changes)#665
gjtorikian merged 12 commits into
mainfrom
oagen/spec-update-dee95fc33c4f813ac60adfa8c57d210db8183dd8

Conversation

@workos-sdk-automation

@workos-sdk-automation workos-sdk-automation Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

feat(user_management)!: Remove return_to parameter from revoke_session

  • Removed return_to parameter from UserManagement.revoke_session and AsyncUserManagement.revoke_session methods
  • Updated RevokeSession model to remove the return_to field
  • The parameter was optional but is now completely removed from the API

feat(api_keys): Add create_api_key_expire operation

  • Added new create_api_key_expire method to both ApiKeys and AsyncApiKeys classes
  • Added ExpireApiKey model with optional expires_at field
  • New operation allows expiring an API key immediately, scheduling future expiration, or clearing scheduled expiration

feat(common): Remove DsyncDeactivated models and add DsyncToken events

  • Removed DsyncDeactivated, DsyncDeactivatedData, DsyncDeactivatedDataDomain, DsyncDeactivatedDataState, and DsyncDeactivatedDataType models (breaking change)
  • Added new event models: DsyncTokenCreated, DsyncTokenCreatedData, DsyncTokenRevoked, DsyncTokenRevokedData
  • Updated event schema to reflect removal of dsync.deactivated event and addition of dsync.token.created and dsync.token.revoked events
  • Updated webhook endpoint events to support new api_key.updated event

feat(common): Add ApiKeyUpdated event models

  • Added ApiKeyUpdated, ApiKeyUpdatedData, ApiKeyUpdatedDataOwner, ApiKeyUpdatedDataPreviousAttribute, and UserApiKeyUpdatedDataOwner models
  • New event models support tracking API key updates with previous attribute values
  • Updated create and update webhook endpoint events to include api_key.updated

feat(common): Make expires_at required in ApiKeyCreatedData and ApiKeyRevokedData

  • Changed expires_at field from optional to required in ApiKeyCreatedData model
  • Changed expires_at field from optional to required in ApiKeyRevokedData model
  • Reordered fields to move expires_at before permissions in serialization

feat(user_management)!: Add name field to User, CreateUser, and UpdateUser models

  • Added name field to User model for the user's full name
  • Added name parameter to create_user and update_user methods
  • Added name field to CreateUser and UpdateUser models
  • Allows setting user's full name in addition to first and last name separately

feat(connect): Add name field to UserObject model

  • Added name field to UserObject model for the user's full name
  • Allows Connect endpoints to return and accept user's full name alongside first and last name

feat(authorization): Remove DOMAIN_SIGN_UP_RATE_LIMIT from RadarStandaloneResponseControl enum

  • Removed DOMAIN_SIGN_UP_RATE_LIMIT value from RadarStandaloneResponseControl enum (breaking change)
  • Updated enum type alias to exclude the removed value

feat(audit_logs): Add SNOWFLAKE to AuditLogConfigurationLogStreamType enum

  • Added SNOWFLAKE value to AuditLogConfigurationLogStreamType enum
  • Extends audit log configuration to support Snowflake as a log stream destination

Triggered by workos/openapi-spec@dee95fc

BEGIN_COMMIT_OVERRIDE
feat(user_management): Remove return_to parameter from revoke_session (#665)
feat(api_keys): Add create_api_key_expire operation (#665)
feat(common): Remove DsyncDeactivated models and add DsyncToken events (#665)
feat(common): Add ApiKeyUpdated event models (#665)
feat(common): Make expires_at required in ApiKeyCreatedData and ApiKeyRevokedData (#665)
feat(user_management): Add name field to User, CreateUser, and UpdateUser models (#665)
feat(connect): Add name field to UserObject model (#665)
feat(authorization): Remove DOMAIN_SIGN_UP_RATE_LIMIT from RadarStandaloneResponseControl enum (#665)
feat(audit_logs): Add SNOWFLAKE to AuditLogConfigurationLogStreamType enum (#665)
END_COMMIT_OVERRIDE

@workos-sdk-automation workos-sdk-automation Bot requested review from a team as code owners June 3, 2026 19:20
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jun 3, 2026
@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a spec-generated SDK update covering 9 API changes: new create_api_key_expire operation, ApiKeyUpdated/DsyncToken event models, name field on user models, removal of return_to from revoke_session, removal of dsync.deactivated and DOMAIN_SIGN_UP_RATE_LIMIT, and SNOWFLAKE added to audit log stream types.

  • New create_api_key_expire method added to both ApiKeys and AsyncApiKeys; the if v is not None body filter prevents sending explicit null to clear a scheduled expiration (previously flagged in thread).
  • name field added to User, CreateUser, UpdateUser, and UserObject models; serialization follows existing nullable-field conventions.
  • Breaking removals: return_to from RevokeSession, DsyncDeactivated event family, and DOMAIN_SIGN_UP_RATE_LIMIT enum value — all aligned with spec.

Confidence Score: 5/5

Safe to merge — all changes are spec-generated and consistently implemented; the null-clearing limitation in create_api_key_expire was already flagged in a prior review thread.

All model additions and removals follow established code patterns. The name field serialization is consistent with how first_name/last_name are handled. Breaking removals (return_to, DsyncDeactivated, DOMAIN_SIGN_UP_RATE_LIMIT) are intentional spec changes with matching fixture and test updates.

No files require special attention beyond what was already flagged in the prior review thread on src/workos/api_keys/_resource.py.

Important Files Changed

Filename Overview
src/workos/api_keys/_resource.py Adds create_api_key_expire to both sync and async classes; the if v is not None body filter prevents sending explicit null to clear a scheduled expiration (flagged in a prior thread).
src/workos/user_management/_resource.py Removes return_to from revoke_session (sync+async), adds name field to create_user/update_user. Stale return_to docstring in get_logout_url.
src/workos/common/models/user.py Adds optional name field; to_dict consistently serializes it as null when absent, matching the pattern of other nullable required-by-API fields.
src/workos/events/models/event_schema.py Removes dsync.deactivated, adds api_key.updated, dsync.token.created, and dsync.token.revoked event types with correct discriminator mapping.
src/workos/common/models/api_key_updated_data.py New model for api_key.updated event payload with discriminated union on owner.type; required fields use direct key access, optional fields use .get().
src/workos/user_management/models/revoke_session.py Removes return_to field from the model and serialization, aligning with the API change.
tests/test_models_round_trip.py Expands round-trip coverage for all new models and updated fixtures; new event types and updated user/api-key models are covered.

Reviews (2): Last reviewed commit: "update changelog" | Re-trigger Greptile

Comment on lines +210 to +216
body: Dict[str, Any] = {
k: v
for k, v in {
"expires_at": expires_at,
}.items()
if v is not None
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Cannot send explicit null to clear scheduled expiration

The docstring for expires_at states: "Use null to clear a scheduled future expiration." However the body-building filter if v is not None silently drops a None value, so calling create_api_key_expire(id, expires_at=None) produces an empty body {} — identical to omitting the argument. There is no way for callers to send {"expires_at": null} to the API, making the "clear scheduled expiration" use case completely unreachable. The same issue is present in AsyncApiKeys.create_api_key_expire at line 415.

@gjtorikian gjtorikian changed the title feat(generated)!: regenerate from spec (9 changes) feat(generated): regenerate from spec (9 changes) Jun 17, 2026
@gjtorikian gjtorikian merged commit 4af7da4 into main Jun 17, 2026
10 checks passed
@gjtorikian gjtorikian deleted the oagen/spec-update-dee95fc33c4f813ac60adfa8c57d210db8183dd8 branch June 17, 2026 01:48
This was referenced Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

1 participant