Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
* [#511](https://github.com/workos/workos-ruby/pull/511) feat(generated): regenerate from spec (2 changes)

**Features**
* **[radar](https://workos.com/docs/reference/radar)**:
* Added `signals_id` to `RadarStandaloneAssessRequest`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added model `SendRadarSmsChallenge`
* Added model `SendRadarSmsChallengeResponse`
* Added model `UrnWorkosOAuthGrantTypeRadarEmailChallengeCodeSessionAuthenticateRequest`
* Added model `UrnWorkosOAuthGrantTypeRadarSmsChallengeCodeSessionAuthenticateRequest`
* Added model `MagicAuthSendMagicAuthCodeAndReturnResponse`
* Added model `UserCreateResponse`
* Added `ip_address` to `CreateMagicCodeAndReturn`
* Added `user_agent` to `CreateMagicCodeAndReturn`
* Added `radar_auth_attempt_id` to `CreateMagicCodeAndReturn`
* Added `signals_id` to `CreateMagicCodeAndReturn`
* Added `ip_address` to `CreateUser`
* Added `user_agent` to `CreateUser`
* Added `signals_id` to `CreateUser`
* Added `signals_id` to `AuthorizationCodeSessionAuthenticateRequest`
* Added `signals_id` to `PasswordSessionAuthenticateRequest`
* Added `radar_auth_attempt_id` to `PasswordSessionAuthenticateRequest`
* Added `radar_auth_attempt_id` to `UrnWorkosOAuthGrantTypeMagicAuthCodeSessionAuthenticateRequest`
* Added endpoint `POST /user_management/radar_challenges`

**Fixes**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed request body for `UserManagementAuthentication.authenticate`
* Changed response of `UserManagementUsers.create` from `User` to `UserCreateResponse`
* Changed response of `UserManagementMagicAuth.sendMagicAuthCodeAndReturn` from `MagicAuth` to `MagicAuthSendMagicAuthCodeAndReturnResponse`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dc04d30b352063b5c97e45de03be5c83629f5412
4b4e0618779460dbebc1cf5e0f02197c21796d1f
47 changes: 46 additions & 1 deletion .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"language": "ruby",
"generatedAt": "2026-07-01T18:19:13.490Z",
"generatedAt": "2026-07-02T14:11:06.238Z",
"files": [
"lib/workos.rb",
"lib/workos/admin_portal.rb",
Expand Down Expand Up @@ -545,6 +545,7 @@
"lib/workos/user_management/magic_auth_code_session_authenticate_request.rb",
"lib/workos/user_management/magic_auth_created.rb",
"lib/workos/user_management/magic_auth_created_data.rb",
"lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb",
"lib/workos/user_management/mfa_totp_session_authenticate_request.rb",
"lib/workos/user_management/organization_selection_session_authenticate_request.rb",
"lib/workos/user_management/password_reset.rb",
Expand All @@ -553,12 +554,16 @@
"lib/workos/user_management/password_reset_succeeded.rb",
"lib/workos/user_management/password_reset_succeeded_data.rb",
"lib/workos/user_management/password_session_authenticate_request.rb",
"lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb",
"lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb",
"lib/workos/user_management/redirect_uri.rb",
"lib/workos/user_management/refresh_token_session_authenticate_request.rb",
"lib/workos/user_management/resend_user_invite_options.rb",
"lib/workos/user_management/reset_password_response.rb",
"lib/workos/user_management/revoke_session.rb",
"lib/workos/user_management/send_email_change.rb",
"lib/workos/user_management/send_radar_sms_challenge.rb",
"lib/workos/user_management/send_radar_sms_challenge_response.rb",
"lib/workos/user_management/send_verification_email_response.rb",
"lib/workos/user_management/session_created.rb",
"lib/workos/user_management/session_created_data.rb",
Expand All @@ -577,6 +582,7 @@
"lib/workos/user_management/user_api_key_updated_data_owner.rb",
"lib/workos/user_management/user_api_key_with_value.rb",
"lib/workos/user_management/user_api_key_with_value_owner.rb",
"lib/workos/user_management/user_create_response.rb",
"lib/workos/user_management/user_created.rb",
"lib/workos/user_management/user_deleted.rb",
"lib/workos/user_management/user_identities_get_item.rb",
Expand Down Expand Up @@ -933,6 +939,7 @@
"rbi/workos/magic_auth_code_session_authenticate_request.rbi",
"rbi/workos/magic_auth_created.rbi",
"rbi/workos/magic_auth_created_data.rbi",
"rbi/workos/magic_auth_send_magic_auth_code_and_return_response.rbi",
"rbi/workos/mfa_totp_session_authenticate_request.rbi",
"rbi/workos/multi_factor_auth.rbi",
"rbi/workos/new_connect_application_secret.rbi",
Expand Down Expand Up @@ -1008,7 +1015,9 @@
"rbi/workos/portal_link_response.rbi",
"rbi/workos/profile.rbi",
"rbi/workos/radar.rbi",
"rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi",
"rbi/workos/radar_list_entry_already_present_response.rbi",
"rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi",
"rbi/workos/radar_standalone_assess_request.rbi",
"rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi",
"rbi/workos/radar_standalone_response.rbi",
Expand All @@ -1033,6 +1042,8 @@
"rbi/workos/role_updated.rbi",
"rbi/workos/role_updated_data.rbi",
"rbi/workos/send_email_change.rbi",
"rbi/workos/send_radar_sms_challenge.rbi",
"rbi/workos/send_radar_sms_challenge_response.rbi",
"rbi/workos/send_verification_email_response.rbi",
"rbi/workos/session_created.rbi",
"rbi/workos/session_created_data.rbi",
Expand Down Expand Up @@ -1075,6 +1086,7 @@
"rbi/workos/user_authentication_factor_enroll_response.rbi",
"rbi/workos/user_consent_option.rbi",
"rbi/workos/user_consent_option_choice.rbi",
"rbi/workos/user_create_response.rbi",
"rbi/workos/user_created.rbi",
"rbi/workos/user_deleted.rbi",
"rbi/workos/user_identities_get_item.rbi",
Expand Down Expand Up @@ -1150,6 +1162,7 @@
"test/workos/test_pipes.rb",
"test/workos/test_pipes_provider.rb",
"test/workos/test_radar.rb",
"test/workos/test_radar_model_round_trip.rb",
"test/workos/test_shared_model_round_trip.rb",
"test/workos/test_sso.rb",
"test/workos/test_user_management.rb",
Expand Down Expand Up @@ -1987,6 +2000,38 @@
"GET /user_management/redirect_uris": {
"sdkMethod": "list_redirect_uris",
"service": "user_management"
},
"GET /data-integrations": {
"sdkMethod": "list_data_integrations",
"service": "pipes"
},
"POST /data-integrations": {
"sdkMethod": "create_data_integration",
"service": "pipes"
},
"GET /data-integrations/{slug}": {
"sdkMethod": "get_data_integration",
"service": "pipes"
},
"PUT /data-integrations/{slug}": {
"sdkMethod": "update_data_integration",
"service": "pipes"
},
"DELETE /data-integrations/{slug}": {
"sdkMethod": "delete_data_integration",
"service": "pipes"
},
"POST /user_management/radar_challenges": {
"sdkMethod": "create_radar_challenge",
"service": "user_management"
},
"POST /user_management/users/{user_id}/connected_accounts/{slug}": {
"sdkMethod": "create_user_connected_account",
"service": "pipes"
},
"PUT /user_management/users/{user_id}/connected_accounts/{slug}": {
"sdkMethod": "update_user_connected_account",
"service": "pipes"
}
}
}
7 changes: 5 additions & 2 deletions lib/workos/radar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def initialize(client)
# @param email [String] The email address of the user making the request.
# @param auth_method [WorkOS::Types::RadarStandaloneAssessRequestAuthMethod] The authentication method being used.
# @param action [WorkOS::Types::RadarStandaloneAssessRequestAction] The action being performed.
# @param signals_id [String, nil] An optional Radar signals ID for the request.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::RadarStandaloneResponse]
def create_attempt(
Expand All @@ -24,15 +25,17 @@ def create_attempt(
email:,
auth_method:,
action:,
signals_id: nil,
request_options: {}
)
body = {
"ip_address" => ip_address,
"user_agent" => user_agent,
"email" => email,
"auth_method" => auth_method,
"action" => action
}
"action" => action,
"signals_id" => signals_id
}.compact
response = @client.request(
method: :post,
path: "/radar/attempts",
Expand Down
7 changes: 5 additions & 2 deletions lib/workos/radar/radar_standalone_assess_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ class RadarStandaloneAssessRequest < WorkOS::Types::BaseModel
user_agent: :user_agent,
email: :email,
auth_method: :auth_method,
action: :action
action: :action,
signals_id: :signals_id
}.freeze

attr_accessor \
:ip_address,
:user_agent,
:email,
:auth_method,
:action
:action,
:signals_id

def initialize(json)
hash = self.class.normalize(json)
Expand All @@ -26,6 +28,7 @@ def initialize(json)
@email = hash[:email]
@auth_method = hash[:auth_method]
@action = hash[:action]
@signals_id = hash[:signals_id]
end
end
end
83 changes: 77 additions & 6 deletions lib/workos/user_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ def get_jwks(
# @param ip_address [String, nil] The IP address of the user's request.
# @param device_id [String, nil] A unique identifier for the device.
# @param user_agent [String, nil] The user agent string from the user's browser.
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this authentication attempt.
# @param email [String, nil] The user's email address.
# @param password [String, nil] The user's password.
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this authentication.
# @param refresh_token [String, nil] The refresh token to exchange for new tokens.
# @param organization_id [String, nil] The ID of the organization to scope the session to.
# @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
# @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
# @param radar_challenge_id [String, nil] The ID of the Radar email challenge being verified.
# @param verification_id [String, nil] The ID of the Radar SMS verification being confirmed.
# @param phone_number [String, nil] The phone number the Radar SMS challenge was sent to.
# @param device_code [String, nil] The device verification code.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::AuthenticateResponse]
Expand All @@ -72,12 +77,17 @@ def create_authenticate(
ip_address: nil,
device_id: nil,
user_agent: nil,
signals_id: nil,
email: nil,
password: nil,
radar_auth_attempt_id: nil,
refresh_token: nil,
organization_id: nil,
pending_authentication_token: nil,
authentication_challenge_id: nil,
radar_challenge_id: nil,
verification_id: nil,
phone_number: nil,
device_code: nil,
request_options: {}
)
Expand All @@ -91,12 +101,17 @@ def create_authenticate(
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent,
"signals_id" => signals_id,
"email" => email,
"password" => password,
"radar_auth_attempt_id" => radar_auth_attempt_id,
"refresh_token" => refresh_token,
"organization_id" => organization_id,
"pending_authentication_token" => pending_authentication_token,
"authentication_challenge_id" => authentication_challenge_id,
"radar_challenge_id" => radar_challenge_id,
"verification_id" => verification_id,
"phone_number" => phone_number,
"device_code" => device_code
}.compact
response = @client.request(
Expand Down Expand Up @@ -430,6 +445,41 @@ def create_device(
result
end

# Send a Radar SMS challenge
# @param user_id [String] The ID of the user to send the SMS challenge to.
# @param pending_authentication_token [String] The pending authentication token from a previous authentication attempt that triggered the Radar challenge.
# @param phone_number [String] The phone number to send the SMS verification code to.
# @param ip_address [String, nil] The IP address of the user's request.
# @param user_agent [String, nil] The user agent string from the user's request.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::SendRadarSmsChallengeResponse]
def create_radar_challenge(
user_id:,
pending_authentication_token:,
phone_number:,
ip_address: nil,
user_agent: nil,
request_options: {}
)
body = {
"user_id" => user_id,
"pending_authentication_token" => pending_authentication_token,
"phone_number" => phone_number,
"ip_address" => ip_address,
"user_agent" => user_agent
}.compact
response = @client.request(
method: :post,
path: "/user_management/radar_challenges",
auth: true,
body: body,
request_options: request_options
)
result = WorkOS::SendRadarSmsChallengeResponse.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end

# Revoke Session
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
Expand Down Expand Up @@ -669,9 +719,12 @@ def list_users(
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
# @param external_id [String, nil] The external ID of the user.
# @param ip_address [String, nil] The IP address of the user's request.
# @param user_agent [String, nil] The user agent string from the user's request.
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
# @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::User]
# @return [WorkOS::UserCreateResponse]
def create_user(
email:,
first_name: nil,
Expand All @@ -680,6 +733,9 @@ def create_user(
email_verified: nil,
metadata: nil,
external_id: nil,
ip_address: nil,
user_agent: nil,
signals_id: nil,
password: nil,
request_options: {}
)
Expand All @@ -690,7 +746,10 @@ def create_user(
"name" => name,
"email_verified" => email_verified,
"metadata" => metadata,
"external_id" => external_id
"external_id" => external_id,
"ip_address" => ip_address,
"user_agent" => user_agent,
"signals_id" => signals_id
}.compact
if password
case password
Expand All @@ -710,7 +769,7 @@ def create_user(
body: body,
request_options: request_options
)
result = WorkOS::User.new(response.body)
result = WorkOS::UserCreateResponse.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end
Expand Down Expand Up @@ -1220,16 +1279,28 @@ def update_jwt_template(
# Create a Magic Auth code
# @param email [String] The email address to send the magic code to.
# @param invitation_token [String, nil] The invitation token to associate with this magic code.
# @param ip_address [String, nil] The IP address of the user's request.
# @param user_agent [String, nil] The user agent string from the user's request.
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this request.
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::MagicAuth]
# @return [WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse]
def create_magic_auth(
email:,
invitation_token: nil,
ip_address: nil,
user_agent: nil,
radar_auth_attempt_id: nil,
signals_id: nil,
request_options: {}
)
body = {
"email" => email,
"invitation_token" => invitation_token
"invitation_token" => invitation_token,
"ip_address" => ip_address,
"user_agent" => user_agent,
"radar_auth_attempt_id" => radar_auth_attempt_id,
"signals_id" => signals_id
}.compact
response = @client.request(
method: :post,
Expand All @@ -1238,7 +1309,7 @@ def create_magic_auth(
body: body,
request_options: request_options
)
result = WorkOS::MagicAuth.new(response.body)
result = WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end
Expand Down
Loading