Skip to content

feat(generated)!: regenerate from spec (5 changes)#563

Open
workos-sdk-automation[bot] wants to merge 4 commits into
mainfrom
oagen/spec-update-dee95fc33c4f813ac60adfa8c57d210db8183dd8
Open

feat(generated)!: regenerate from spec (5 changes)#563
workos-sdk-automation[bot] wants to merge 4 commits into
mainfrom
oagen/spec-update-dee95fc33c4f813ac60adfa8c57d210db8183dd8

Conversation

@workos-sdk-automation
Copy link
Copy Markdown
Contributor

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

Summary

feat(api_keys): Add expire operation and API key update events

  • Added CreateExpire operation to expire API keys immediately or schedule future expiration
  • Added ApiKeyUpdated event and related models (ApiKeyUpdatedData, ApiKeyUpdatedDataPreviousAttribute)
  • Made expires_at field required in ApiKeyCreatedData and ApiKeyRevokedData
  • Added API_KEY_UPDATED enum value to webhook event types

feat(directory_sync): Remove deactivated event and add token lifecycle events

  • Removed DsyncDeactivated event and related models (DsyncDeactivatedData, DsyncDeactivatedDataDomain) and enums
  • Added DsyncTokenCreated and DsyncTokenRevoked events with related data models for directory token lifecycle tracking

feat(user_management): Remove return_to from revoke session and add user name field

  • Removed return_to parameter from UserManagementRevokeSessionParams
  • Added optional name field to UserObject, CreateUser, UpdateUser, User, and EmailChangeConfirmationUser models
  • Updated docstrings for UserManagementGetLogoutURLParams fields for clarity

feat(audit_logs): Add Snowflake as log stream type

  • Added SNOWFLAKE enum value to AuditLogConfigurationLogStreamType

feat(radar): Remove domain sign-up rate limit control

  • Removed DOMAIN_SIGN_UP_RATE_LIMIT enum value from RadarStandaloneResponseControl

Triggered by workos/openapi-spec@dee95fc

BEGIN_COMMIT_OVERRIDE
feat(api_keys): Add expire operation and API key update events (#563)
feat(directory_sync): Remove deactivated event and add token lifecycle events (#563)
feat(user_management): Remove return_to from revoke session and add user name field (#563)
feat(audit_logs): Add Snowflake as log stream type (#563)
feat(radar): Remove domain sign-up rate limit control (#563)
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
@workos-sdk-automation workos-sdk-automation Bot requested review from nicknisi and removed request for a team June 3, 2026 19:20
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 3, 2026

Greptile Summary

This is a generated SDK update regenerated from the OpenAPI spec, adding new API key expiration and update events, directory sync token lifecycle events, a name field to user models, Snowflake as a log stream type, and several breaking removals (DsyncDeactivated, ReturnTo on revoke session, DOMAIN_SIGN_UP_RATE_LIMIT radar control).

  • api_keys.go: Adds CreateExpire for immediate or scheduled API key expiration; APIKeyUpdated event model and APIKeyUpdatedDataPreviousAttribute for tracking expiry changes.
  • pkg/events/events.go / enums.go: APIKeyUpdated constant added; however DsyncTokenCreated and DsyncTokenRevoked constants are absent despite their model types and fixtures being present — all other dsync events have entries in both places.
  • user_management.go: ReturnTo removed from UserManagementRevokeSessionParams (intentional breaking change); optional name field added to create/update params and response models.

Confidence Score: 3/5

Mostly safe to merge; the DsyncToken event constants gap means consumers cannot subscribe to or switch on the new dsync.token events using typed constants until a follow-up is cut.

The core additions (CreateExpire, APIKeyUpdated models, user name field, Snowflake enum) are well-formed and consistent with existing patterns. The missing DsyncTokenCreated and DsyncTokenRevoked constants in both pkg/events/events.go and the CreateWebhookEndpointEvents enum represent a real gap: the new events have models and test fixtures but no typed string constants, leaving the feature only partially surfaced to SDK consumers.

pkg/events/events.go and enums.go — both need DsyncTokenCreated and DsyncTokenRevoked entries to match the pattern every other dsync event follows.

Important Files Changed

Filename Overview
api_keys.go Adds CreateExpire method with correct path-escaping, body marshalling, and error propagation.
pkg/events/events.go Adds APIKeyUpdated constant but is missing DsyncTokenCreated and DsyncTokenRevoked constants that are present as model types and test fixtures.
enums.go Adds APIKeyUpdated webhook event and Snowflake log stream type; removes DomainSignUpRateLimit radar control; missing CreateWebhookEndpointEvents constants for dsync.token.created and dsync.token.revoked.
models.go Adds APIKeyUpdated/DsyncToken event models and name field to user types; changes ExpiresAt from omitempty to required on APIKeyCreatedData and APIKeyRevokedData; consolidates owner type aliases cleanly.
user_management.go Removes ReturnTo from RevokeSessionParams (breaking change per semver marker), updates docstrings, adds name field to Create/UpdateParams.
testdata/expire_api_key.json New fixture contains only expires_at but the corresponding function returns a full APIKey; listed in manifest but not loaded by any test.

Sequence Diagram

sequenceDiagram
    participant Client
    participant WorkOS API
    participant Webhook Consumer

    Client->>WorkOS API: POST /api_keys/{id}/expire<br/>{expires_at?: string}
    WorkOS API-->>Client: APIKey (200 OK)

    WorkOS API->>Webhook Consumer: api_key.updated event<br/>APIKeyUpdated { data: APIKeyUpdatedData,<br/>  previous_attributes: { expires_at } }

    WorkOS API->>Webhook Consumer: dsync.token.created event<br/>DsyncTokenCreated { data: DsyncTokenCreatedData }
    WorkOS API->>Webhook Consumer: dsync.token.revoked event<br/>DsyncTokenRevoked { data: DsyncTokenRevokedData }
Loading

Comments Outside Diff (1)

  1. pkg/events/events.go, line 32-41 (link)

    P1 Missing event constants for new dsync token events

    DsyncTokenCreated and DsyncTokenRevoked constants are absent from this file and from the CreateWebhookEndpointEvents enum in enums.go, even though their corresponding model types (DsyncTokenCreated, DsyncTokenRevoked, DsyncTokenCreatedData) and test fixtures (testdata/dsync_token_created.json, testdata/dsync_token_revoked.json) were all added. Every other dsync event — DsyncActivated, DsyncDeleted, DsyncGroupCreated, etc. — has entries in both places. Consumers who switch on event type strings or configure webhook subscriptions using these constants will have no typed value to reference, forcing them to use raw strings and bypassing the type-safe constants the package provides.

Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile

Comment on lines +1 to +3
{
"expires_at": "2030-01-01T00:00:00.000Z"
}
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.

P2 Fixture shape does not match the function's return type

CreateExpire returns *APIKey, but this fixture contains only {"expires_at": "..."}. The existing test for CreateExpire correctly uses testdata/api_key.json as its fixture, not this file, so it is currently unused. The manifest (oagen-manifest.json) lists this file, suggesting it was meant to be used somewhere, but no test reads it. If a test is added later that loads this fixture and deserialises it into an APIKey, all non-expires_at required fields will be zero-valued and assertions like result.ID will silently pass empty strings rather than failing loudly.

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.

0 participants