From 8648d222e185710a70c7b9da7496853462b7f6d5 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:12:32 +0000 Subject: [PATCH 1/4] feat(events)!: Change required status for parameter `Events.list.events` --- lib/Resource/CreateWebhookEndpointEvents.php | 1 + ...tegrationsListResponseDataConnectedAccount.php | 15 +++++++++++++++ lib/Resource/WaitlistUser.php | 4 ++++ lib/Service/Events.php | 4 ++-- ...a_integration_configuration_list_response.json | 2 +- .../Fixtures/data_integrations_list_response.json | 5 +++++ .../data_integrations_list_response_data.json | 5 +++++ ...ions_list_response_data_connected_account.json | 5 +++++ tests/Fixtures/list_data_integration.json | 2 +- tests/Fixtures/waitlist_user.json | 1 + tests/Fixtures/waitlist_user_approved.json | 1 + tests/Fixtures/waitlist_user_created.json | 1 + tests/Fixtures/waitlist_user_denied.json | 1 + tests/Service/EventsTest.php | 2 +- 14 files changed, 44 insertions(+), 5 deletions(-) diff --git a/lib/Resource/CreateWebhookEndpointEvents.php b/lib/Resource/CreateWebhookEndpointEvents.php index d1a14dde..c4bdf4c5 100644 --- a/lib/Resource/CreateWebhookEndpointEvents.php +++ b/lib/Resource/CreateWebhookEndpointEvents.php @@ -13,6 +13,7 @@ enum CreateWebhookEndpointEvents: string case AgentRegistrationClaimCompleted = 'agent.registration.claim.completed'; case AgentRegistrationCredentialIssued = 'agent.registration.credential.issued'; case AgentRegistrationDeleted = 'agent.registration.deleted'; + case AgentRegistrationRefreshed = 'agent.registration.refreshed'; case AgentRegistrationExpired = 'agent.registration.expired'; case AgentRegistrationOrganizationSwitched = 'agent.registration.organization.switched'; case AgentRegistrationRevoked = 'agent.registration.revoked'; diff --git a/lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php b/lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php index 5ad12e0a..38463b91 100644 --- a/lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php +++ b/lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php @@ -44,6 +44,15 @@ public function __construct( public ?DataIntegrationAuthMethods $authMethod = null, /** The last four characters of the API key, or `null` for OAuth connections. */ public ?string $apiKeyLast4 = null, + /** The client ID supplied for this connection. Only present when `auth_method` is `client_credentials`. */ + public ?string $clientId = null, + /** The last four characters of the client secret supplied for this connection, or `null` when it can't be read. Only present when `auth_method` is `client_credentials`. */ + public ?string $clientSecretLast4 = null, + /** + * The connection-level configuration values stored for this connection — the fields the provider declares at `installation` scope, excluding any it declares as secret. Only present when `auth_method` is `client_credentials`. + * @var array|null + */ + public ?array $config = null, ) { } @@ -61,6 +70,9 @@ public static function fromArray(array $data): self userlandUserId: $data['userlandUserId'] ?? null, authMethod: isset($data['auth_method']) ? DataIntegrationAuthMethods::from($data['auth_method']) : null, apiKeyLast4: $data['api_key_last_4'] ?? null, + clientId: $data['client_id'] ?? null, + clientSecretLast4: $data['client_secret_last_4'] ?? null, + config: $data['config'] ?? null, ); } @@ -78,6 +90,9 @@ public function toArray(): array 'userlandUserId' => $this->userlandUserId, 'auth_method' => $this->authMethod?->value, 'api_key_last_4' => $this->apiKeyLast4, + 'client_id' => $this->clientId, + 'client_secret_last_4' => $this->clientSecretLast4, + 'config' => $this->config, ]; } } diff --git a/lib/Resource/WaitlistUser.php b/lib/Resource/WaitlistUser.php index 2d19524c..ef896e64 100644 --- a/lib/Resource/WaitlistUser.php +++ b/lib/Resource/WaitlistUser.php @@ -25,6 +25,8 @@ public function __construct( public \DateTimeImmutable $createdAt, /** An ISO 8601 timestamp. */ public \DateTimeImmutable $updatedAt, + /** The unique ID of the Waitlist that the Waitlist User joined. */ + public ?string $waitlistId = null, ) { } @@ -38,6 +40,7 @@ public static function fromArray(array $data): self approvedAt: isset($data['approved_at']) ? new \DateTimeImmutable($data['approved_at']) : null, createdAt: new \DateTimeImmutable($data['created_at']), updatedAt: new \DateTimeImmutable($data['updated_at']), + waitlistId: $data['waitlist_id'] ?? null, ); } @@ -51,6 +54,7 @@ public function toArray(): array 'approved_at' => $this->approvedAt?->format(\DateTimeInterface::RFC3339_EXTENDED), 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), 'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'waitlist_id' => $this->waitlistId, ]; } } diff --git a/lib/Service/Events.php b/lib/Service/Events.php index 80ea8c60..202c14fa 100644 --- a/lib/Service/Events.php +++ b/lib/Service/Events.php @@ -23,7 +23,7 @@ public function __construct( * @param string|null $after An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\PaginationOrder $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to "desc". - * @param array|null $events Filter events by one or more event types (e.g. `dsync.user.created`). + * @param array $events Filter events by one or more event types (e.g. `dsync.user.created`). * @param string|null $rangeStart ISO-8601 date string to filter events created after this date. * @param string|null $rangeEnd ISO-8601 date string to filter events created before this date. * @param string|null $organizationId Filter events by the [Organization](https://workos.com/docs/reference/organization) that the event is associated with. @@ -31,11 +31,11 @@ public function __construct( * @throws \WorkOS\Exception\WorkOSException */ public function listEvents( + array $events, ?string $before = null, ?string $after = null, ?int $limit = null, \WorkOS\Resource\PaginationOrder $order = \WorkOS\Resource\PaginationOrder::Desc, - ?array $events = null, ?string $rangeStart = null, ?string $rangeEnd = null, ?string $organizationId = null, diff --git a/tests/Fixtures/data_integration_configuration_list_response.json b/tests/Fixtures/data_integration_configuration_list_response.json index 714d7863..e1fe9d56 100644 --- a/tests/Fixtures/data_integration_configuration_list_response.json +++ b/tests/Fixtures/data_integration_configuration_list_response.json @@ -13,7 +13,7 @@ "user:email" ], "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" }, "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-01-15T10:30:00.000Z", diff --git a/tests/Fixtures/data_integrations_list_response.json b/tests/Fixtures/data_integrations_list_response.json index a94f34ef..2b08f083 100644 --- a/tests/Fixtures/data_integrations_list_response.json +++ b/tests/Fixtures/data_integrations_list_response.json @@ -34,6 +34,11 @@ ], "auth_method": "oauth", "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, "state": "connected", "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z", diff --git a/tests/Fixtures/data_integrations_list_response_data.json b/tests/Fixtures/data_integrations_list_response_data.json index a220ded8..9dfc7b33 100644 --- a/tests/Fixtures/data_integrations_list_response_data.json +++ b/tests/Fixtures/data_integrations_list_response_data.json @@ -31,6 +31,11 @@ ], "auth_method": "oauth", "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, "state": "connected", "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z", diff --git a/tests/Fixtures/data_integrations_list_response_data_connected_account.json b/tests/Fixtures/data_integrations_list_response_data_connected_account.json index 922647aa..957873f4 100644 --- a/tests/Fixtures/data_integrations_list_response_data_connected_account.json +++ b/tests/Fixtures/data_integrations_list_response_data_connected_account.json @@ -9,6 +9,11 @@ ], "auth_method": "oauth", "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, "state": "connected", "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z", diff --git a/tests/Fixtures/list_data_integration.json b/tests/Fixtures/list_data_integration.json index 9f094cb3..d41b44b8 100644 --- a/tests/Fixtures/list_data_integration.json +++ b/tests/Fixtures/list_data_integration.json @@ -23,7 +23,7 @@ }, "installation": null, "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" }, "custom_provider": { "name": "My OAuth App", diff --git a/tests/Fixtures/waitlist_user.json b/tests/Fixtures/waitlist_user.json index 05973598..c4f74339 100644 --- a/tests/Fixtures/waitlist_user.json +++ b/tests/Fixtures/waitlist_user.json @@ -4,6 +4,7 @@ "email": "marcelina.davis@example.com", "state": "pending", "approved_at": null, + "waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } diff --git a/tests/Fixtures/waitlist_user_approved.json b/tests/Fixtures/waitlist_user_approved.json index 848d68b9..7019eba5 100644 --- a/tests/Fixtures/waitlist_user_approved.json +++ b/tests/Fixtures/waitlist_user_approved.json @@ -8,6 +8,7 @@ "email": "marcelina.davis@example.com", "state": "pending", "approved_at": null, + "waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }, diff --git a/tests/Fixtures/waitlist_user_created.json b/tests/Fixtures/waitlist_user_created.json index ab5b52cf..1ba69bdd 100644 --- a/tests/Fixtures/waitlist_user_created.json +++ b/tests/Fixtures/waitlist_user_created.json @@ -8,6 +8,7 @@ "email": "marcelina.davis@example.com", "state": "pending", "approved_at": null, + "waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }, diff --git a/tests/Fixtures/waitlist_user_denied.json b/tests/Fixtures/waitlist_user_denied.json index 34abc6e0..25e9b834 100644 --- a/tests/Fixtures/waitlist_user_denied.json +++ b/tests/Fixtures/waitlist_user_denied.json @@ -8,6 +8,7 @@ "email": "marcelina.davis@example.com", "state": "pending", "approved_at": null, + "waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }, diff --git a/tests/Service/EventsTest.php b/tests/Service/EventsTest.php index 123fe6c8..d022c0eb 100644 --- a/tests/Service/EventsTest.php +++ b/tests/Service/EventsTest.php @@ -39,7 +39,7 @@ public function testPaginationBoundary(): void $fixture['list_metadata']['before'] = null; $fixture['list_metadata']['after'] = null; $client = $this->createMockClient([['status' => 200, 'body' => $fixture]]); - $result = $client->events()->listEvents(); + $result = $client->events()->listEvents(events: []); $this->assertInstanceOf(\WorkOS\PaginatedResponse::class, $result); // Verify cursors are null on boundary page $this->assertNull($result->listMetadata['before']); From 4f56d7c7ef38932d5a57809584fd5c6ff66118e5 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:12:32 +0000 Subject: [PATCH 2/4] feat(user_management)!: SDK surface change: Parameter type changed for "verificationId" on "UserManagement.authenticateWithRadarSmsChallenge" --- lib/Resource/CreateUser.php | 6 +++++- lib/Resource/CreateUserPasswordSaltPosition.php | 13 +++++++++++++ lib/Resource/UpdateUser.php | 6 +++++- lib/Service/UserManagement.php | 14 ++++++++++---- tests/Fixtures/create_user.json | 3 ++- tests/Fixtures/update_user.json | 3 ++- tests/Service/UserManagementTest.php | 2 +- 7 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 lib/Resource/CreateUserPasswordSaltPosition.php diff --git a/lib/Resource/CreateUser.php b/lib/Resource/CreateUser.php index 7057f093..d41fa312 100644 --- a/lib/Resource/CreateUser.php +++ b/lib/Resource/CreateUser.php @@ -34,12 +34,14 @@ public function __construct( public ?string $userAgent = null, /** An optional Radar signals ID to correlate client-side signals with this request. */ public ?string $signalsId = null, - /** The password to set for the user. Mutually exclusive with `password_hash` and `password_hash_type`. */ + /** The password to set for the user. Mutually exclusive with `password_hash`, `password_hash_type`, and `password_salt_position`. */ public ?string $password = null, /** The hashed password to set for the user. Required with `password_hash_type`. Mutually exclusive with `password`. */ public ?string $passwordHash = null, /** The algorithm originally used to hash the password, used when providing a `password_hash`. Required with `password_hash`. Mutually exclusive with `password`. */ public ?CreateUserPasswordHashType $passwordHashType = null, + /** The position of the salt relative to the password when the `password_hash` digest was computed: `prefix` for `hash(salt + password)` or `suffix` for `hash(password + salt)`. Only supported with the `ssha256` hash type and only valid when a `password_hash` is provided. Defaults to `suffix`. Mutually exclusive with `password`. */ + public ?CreateUserPasswordSaltPosition $passwordSaltPosition = null, ) { } @@ -59,6 +61,7 @@ public static function fromArray(array $data): self password: $data['password'] ?? null, passwordHash: $data['password_hash'] ?? null, passwordHashType: isset($data['password_hash_type']) ? CreateUserPasswordHashType::from($data['password_hash_type']) : null, + passwordSaltPosition: isset($data['password_salt_position']) ? CreateUserPasswordSaltPosition::from($data['password_salt_position']) : null, ); } @@ -78,6 +81,7 @@ public function toArray(): array 'password' => $this->password, 'password_hash' => $this->passwordHash, 'password_hash_type' => $this->passwordHashType?->value, + 'password_salt_position' => $this->passwordSaltPosition?->value, ]; } } diff --git a/lib/Resource/CreateUserPasswordSaltPosition.php b/lib/Resource/CreateUserPasswordSaltPosition.php new file mode 100644 index 00000000..a35ee092 --- /dev/null +++ b/lib/Resource/CreateUserPasswordSaltPosition.php @@ -0,0 +1,13 @@ + $this->password, 'password_hash' => $this->passwordHash, 'password_hash_type' => $this->passwordHashType?->value, + 'password_salt_position' => $this->passwordSaltPosition?->value, ]; } } diff --git a/lib/Service/UserManagement.php b/lib/Service/UserManagement.php index 911aaef5..d79661a0 100644 --- a/lib/Service/UserManagement.php +++ b/lib/Service/UserManagement.php @@ -418,8 +418,8 @@ public function authenticateWithRadarEmailChallenge( /** * @param string $code - * @param string $verificationId - * @param string $phoneNumber + * @param string|null $verificationId + * @param string|null $phoneNumber * @param string $pendingAuthenticationToken * @param string|null $ipAddress * @param string|null $deviceId @@ -429,9 +429,9 @@ public function authenticateWithRadarEmailChallenge( */ public function authenticateWithRadarSmsChallenge( string $code, - string $verificationId, - string $phoneNumber, string $pendingAuthenticationToken, + ?string $verificationId = null, + ?string $phoneNumber = null, ?string $ipAddress = null, ?string $deviceId = null, ?string $userAgent = null, @@ -884,6 +884,9 @@ public function createUser( } elseif ($password instanceof PasswordHashed) { $body['password_hash'] = $password->hash; $body['password_hash_type'] = $password->hashType; + if ($password->saltPosition !== null) { + $body['password_salt_position'] = $password->saltPosition; + } } $response = $this->client->request( method: 'POST', @@ -979,6 +982,9 @@ public function updateUser( } elseif ($password instanceof PasswordHashed) { $body['password_hash'] = $password->hash; $body['password_hash_type'] = $password->hashType; + if ($password->saltPosition !== null) { + $body['password_salt_position'] = $password->saltPosition; + } } $response = $this->client->request( method: 'PUT', diff --git a/tests/Fixtures/create_user.json b/tests/Fixtures/create_user.json index a851bca9..3426c4df 100644 --- a/tests/Fixtures/create_user.json +++ b/tests/Fixtures/create_user.json @@ -13,5 +13,6 @@ "signals_id": "01JBS0GN92GC2RJQS4X9DBPQ2A", "password": "strong_password_123!", "password_hash": "$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy", - "password_hash_type": "bcrypt" + "password_hash_type": "bcrypt", + "password_salt_position": "prefix" } diff --git a/tests/Fixtures/update_user.json b/tests/Fixtures/update_user.json index d00ee5ca..ba548aa5 100644 --- a/tests/Fixtures/update_user.json +++ b/tests/Fixtures/update_user.json @@ -11,5 +11,6 @@ "locale": "en-US", "password": "strong_password_123!", "password_hash": "$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy", - "password_hash_type": "bcrypt" + "password_hash_type": "bcrypt", + "password_salt_position": "prefix" } diff --git a/tests/Service/UserManagementTest.php b/tests/Service/UserManagementTest.php index 8a9566d5..3e091e60 100644 --- a/tests/Service/UserManagementTest.php +++ b/tests/Service/UserManagementTest.php @@ -714,7 +714,7 @@ public function testAuthenticateWithRadarSmsChallenge(): void { $fixture = $this->loadFixture('authenticate_response'); $client = $this->createMockClient([['status' => 200, 'body' => $fixture]]); - $result = $client->userManagement()->authenticateWithRadarSmsChallenge(code: 'test_value', verificationId: 'test_value', phoneNumber: 'test_value', pendingAuthenticationToken: 'test_value'); + $result = $client->userManagement()->authenticateWithRadarSmsChallenge(code: 'test_value', pendingAuthenticationToken: 'test_value'); $this->assertInstanceOf(\WorkOS\Resource\AuthenticateResponse::class, $result); } From f6e0ef327059bb8aa3e4add4f2ebba222939fcd2 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:12:32 +0000 Subject: [PATCH 3/4] chore(generated): regenerate shared files for AdminPortal, Agents, ApiKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, Pipes, PipesProvider, Radar, SSO, UserManagement, Vault, Webhooks, Widgets --- .last-synced-sha | 2 +- .oagen-manifest.json | 11 ++++ lib/Resource/AgentRegistrationRefreshed.php | 50 ++++++++++++++++++ .../AgentRegistrationRefreshedData.php | 33 ++++++++++++ ...thenticateResponseAuthenticationMethod.php | 2 + lib/Resource/ConnectedAccount.php | 15 ++++++ .../ConnectionDeletedDataConnectionType.php | 2 + lib/Resource/ConnectionType.php | 2 + lib/Resource/ConnectionsConnectionType.php | 2 + lib/Resource/CreateDataIntegration.php | 8 +-- lib/Resource/CustomProviderDefinition.php | 12 ++--- lib/Resource/DataIntegration.php | 10 ++-- lib/Resource/DataIntegrationCredential.php | 1 - ...grationsUpsertClientCredentialsRequest.php | 51 +++++++++++++++++++ ...hallengeCodeSessionAuthenticateRequest.php | 14 ++--- .../UserIdentitiesGetItemProvider.php | 2 + lib/Service/Groups.php | 3 ++ lib/Service/PasswordHashed.php | 1 + lib/Service/Pipes.php | 44 ++++++++++++++-- .../agent_registration_refreshed.json | 29 +++++++++++ .../agent_registration_refreshed_data.json | 3 ++ .../configure_data_integration_body.json | 2 +- tests/Fixtures/connected_account.json | 5 ++ tests/Fixtures/create_data_integration.json | 2 +- tests/Fixtures/data_integration.json | 2 +- ...ta_integration_configuration_response.json | 2 +- ...ons_upsert_client_credentials_request.json | 9 ++++ tests/Service/GroupsTest.php | 3 +- tests/Service/PipesTest.php | 18 +++++++ 29 files changed, 308 insertions(+), 32 deletions(-) create mode 100644 lib/Resource/AgentRegistrationRefreshed.php create mode 100644 lib/Resource/AgentRegistrationRefreshedData.php create mode 100644 lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php create mode 100644 tests/Fixtures/agent_registration_refreshed.json create mode 100644 tests/Fixtures/agent_registration_refreshed_data.json create mode 100644 tests/Fixtures/data_integrations_upsert_client_credentials_request.json diff --git a/.last-synced-sha b/.last-synced-sha index 93c9c21a..066427ca 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -ae3ebbb08d9b4bf9b2391558e820b7eb6f511fb9 +a07d8e7988d035c2d727787f18f64d71b4b89a84 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index b1abfb35..70b59a61 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -37,6 +37,8 @@ "lib/Resource/AgentRegistrationKind.php", "lib/Resource/AgentRegistrationOrganizationSwitched.php", "lib/Resource/AgentRegistrationOrganizationSwitchedData.php", + "lib/Resource/AgentRegistrationRefreshed.php", + "lib/Resource/AgentRegistrationRefreshedData.php", "lib/Resource/AgentRegistrationRevoked.php", "lib/Resource/AgentRegistrationRevokedData.php", "lib/Resource/AgentRegistrationStatus.php", @@ -221,6 +223,7 @@ "lib/Resource/CreateUserInviteOptionsLocale.php", "lib/Resource/CreateUserOrganizationMembership.php", "lib/Resource/CreateUserPasswordHashType.php", + "lib/Resource/CreateUserPasswordSaltPosition.php", "lib/Resource/CreateWebhookEndpoint.php", "lib/Resource/CreateWebhookEndpointEvents.php", "lib/Resource/CustomProviderDefinition.php", @@ -250,6 +253,7 @@ "lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php", "lib/Resource/DataIntegrationsListResponseDataOwnership.php", "lib/Resource/DataIntegrationsUpsertApiKeyRequest.php", + "lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php", "lib/Resource/DataIntegrationsVendCredentialsRequest.php", "lib/Resource/DecryptRequest.php", "lib/Resource/DecryptResponse.php", @@ -666,6 +670,8 @@ "tests/Fixtures/agent_registration_expired_data.json", "tests/Fixtures/agent_registration_organization_switched.json", "tests/Fixtures/agent_registration_organization_switched_data.json", + "tests/Fixtures/agent_registration_refreshed.json", + "tests/Fixtures/agent_registration_refreshed_data.json", "tests/Fixtures/agent_registration_revoked.json", "tests/Fixtures/agent_registration_revoked_data.json", "tests/Fixtures/api_key.json", @@ -848,6 +854,7 @@ "tests/Fixtures/data_integrations_list_response_data.json", "tests/Fixtures/data_integrations_list_response_data_connected_account.json", "tests/Fixtures/data_integrations_upsert_api_key_request.json", + "tests/Fixtures/data_integrations_upsert_client_credentials_request.json", "tests/Fixtures/data_integrations_vend_credentials_request.json", "tests/Fixtures/decrypt_request.json", "tests/Fixtures/decrypt_response.json", @@ -2057,6 +2064,10 @@ "GET /audit_logs/exports/{auditLogExportId}": { "sdkMethod": "getExport", "service": "auditLogs" + }, + "PUT /data-integrations/{slug}/client-credentials": { + "sdkMethod": "updateDataIntegrationClientCredentials", + "service": "pipes" } } } diff --git a/lib/Resource/AgentRegistrationRefreshed.php b/lib/Resource/AgentRegistrationRefreshed.php new file mode 100644 index 00000000..4c70ecad --- /dev/null +++ b/lib/Resource/AgentRegistrationRefreshed.php @@ -0,0 +1,50 @@ + $this->object, + 'id' => $this->id, + 'event' => $this->event, + 'data' => $this->data->toArray(), + 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), + 'context' => $this->context?->toArray(), + ]; + } +} diff --git a/lib/Resource/AgentRegistrationRefreshedData.php b/lib/Resource/AgentRegistrationRefreshedData.php new file mode 100644 index 00000000..bcf2e9e4 --- /dev/null +++ b/lib/Resource/AgentRegistrationRefreshedData.php @@ -0,0 +1,33 @@ + $this->agentRegistrationId, + ]; + } +} diff --git a/lib/Resource/AuthenticateResponseAuthenticationMethod.php b/lib/Resource/AuthenticateResponseAuthenticationMethod.php index ad41b642..0163b03f 100644 --- a/lib/Resource/AuthenticateResponseAuthenticationMethod.php +++ b/lib/Resource/AuthenticateResponseAuthenticationMethod.php @@ -19,6 +19,8 @@ enum AuthenticateResponseAuthenticationMethod: string case GitHubOAuth = 'GitHubOAuth'; case GitLabOAuth = 'GitLabOAuth'; case GoogleOAuth = 'GoogleOAuth'; + case GrokOAuth = 'GrokOAuth'; + case XoAuth = 'XOAuth'; case IntuitOAuth = 'IntuitOAuth'; case LinkedInOAuth = 'LinkedInOAuth'; case MicrosoftOAuth = 'MicrosoftOAuth'; diff --git a/lib/Resource/ConnectedAccount.php b/lib/Resource/ConnectedAccount.php index 81da0725..b4c74977 100644 --- a/lib/Resource/ConnectedAccount.php +++ b/lib/Resource/ConnectedAccount.php @@ -39,6 +39,15 @@ public function __construct( public ?DataIntegrationAuthMethods $authMethod = null, /** The last four characters of the API key, or `null` for OAuth connections. */ public ?string $apiKeyLast4 = null, + /** The client ID supplied for this connection. Only present when `auth_method` is `client_credentials`. */ + public ?string $clientId = null, + /** The last four characters of the client secret supplied for this connection, or `null` when it can't be read. Only present when `auth_method` is `client_credentials`. */ + public ?string $clientSecretLast4 = null, + /** + * The connection-level configuration values stored for this connection — the fields the provider declares at `installation` scope, excluding any it declares as secret. Only present when `auth_method` is `client_credentials`. + * @var array|null + */ + public ?array $config = null, ) { } @@ -55,6 +64,9 @@ public static function fromArray(array $data): self updatedAt: $data['updated_at'], authMethod: isset($data['auth_method']) ? DataIntegrationAuthMethods::from($data['auth_method']) : null, apiKeyLast4: $data['api_key_last_4'] ?? null, + clientId: $data['client_id'] ?? null, + clientSecretLast4: $data['client_secret_last_4'] ?? null, + config: $data['config'] ?? null, ); } @@ -71,6 +83,9 @@ public function toArray(): array 'updated_at' => $this->updatedAt, 'auth_method' => $this->authMethod?->value, 'api_key_last_4' => $this->apiKeyLast4, + 'client_id' => $this->clientId, + 'client_secret_last_4' => $this->clientSecretLast4, + 'config' => $this->config, ]; } } diff --git a/lib/Resource/ConnectionDeletedDataConnectionType.php b/lib/Resource/ConnectionDeletedDataConnectionType.php index fe8afac0..98ed43be 100644 --- a/lib/Resource/ConnectionDeletedDataConnectionType.php +++ b/lib/Resource/ConnectionDeletedDataConnectionType.php @@ -30,6 +30,8 @@ enum ConnectionDeletedDataConnectionType: string case GoogleOAuth = 'GoogleOAuth'; case GoogleOidc = 'GoogleOIDC'; case GoogleSAML = 'GoogleSAML'; + case GrokOAuth = 'GrokOAuth'; + case XoAuth = 'XOAuth'; case IntuitOAuth = 'IntuitOAuth'; case JumpCloudSAML = 'JumpCloudSAML'; case KeycloakSAML = 'KeycloakSAML'; diff --git a/lib/Resource/ConnectionType.php b/lib/Resource/ConnectionType.php index a1f3d800..09884899 100644 --- a/lib/Resource/ConnectionType.php +++ b/lib/Resource/ConnectionType.php @@ -31,6 +31,8 @@ enum ConnectionType: string case GoogleOAuth = 'GoogleOAuth'; case GoogleOidc = 'GoogleOIDC'; case GoogleSAML = 'GoogleSAML'; + case GrokOAuth = 'GrokOAuth'; + case XoAuth = 'XOAuth'; case IntuitOAuth = 'IntuitOAuth'; case JumpCloudSAML = 'JumpCloudSAML'; case KeycloakSAML = 'KeycloakSAML'; diff --git a/lib/Resource/ConnectionsConnectionType.php b/lib/Resource/ConnectionsConnectionType.php index 484769f5..6c387ab7 100644 --- a/lib/Resource/ConnectionsConnectionType.php +++ b/lib/Resource/ConnectionsConnectionType.php @@ -29,6 +29,8 @@ enum ConnectionsConnectionType: string case GoogleOAuth = 'GoogleOAuth'; case GoogleOidc = 'GoogleOIDC'; case GoogleSAML = 'GoogleSAML'; + case GrokOAuth = 'GrokOAuth'; + case XoAuth = 'XOAuth'; case IntuitOAuth = 'IntuitOAuth'; case JumpCloudSAML = 'JumpCloudSAML'; case KeycloakSAML = 'KeycloakSAML'; diff --git a/lib/Resource/CreateDataIntegration.php b/lib/Resource/CreateDataIntegration.php index ed29c2f8..14016a21 100644 --- a/lib/Resource/CreateDataIntegration.php +++ b/lib/Resource/CreateDataIntegration.php @@ -23,12 +23,12 @@ public function __construct( */ public ?array $scopes = null, /** - * How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). - * @var array<\WorkOS\Resource\CreateDataIntegrationAuthMethods>|null + * How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). Use `["client_credentials"]` to declare a client-credentials integration; `credentials` is likewise not required and client credentials are supplied per-tenant. + * @var array<\WorkOS\Resource\DataIntegrationAuthMethods>|null */ public ?array $authMethods = null, /** - * Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted. + * Provider-specific config values (e.g. a Snowflake `account`), keyed by the config field. Only fields the built-in provider declares are accepted. * @var array|null */ public ?array $config = null, @@ -48,7 +48,7 @@ public static function fromArray(array $data): self description: $data['description'] ?? null, enabled: $data['enabled'] ?? null, scopes: $data['scopes'] ?? null, - authMethods: isset($data['auth_methods']) ? array_map(fn ($item) => CreateDataIntegrationAuthMethods::from($item), $data['auth_methods']) : null, + authMethods: isset($data['auth_methods']) ? array_map(fn ($item) => DataIntegrationAuthMethods::from($item), $data['auth_methods']) : null, config: $data['config'] ?? null, credentials: isset($data['credentials']) ? DataIntegrationCredentialsInput::fromArray($data['credentials']) : null, apiKey: isset($data['api_key']) ? ApiKeyInstallation::fromArray($data['api_key']) : null, diff --git a/lib/Resource/CustomProviderDefinition.php b/lib/Resource/CustomProviderDefinition.php index 6b97d21d..0f95530c 100644 --- a/lib/Resource/CustomProviderDefinition.php +++ b/lib/Resource/CustomProviderDefinition.php @@ -13,10 +13,10 @@ public function __construct( /** A descriptive name for the custom provider. */ public string $name, - /** The provider's OAuth authorization endpoint. */ - public string $authorizationUrl, - /** The provider's OAuth token endpoint. */ - public string $tokenUrl, + /** The provider's OAuth authorization endpoint. Required for OAuth providers; omit for `api_key` providers. */ + public ?string $authorizationUrl = null, + /** The provider's OAuth token endpoint. Required for OAuth providers; omit for `api_key` providers. */ + public ?string $tokenUrl = null, /** The endpoint used to refresh tokens, if different from the token endpoint. */ public ?string $refreshTokenUrl = null, /** Whether PKCE is used during the authorization code flow. Defaults to `true`. */ @@ -43,8 +43,8 @@ public static function fromArray(array $data): self { return new self( name: $data['name'], - authorizationUrl: $data['authorization_url'], - tokenUrl: $data['token_url'], + authorizationUrl: $data['authorization_url'] ?? null, + tokenUrl: $data['token_url'] ?? null, refreshTokenUrl: $data['refresh_token_url'] ?? null, pkceEnabled: $data['pkce_enabled'] ?? null, requestScopeSeparator: $data['request_scope_separator'] ?? null, diff --git a/lib/Resource/DataIntegration.php b/lib/Resource/DataIntegration.php index 564d2327..18e89b7c 100644 --- a/lib/Resource/DataIntegration.php +++ b/lib/Resource/DataIntegration.php @@ -37,12 +37,12 @@ public function __construct( * @var array<\WorkOS\Resource\DataIntegrationAuthMethods> */ public array $authMethods, - /** The credentials configured for the Data Integration. */ - public DataIntegrationCredential $credentials, + /** The integration-level OAuth app credentials. `null` for `api_key` integrations, which hold no OAuth credentials (keys are installed per-tenant). */ + public ?DataIntegrationCredential $credentials, /** The tenant installation created when an API key was supplied at creation time; `null` otherwise. Not populated on list/get responses. */ public ?DataIntegrationInstallation $installation, /** - * Provider-specific config values set on the Data Integration (e.g. a Snowflake `account_identifier`), keyed by config field. Only fields the provider declares are accepted. + * Provider-specific config values set on the Data Integration (e.g. a Snowflake `account`), keyed by config field. Only fields the provider declares are accepted. * @var array */ public array $config, @@ -68,7 +68,7 @@ public static function fromArray(array $data): self scopes: $data['scopes'] ?? null, redirectUri: $data['redirect_uri'], authMethods: array_map(fn ($item) => DataIntegrationAuthMethods::from($item), $data['auth_methods']), - credentials: DataIntegrationCredential::fromArray($data['credentials']), + credentials: isset($data['credentials']) ? DataIntegrationCredential::fromArray($data['credentials']) : null, installation: isset($data['installation']) ? DataIntegrationInstallation::fromArray($data['installation']) : null, config: $data['config'], customProvider: isset($data['custom_provider']) ? DataIntegrationCustomProvider::fromArray($data['custom_provider']) : null, @@ -90,7 +90,7 @@ public function toArray(): array 'scopes' => $this->scopes, 'redirect_uri' => $this->redirectUri, 'auth_methods' => array_map(fn ($item) => $item->value, $this->authMethods), - 'credentials' => $this->credentials->toArray(), + 'credentials' => $this->credentials?->toArray(), 'installation' => $this->installation?->toArray(), 'config' => $this->config, 'custom_provider' => $this->customProvider?->toArray(), diff --git a/lib/Resource/DataIntegrationCredential.php b/lib/Resource/DataIntegrationCredential.php index dd0b67ee..36c6882d 100644 --- a/lib/Resource/DataIntegrationCredential.php +++ b/lib/Resource/DataIntegrationCredential.php @@ -6,7 +6,6 @@ namespace WorkOS\Resource; -/** The credentials configured for the Data Integration. */ readonly class DataIntegrationCredential implements \JsonSerializable { use JsonSerializableTrait; diff --git a/lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php b/lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php new file mode 100644 index 00000000..570dba28 --- /dev/null +++ b/lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php @@ -0,0 +1,51 @@ +|null + */ + public ?array $config = null, + ) { + } + + public static function fromArray(array $data): self + { + return new self( + userId: $data['user_id'], + clientId: $data['client_id'], + clientSecret: $data['client_secret'], + organizationId: $data['organization_id'] ?? null, + config: $data['config'] ?? null, + ); + } + + public function toArray(): array + { + return [ + 'user_id' => $this->userId, + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + 'organization_id' => $this->organizationId, + 'config' => $this->config, + ]; + } +} diff --git a/lib/Resource/RadarSmsChallengeCodeSessionAuthenticateRequest.php b/lib/Resource/RadarSmsChallengeCodeSessionAuthenticateRequest.php index fe1d52b1..04db5369 100644 --- a/lib/Resource/RadarSmsChallengeCodeSessionAuthenticateRequest.php +++ b/lib/Resource/RadarSmsChallengeCodeSessionAuthenticateRequest.php @@ -18,12 +18,12 @@ public function __construct( public string $grantType, /** The one-time code from the Radar SMS challenge. */ public string $code, - /** The ID of the Radar SMS verification being confirmed. */ - public string $verificationId, - /** The phone number the Radar SMS challenge was sent to. */ - public string $phoneNumber, /** The pending authentication token from a previous authentication attempt. */ public string $pendingAuthenticationToken, + /** The ID of the Radar SMS verification being confirmed. Required for sign-up challenges; omitted for sign-in challenges, where the verification is resolved server-side. */ + public ?string $verificationId = null, + /** The phone number the Radar SMS challenge was sent to. Required for sign-up challenges; omitted for sign-in challenges, where the phone number on file is resolved server-side. */ + public ?string $phoneNumber = null, /** The IP address of the user's request. */ public ?string $ipAddress = null, /** A unique identifier for the device. */ @@ -40,9 +40,9 @@ public static function fromArray(array $data): self clientSecret: $data['client_secret'], grantType: $data['grant_type'] ?? 'urn:workos:oauth:grant-type:radar-sms-challenge:code', code: $data['code'], - verificationId: $data['verification_id'], - phoneNumber: $data['phone_number'], pendingAuthenticationToken: $data['pending_authentication_token'], + verificationId: $data['verification_id'] ?? null, + phoneNumber: $data['phone_number'] ?? null, ipAddress: $data['ip_address'] ?? null, deviceId: $data['device_id'] ?? null, userAgent: $data['user_agent'] ?? null, @@ -56,9 +56,9 @@ public function toArray(): array 'client_secret' => $this->clientSecret, 'grant_type' => $this->grantType, 'code' => $this->code, + 'pending_authentication_token' => $this->pendingAuthenticationToken, 'verification_id' => $this->verificationId, 'phone_number' => $this->phoneNumber, - 'pending_authentication_token' => $this->pendingAuthenticationToken, 'ip_address' => $this->ipAddress, 'device_id' => $this->deviceId, 'user_agent' => $this->userAgent, diff --git a/lib/Resource/UserIdentitiesGetItemProvider.php b/lib/Resource/UserIdentitiesGetItemProvider.php index 6c4564a9..6c262dd5 100644 --- a/lib/Resource/UserIdentitiesGetItemProvider.php +++ b/lib/Resource/UserIdentitiesGetItemProvider.php @@ -14,6 +14,8 @@ enum UserIdentitiesGetItemProvider: string case GithubOAuth = 'GithubOAuth'; case GitLabOAuth = 'GitLabOAuth'; case GoogleOAuth = 'GoogleOAuth'; + case GrokOAuth = 'GrokOAuth'; + case XoAuth = 'XOAuth'; case IntuitOAuth = 'IntuitOAuth'; case LinkedInOAuth = 'LinkedInOAuth'; case MicrosoftOAuth = 'MicrosoftOAuth'; diff --git a/lib/Service/Groups.php b/lib/Service/Groups.php index 6012141b..257086dc 100644 --- a/lib/Service/Groups.php +++ b/lib/Service/Groups.php @@ -25,6 +25,7 @@ public function __construct( * @param string|null $after An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\PaginationOrder $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to "desc". + * @param string|null $search Search groups by name or by group ID. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Group> * @throws \WorkOS\Exception\WorkOSException */ @@ -34,6 +35,7 @@ public function listOrganizationGroups( ?string $after = null, ?int $limit = null, \WorkOS\Resource\PaginationOrder $order = \WorkOS\Resource\PaginationOrder::Desc, + ?string $search = null, ?\WorkOS\RequestOptions $options = null, ): \WorkOS\PaginatedResponse { $query = array_filter([ @@ -41,6 +43,7 @@ public function listOrganizationGroups( 'after' => $after, 'limit' => $limit, 'order' => $order->value, + 'search' => $search, ], fn ($v) => $v !== null); return $this->client->requestPage( method: 'GET', diff --git a/lib/Service/PasswordHashed.php b/lib/Service/PasswordHashed.php index 11b94a27..18d77938 100644 --- a/lib/Service/PasswordHashed.php +++ b/lib/Service/PasswordHashed.php @@ -11,6 +11,7 @@ class PasswordHashed public function __construct( public readonly string $hash, public readonly \WorkOS\Resource\CreateUserPasswordHashType $hashType, + public readonly ?\WorkOS\Resource\CreateUserPasswordSaltPosition $saltPosition = null, ) { } } diff --git a/lib/Service/Pipes.php b/lib/Service/Pipes.php index 3bb839f9..25d8a2dd 100644 --- a/lib/Service/Pipes.php +++ b/lib/Service/Pipes.php @@ -56,13 +56,13 @@ public function listDataIntegrations( /** * Create a data integration * - * Creates a data integration for a provider. Set `credentials.type` to `custom` to use your own OAuth app credentials or `organization` to have each organization supply its own. Set `auth_methods` to `["api_key"]` to create an API key integration; you may optionally supply an `api_key` block to install a first tenant in the same call. For a built-in provider, pass its slug as `provider`. For a custom provider, pass a new slug plus a `custom_provider` definition. + * Creates a data integration for a provider. Set `credentials.type` to `custom` to use your own OAuth app credentials or `organization` to have each organization supply its own. Set `auth_methods` to `["api_key"]` to create an API key integration; you may optionally supply an `api_key` block to install a first tenant in the same call. Set `auth_methods` to `["client_credentials"]` to create a client-credentials integration; client credentials are installed per-tenant afterwards. For a built-in provider, pass its slug as `provider`. For a custom provider, pass a new slug plus a `custom_provider` definition. * @param string $provider The provider to create a Data Integration for. For a built-in provider use its slug (e.g. `github`, `slack`). For a custom provider, this is the new provider slug and `custom_provider` must be supplied. A custom provider slug cannot shadow an existing global provider slug. * @param string|null $description An optional description of the Data Integration. * @param bool|null $enabled Whether the Data Integration is enabled. Defaults to `false`. * @param array|null $scopes The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted. - * @param array<\WorkOS\Resource\CreateDataIntegrationAuthMethods>|null $authMethods How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). - * @param array|null $config Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted. + * @param array<\WorkOS\Resource\DataIntegrationAuthMethods>|null $authMethods How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). Use `["client_credentials"]` to declare a client-credentials integration; `credentials` is likewise not required and client credentials are supplied per-tenant. + * @param array|null $config Provider-specific config values (e.g. a Snowflake `account`), keyed by the config field. Only fields the built-in provider declares are accepted. * @param \WorkOS\Resource\DataIntegrationCredentialsInput|null $credentials The OAuth credentials to configure for the Data Integration. Required for OAuth integrations; omit when `auth_methods` is `["api_key"]`. * @param \WorkOS\Resource\ApiKeyInstallation|null $apiKey An optional API key to install for the first tenant on an `api_key` integration. Omit to declare a keyless integration; tenants can be added later via the per-installation API key path. * @param \WorkOS\Resource\CustomProviderDefinition|null $customProvider The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider. @@ -248,6 +248,44 @@ public function authorizeDataIntegration( return DataIntegrationAuthorizeUrlResponse::fromArray($response); } + /** + * Upsert client credentials for a connected account + * + * Creates or updates a client-credentials-based installation for the specified integration and user. If an installation already exists, the stored client credentials are rotated to the new values. + * @param string $slug The identifier of the integration. + * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. + * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + * @param string $clientId The OAuth client ID to store for this integration. + * @param string $clientSecret The OAuth client secret to store for this integration. + * @param array|null $config Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors. + * @return \WorkOS\Resource\ConnectedAccount + * @throws \WorkOS\Exception\WorkOSException + */ + public function updateDataIntegrationClientCredentials( + string $slug, + string $userId, + string $clientId, + string $clientSecret, + ?string $organizationId = null, + ?array $config = null, + ?\WorkOS\RequestOptions $options = null, + ): \WorkOS\Resource\ConnectedAccount { + $body = array_filter([ + 'user_id' => $userId, + 'organization_id' => $organizationId, + 'client_id' => $clientId, + 'client_secret' => $clientSecret, + 'config' => $config, + ], fn ($v) => $v !== null); + $response = $this->client->request( + method: 'PUT', + path: 'data-integrations/' . rawurlencode($slug) . '/client-credentials', + body: $body, + options: $options, + ); + return ConnectedAccount::fromArray($response); + } + /** * Vend credentials for a connected account * diff --git a/tests/Fixtures/agent_registration_refreshed.json b/tests/Fixtures/agent_registration_refreshed.json new file mode 100644 index 00000000..5f7b4c48 --- /dev/null +++ b/tests/Fixtures/agent_registration_refreshed.json @@ -0,0 +1,29 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "agent.registration.refreshed", + "data": { + "agent_registration_id": "agent_reg_01EHWNCE74X7JSDV0X3SZ3KJNY" + }, + "created_at": "2026-01-15T12:00:00.000Z", + "context": { + "google_analytics_client_id": "GA1.2.1234567890.1234567890", + "google_analytics_sessions": [ + { + "containerId": "GTM-ABCDEF", + "sessionId": "1234567890", + "sessionNumber": "1" + } + ], + "ajs_anonymous_id": "ajs_anon_01EHWNCE74X7JSDV0X3SZ3KJNY", + "client_id": "client_01EHWNCE74X7JSDV0X3SZ3KJNY", + "actor": { + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "source": "api", + "name": "Jane Doe" + }, + "previous_attributes": { + "key": {} + } + } +} diff --git a/tests/Fixtures/agent_registration_refreshed_data.json b/tests/Fixtures/agent_registration_refreshed_data.json new file mode 100644 index 00000000..f7cb2dcb --- /dev/null +++ b/tests/Fixtures/agent_registration_refreshed_data.json @@ -0,0 +1,3 @@ +{ + "agent_registration_id": "agent_reg_01EHWNCE74X7JSDV0X3SZ3KJNY" +} diff --git a/tests/Fixtures/configure_data_integration_body.json b/tests/Fixtures/configure_data_integration_body.json index e84badb1..8ae8dfe1 100644 --- a/tests/Fixtures/configure_data_integration_body.json +++ b/tests/Fixtures/configure_data_integration_body.json @@ -7,6 +7,6 @@ "client_id": "client_01EHZNVPK3SFK441A1RGBFSHRT", "client_secret": "••••••••", "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" } } diff --git a/tests/Fixtures/connected_account.json b/tests/Fixtures/connected_account.json index 4417fc9b..a863395d 100644 --- a/tests/Fixtures/connected_account.json +++ b/tests/Fixtures/connected_account.json @@ -9,6 +9,11 @@ ], "auth_method": "oauth", "api_key_last_4": null, + "client_id": "3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc", + "client_secret_last_4": "cdef", + "config": { + "instance_url": "https://example.my.salesforce.com" + }, "state": "connected", "created_at": "2024-01-16T14:20:00.000Z", "updated_at": "2024-01-16T14:20:00.000Z" diff --git a/tests/Fixtures/create_data_integration.json b/tests/Fixtures/create_data_integration.json index 57aea096..311643a1 100644 --- a/tests/Fixtures/create_data_integration.json +++ b/tests/Fixtures/create_data_integration.json @@ -10,7 +10,7 @@ "oauth" ], "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" }, "credentials": { "type": "custom", diff --git a/tests/Fixtures/data_integration.json b/tests/Fixtures/data_integration.json index 83c8eac4..5a4a1532 100644 --- a/tests/Fixtures/data_integration.json +++ b/tests/Fixtures/data_integration.json @@ -21,7 +21,7 @@ }, "installation": null, "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" }, "custom_provider": { "name": "My OAuth App", diff --git a/tests/Fixtures/data_integration_configuration_response.json b/tests/Fixtures/data_integration_configuration_response.json index cb3e7abe..3f7d4f23 100644 --- a/tests/Fixtures/data_integration_configuration_response.json +++ b/tests/Fixtures/data_integration_configuration_response.json @@ -10,7 +10,7 @@ "user:email" ], "config": { - "account_identifier": "acme-prod" + "account": "myorg-myaccount" }, "created_at": "2024-01-15T10:30:00.000Z", "updated_at": "2024-01-15T10:30:00.000Z", diff --git a/tests/Fixtures/data_integrations_upsert_client_credentials_request.json b/tests/Fixtures/data_integrations_upsert_client_credentials_request.json new file mode 100644 index 00000000..51b5a18e --- /dev/null +++ b/tests/Fixtures/data_integrations_upsert_client_credentials_request.json @@ -0,0 +1,9 @@ +{ + "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", + "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", + "client_id": "3MVG9...", + "client_secret": "shhh-secret", + "config": { + "mydomain": "acme" + } +} diff --git a/tests/Service/GroupsTest.php b/tests/Service/GroupsTest.php index 1359f241..768cb01a 100644 --- a/tests/Service/GroupsTest.php +++ b/tests/Service/GroupsTest.php @@ -17,7 +17,7 @@ public function testListOrganizationGroups(): void { $fixture = $this->loadFixture('list_group'); $client = $this->createMockClient([['status' => 200, 'body' => $fixture]]); - $result = $client->groups()->listOrganizationGroups('test_organizationId', before: 'test_value', after: 'test_value', limit: 1, order: \WorkOS\Resource\PaginationOrder::Normal); + $result = $client->groups()->listOrganizationGroups('test_organizationId', before: 'test_value', after: 'test_value', limit: 1, order: \WorkOS\Resource\PaginationOrder::Normal, search: 'test_value'); $this->assertInstanceOf(\WorkOS\PaginatedResponse::class, $result); $request = $this->getLastRequest(); $this->assertSame('GET', $request->getMethod()); @@ -27,6 +27,7 @@ public function testListOrganizationGroups(): void $this->assertSame('test_value', $query['after']); $this->assertArrayHasKey('limit', $query); $this->assertSame('normal', $query['order']); + $this->assertSame('test_value', $query['search']); } public function testCreateOrganizationGroup(): void diff --git a/tests/Service/PipesTest.php b/tests/Service/PipesTest.php index 4a43d636..6fa26357 100644 --- a/tests/Service/PipesTest.php +++ b/tests/Service/PipesTest.php @@ -114,6 +114,24 @@ public function testAuthorizeDataIntegration(): void $this->assertSame('test_value', $body['user_id']); } + public function testUpdateDataIntegrationClientCredentials(): void + { + $fixture = $this->loadFixture('connected_account'); + $client = $this->createMockClient([['status' => 200, 'body' => $fixture]]); + $result = $client->pipes()->updateDataIntegrationClientCredentials('test_slug', userId: 'test_value', clientId: 'test_value', clientSecret: 'test_value'); + $this->assertInstanceOf(\WorkOS\Resource\ConnectedAccount::class, $result); + $this->assertSame($fixture['id'], $result->id); + $this->assertSame($fixture['created_at'], $result->createdAt); + $this->assertIsArray($result->toArray()); + $request = $this->getLastRequest(); + $this->assertSame('PUT', $request->getMethod()); + $this->assertStringEndsWith('data-integrations/test_slug/client-credentials', $request->getUri()->getPath()); + $body = json_decode((string) $request->getBody(), true); + $this->assertSame('test_value', $body['user_id']); + $this->assertSame('test_value', $body['client_id']); + $this->assertSame('test_value', $body['client_secret']); + } + public function testCreateDataIntegrationCredential(): void { $fixture = $this->loadFixture('data_integration_credentials_response'); From 23a8d59e4b2a6650f25166235936b7deef736b4a Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:12:40 +0000 Subject: [PATCH 4/4] chore(generated): add release notes fragment --- ...4d55e190f0f722ec4b6c901f4305221e86fb8f7.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .changelog-pending/2026-08-11T17-12-40-c4d55e190f0f722ec4b6c901f4305221e86fb8f7.md diff --git a/.changelog-pending/2026-08-11T17-12-40-c4d55e190f0f722ec4b6c901f4305221e86fb8f7.md b/.changelog-pending/2026-08-11T17-12-40-c4d55e190f0f722ec4b6c901f4305221e86fb8f7.md new file mode 100644 index 00000000..8ae68239 --- /dev/null +++ b/.changelog-pending/2026-08-11T17-12-40-c4d55e190f0f722ec4b6c901f4305221e86fb8f7.md @@ -0,0 +1,53 @@ +* [#428](https://github.com/workos/workos-php/pull/428) feat(generated)!: regenerate from spec (2 changes) + + **⚠️ Breaking** + * **[events](https://workos.com/docs/reference/events)**: + * Changed required status for parameter `Events.list.events` + + **Features** + * **[groups](https://workos.com/docs/reference/groups)**: + * Added parameter `Groups.list.search` + * **[connect](https://workos.com/docs/reference/workos-connect/standalone)**: + * Added `client_id` to `ConnectedAccount` + * Added `client_secret_last_4` to `ConnectedAccount` + * Added `config` to `ConnectedAccount` + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Added `client_id` to `DataIntegrationsListResponseDataConnectedAccount` + * Added `client_secret_last_4` to `DataIntegrationsListResponseDataConnectedAccount` + * Added `config` to `DataIntegrationsListResponseDataConnectedAccount` + * Changed errors for endpoint `POST /data-integrations/{slug}/credentials` + * Made `CustomProviderDefinition.authorization_url` optional + * Made `CustomProviderDefinition.token_url` optional + * Added model `DataIntegrationsUpsertClientCredentialsRequest` + * Added `client_credentials` to `CreateDataIntegrationAuthMethods` + * Added endpoint `PUT /data-integrations/{slug}/client-credentials` + * **[sso](https://workos.com/docs/reference/sso)**: + * Added `XOAuth` to `ConnectionType` + * Added `XOAuth` to `ProfileConnectionType` + * Added `XOAuth` to `ConnectionsConnectionType` + * Added `GrokOAuth` to `ConnectionType` + * Added `GrokOAuth` to `ProfileConnectionType` + * Added `GrokOAuth` to `ConnectionsConnectionType` + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `DELETE /user_management/users/{id}` + * Added `password_salt_position` to `CreateUser` + * Added `password_salt_position` to `UpdateUser` + * Made `RadarSmsChallengeCodeSessionAuthenticateRequest.verification_id` optional + * Made `RadarSmsChallengeCodeSessionAuthenticateRequest.phone_number` optional + * Added enum `CreateUserPasswordSaltPosition` + * Added enum `UpdateUserPasswordSaltPosition` + * Added `XOAuth` to `AuthenticateResponseAuthenticationMethod` + * Added `XOAuth` to `UserIdentitiesGetItemProvider` + * Added `GrokOAuth` to `AuthenticateResponseAuthenticationMethod` + * Added `GrokOAuth` to `UserIdentitiesGetItemProvider` + * **[webhooks](https://workos.com/docs/reference/webhooks)**: + * Added `agent.registration.refreshed` to `CreateWebhookEndpointEvents` + * Added `agent.registration.refreshed` to `UpdateWebhookEndpointEvents` + + **Fixes** + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Changed the type of `DataIntegration.credentials` + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `POST /user_management/authenticate` + * Changed errors for endpoint `POST /user_management/users` + * Changed errors for endpoint `PUT /user_management/users/{id}`