Repository navigation
feat(generated): Changes to directory_sync, sso, webhooks, and 1 more service - #586
workos-sdk-automation[bot] wants to merge 5 commits into
Conversation
…iKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, OrganizationsIssuerTrusts, Pipes, PipesProvider, PlatformTeams, Radar, SSO, UserManagement, Vault, Webhooks, Widgets
[High impact] The update reaches several identity, access, webhook, and risk-detection workflows. Fix the permission request regression and lost Radar details before merging. Findings
Fix with agent prompt### Issue 1
lib/workos/agents/agent_blueprints_create_request.rb:28
Constructing `AgentBlueprintsCreateRequest` with `permissions: ["posts:read"]` now raises `JSON::ParserError`. Every entry goes through `AgentBlueprintsCreateRequestPermission.new`, which treats the slug as JSON. `AgentBlueprintsUpdateRequest` has the same regression, so existing callers cannot build these request models. Keep strings unchanged, wrap only permission hashes, and test a non-empty mixed array.
### Issue 2
lib/workos/radar/radar_detection.rb:52
`RadarDetection` always builds `RadarDetectionEvidence`, which keeps only `summary` and `allowed_by`. For the control-specific evidence shapes added here, this discards `control` and `details`, including bot signals and previous-attempt information. Callers cannot read or save the full reasons for a verdict. Select the matching evidence model or preserve these fields as a hash, and test a populated response through `get_detection`.
### Issue 3
lib/workos/shared/radar_detection_repeat_sign_up_details.rb:6
`RadarDetectionRepeatSignUpDetails` aliases `CreateApplicationSecret`, an empty model that discards its input. `RadarDetectionRestrictionDetails` does the same. Building `RepeatSignUp` with populated email-match details, or `RadarDetectionEvidenceRestriction` with list-match details, therefore produces `details.to_h == {}`. These fields are lost even when callers build the correct outer model directly. Use the matching detail types instead of an empty model.
### Issue 4
lib/workos/sso/connection_saml_certificate_replaced.rb:29
The new `connection.saml_certificate_replaced` event has a data model, but `WebhookEvent::EVENT_DATA_MODELS` does not register it. `construct_event` therefore returns a raw hash, unlike the two existing certificate events. Callers must rebuild the data themselves to use the new model. Register it and add a wrapper test. The new issuer-trust and token-exchange events have the same gap.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR expands several generated services and renames four Directory Sync methods.
The Directory Sync method removals are intentional:
|
| @name = hash[:name] | ||
| @description = hash[:description] | ||
| @permissions = hash[:permissions] || [] | ||
| @permissions = (hash[:permissions] || []).map { |item| item ? WorkOS::AgentBlueprintsCreateRequestPermission.new(item) : nil } |
There was a problem hiding this comment.
Constructing AgentBlueprintsCreateRequest with permissions: ["posts:read"] now raises JSON::ParserError. Every entry goes through AgentBlueprintsCreateRequestPermission.new, which treats the slug as JSON. AgentBlueprintsUpdateRequest has the same regression, so existing callers cannot build these request models. Keep strings unchanged, wrap only permission hashes, and test a non-empty mixed array.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/workos/agents/agent_blueprints_create_request.rb
Line: 28
Comment:
**String permissions now raise**
Constructing `AgentBlueprintsCreateRequest` with `permissions: ["posts:read"]` now raises `JSON::ParserError`. Every entry goes through `AgentBlueprintsCreateRequestPermission.new`, which treats the slug as JSON. `AgentBlueprintsUpdateRequest` has the same regression, so existing callers cannot build these request models. Keep strings unchanged, wrap only permission hashes, and test a non-empty mixed array.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| @control = hash[:control] | ||
| @verdict = hash[:verdict] | ||
| @challenge_type = hash[:challenge_type] | ||
| @evidence = hash[:evidence] ? WorkOS::RadarDetectionEvidence.new(hash[:evidence]) : nil |
There was a problem hiding this comment.
RadarDetection always builds RadarDetectionEvidence, which keeps only summary and allowed_by. For the control-specific evidence shapes added here, this discards control and details, including bot signals and previous-attempt information. Callers cannot read or save the full reasons for a verdict. Select the matching evidence model or preserve these fields as a hash, and test a populated response through get_detection.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/workos/radar/radar_detection.rb
Line: 52
Comment:
**Radar evidence loses details**
`RadarDetection` always builds `RadarDetectionEvidence`, which keeps only `summary` and `allowed_by`. For the control-specific evidence shapes added here, this discards `control` and `details`, including bot signals and previous-attempt information. Callers cannot read or save the full reasons for a verdict. Select the matching evidence model or preserve these fields as a hash, and test a populated response through `get_detection`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| # This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| module WorkOS | ||
| RadarDetectionRepeatSignUpDetails = CreateApplicationSecret |
There was a problem hiding this comment.
RadarDetectionRepeatSignUpDetails aliases CreateApplicationSecret, an empty model that discards its input. RadarDetectionRestrictionDetails does the same. Building RepeatSignUp with populated email-match details, or RadarDetectionEvidenceRestriction with list-match details, therefore produces details.to_h == {}. These fields are lost even when callers build the correct outer model directly. Use the matching detail types instead of an empty model.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/workos/shared/radar_detection_repeat_sign_up_details.rb
Line: 6
Comment:
**Match details become empty**
`RadarDetectionRepeatSignUpDetails` aliases `CreateApplicationSecret`, an empty model that discards its input. `RadarDetectionRestrictionDetails` does the same. Building `RepeatSignUp` with populated email-match details, or `RadarDetectionEvidenceRestriction` with list-match details, therefore produces `details.to_h == {}`. These fields are lost even when callers build the correct outer model directly. Use the matching detail types instead of an empty model.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| @object = hash[:object] | ||
| @id = hash[:id] | ||
| @event = hash[:event] | ||
| @data = hash[:data] ? WorkOS::ConnectionSAMLCertificateReplacedData.new(hash[:data]) : nil |
There was a problem hiding this comment.
New webhook data stays untyped
The new connection.saml_certificate_replaced event has a data model, but WebhookEvent::EVENT_DATA_MODELS does not register it. construct_event therefore returns a raw hash, unlike the two existing certificate events. Callers must rebuild the data themselves to use the new model. Register it and add a wrapper test. The new issuer-trust and token-exchange events have the same gap.
Knowledge Base Used: Events and risk management
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/workos/sso/connection_saml_certificate_replaced.rb
Line: 29
Comment:
**New webhook data stays untyped**
The new `connection.saml_certificate_replaced` event has a data model, but `WebhookEvent::EVENT_DATA_MODELS` does not register it. `construct_event` therefore returns a raw hash, unlike the two existing certificate events. Callers must rebuild the data themselves to use the new model. Register it and add a wrapper test. The new issuer-trust and token-exchange events have the same gap.
**Knowledge Base Used:** [Events and risk management](https://app.greptile.com/-/switch-tenant?tenant=workos&next=%2Fcustom-context%2Fknowledge-base%2Fworkos%2Fworkos-ruby%2F-%2Fdocs%2Fevents-and-risk.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
feat(directory_sync)!: Change directory sync API surface
feat(sso): Add SSO API surface
ConnectionSAMLCertificateReplaced.ConnectionSAMLCertificateReplacedData.ConnectionSAMLCertificateReplacedDataConnection.ConnectionSAMLCertificateReplacedDataCertificate.ConnectionSAMLCertificateReplacedDataCertificateCertificateType.feat(webhooks): Add webhook API surface
connection.saml_certificate_replacedtoCreateWebhookEndpointEvents.connection.saml_certificate_replacedtoUpdateWebhookEndpointEvents.fix(events): Updated model
EventSchemaEventSchema.Triggered by workos/openapi-spec@ddc0648
BEGIN_COMMIT_OVERRIDE
feat(directory_sync): Change directory sync API surface (#586)
feat(sso): Add SSO API surface (#586)
feat(webhooks): Add webhook API surface (#586)
fix(events): Updated model
EventSchema(#586)END_COMMIT_OVERRIDE