Skip to content
Merged
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,13 @@
* [#514](https://github.com/workos/workos-ruby/pull/514) fix(generated): regenerate from spec

**Features**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added model `UserRoleAssignmentSource`
* Added `source` to `UserRoleAssignment`
* Added enum `UserRoleAssignmentSourceType`
* Added parameter `UserManagementAuthentication.authorize.max_age`
* Added endpoint `GET /user_management/cors_origins`
* Added endpoint `GET /user_management/redirect_uris`

**Fixes**
* Restore mistakenly removed CreateMagicAuth logic from previous release
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4b4e0618779460dbebc1cf5e0f02197c21796d1f
23faa38318d596e581656934ed72c4a18476d742
9 changes: 8 additions & 1 deletion .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"version": 2,
"language": "ruby",
"generatedAt": "2026-07-02T17:29:49.181Z",
"files": [
"lib/workos.rb",
"lib/workos/admin_portal.rb",
Expand Down Expand Up @@ -2057,6 +2056,14 @@
"PUT /user_management/users/{user_id}/connected_accounts/{slug}": {
"sdkMethod": "update_user_connected_account",
"service": "pipes"
},
"POST /user_management/authenticate#RadarEmailChallengeCodeSessionAuthenticateRequest": {
"sdkMethod": "authenticate_with_radar_email_challenge",
"service": "user_management"
},
"POST /user_management/authenticate#RadarSmsChallengeCodeSessionAuthenticateRequest": {
"sdkMethod": "authenticate_with_radar_sms_challenge",
"service": "user_management"
}
}
}
99 changes: 96 additions & 3 deletions lib/workos/user_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def create_authenticate(
# @param ip_address [String, nil]
# @param device_id [String, nil]
# @param user_agent [String, nil]
# @param signals_id [String, nil]
# @param radar_auth_attempt_id [String, nil]
# @param request_options [Hash] Per-request overrides.
# @return [WorkOS::AuthenticateResponse]
def authenticate_with_password(
Expand All @@ -142,6 +144,8 @@ def authenticate_with_password(
ip_address: nil,
device_id: nil,
user_agent: nil,
signals_id: nil,
radar_auth_attempt_id: nil,
request_options: {}
)
body = {
Expand All @@ -153,7 +157,9 @@ def authenticate_with_password(
"invitation_token" => invitation_token,
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent
"user_agent" => user_agent,
"signals_id" => signals_id,
"radar_auth_attempt_id" => radar_auth_attempt_id
}.compact
response = @client.request(
method: :post,
Expand All @@ -172,6 +178,7 @@ def authenticate_with_password(
# @param ip_address [String, nil]
# @param device_id [String, nil]
# @param user_agent [String, nil]
# @param signals_id [String, nil]
# @param request_options [Hash] Per-request overrides.
# @return [WorkOS::AuthenticateResponse]
def authenticate_with_code(
Expand All @@ -181,6 +188,7 @@ def authenticate_with_code(
ip_address: nil,
device_id: nil,
user_agent: nil,
signals_id: nil,
request_options: {}
)
body = {
Expand All @@ -192,7 +200,8 @@ def authenticate_with_code(
"invitation_token" => invitation_token,
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent
"user_agent" => user_agent,
"signals_id" => signals_id
}.compact
response = @client.request(
method: :post,
Expand Down Expand Up @@ -247,6 +256,7 @@ def authenticate_with_refresh_token(
# @param ip_address [String, nil]
# @param device_id [String, nil]
# @param user_agent [String, nil]
# @param radar_auth_attempt_id [String, nil]
# @param request_options [Hash] Per-request overrides.
# @return [WorkOS::AuthenticateResponse]
def authenticate_with_magic_auth(
Expand All @@ -256,6 +266,7 @@ def authenticate_with_magic_auth(
ip_address: nil,
device_id: nil,
user_agent: nil,
radar_auth_attempt_id: nil,
request_options: {}
)
body = {
Expand All @@ -267,7 +278,8 @@ def authenticate_with_magic_auth(
"invitation_token" => invitation_token,
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent
"user_agent" => user_agent,
"radar_auth_attempt_id" => radar_auth_attempt_id
}.compact
response = @client.request(
method: :post,
Expand Down Expand Up @@ -422,6 +434,87 @@ def authenticate_with_device_code(
WorkOS::AuthenticateResponse.new(response.body)
end

# Authenticate with radar email challenge.
# @param code [String]
# @param radar_challenge_id [String]
# @param pending_authentication_token [String]
# @param ip_address [String, nil]
# @param device_id [String, nil]
# @param user_agent [String, nil]
# @param request_options [Hash] Per-request overrides.
# @return [WorkOS::AuthenticateResponse]
def authenticate_with_radar_email_challenge(
code:,
radar_challenge_id:,
pending_authentication_token:,
ip_address: nil,
device_id: nil,
user_agent: nil,
request_options: {}
)
body = {
"grant_type" => "urn:workos:oauth:grant-type:radar-email-challenge:code",
"client_id" => @client.client_id,
"client_secret" => @client.api_key,
"code" => code,
"radar_challenge_id" => radar_challenge_id,
"pending_authentication_token" => pending_authentication_token,
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent
}.compact
response = @client.request(
method: :post,
path: "/user_management/authenticate",
auth: true,
body: body,
request_options: request_options
)
WorkOS::AuthenticateResponse.new(response.body)
end

# Authenticate with radar sms challenge.
# @param code [String]
# @param verification_id [String]
# @param phone_number [String]
# @param pending_authentication_token [String]
# @param ip_address [String, nil]
# @param device_id [String, nil]
# @param user_agent [String, nil]
# @param request_options [Hash] Per-request overrides.
# @return [WorkOS::AuthenticateResponse]
def authenticate_with_radar_sms_challenge(
code:,
verification_id:,
phone_number:,
pending_authentication_token:,
ip_address: nil,
device_id: nil,
user_agent: nil,
request_options: {}
)
body = {
"grant_type" => "urn:workos:oauth:grant-type:radar-sms-challenge:code",
"client_id" => @client.client_id,
"client_secret" => @client.api_key,
"code" => code,
"verification_id" => verification_id,
"phone_number" => phone_number,
"pending_authentication_token" => pending_authentication_token,
"ip_address" => ip_address,
"device_id" => device_id,
"user_agent" => user_agent
}.compact
response = @client.request(
method: :post,
path: "/user_management/authenticate",
auth: true,
body: body,
request_options: request_options
)
WorkOS::AuthenticateResponse.new(response.body)
end

# Get device authorization URL
# @param client_id [String] The WorkOS client ID for your application.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,38 @@
module WorkOS
class MagicAuthSendMagicAuthCodeAndReturnResponse < WorkOS::Types::BaseModel
HASH_ATTRS = {
object: :object,
id: :id,
user_id: :user_id,
email: :email,
expires_at: :expires_at,
created_at: :created_at,
updated_at: :updated_at,
code: :code,
radar_auth_attempt_id: :radar_auth_attempt_id
}.freeze

attr_accessor :radar_auth_attempt_id
attr_accessor \
:object,
:id,
:user_id,
:email,
:expires_at,
:created_at,
:updated_at,
:code,
:radar_auth_attempt_id

def initialize(json)
hash = self.class.normalize(json)
@object = hash[:object]
@id = hash[:id]
@user_id = hash[:user_id]
@email = hash[:email]
@expires_at = hash[:expires_at]
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
@code = hash[:code]
@radar_auth_attempt_id = hash[:radar_auth_attempt_id]
end
end
Expand Down
56 changes: 55 additions & 1 deletion lib/workos/user_management/user_create_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,59 @@
# This file is auto-generated by oagen. Do not edit.

module WorkOS
UserCreateResponse = MagicAuthSendMagicAuthCodeAndReturnResponse
class UserCreateResponse < WorkOS::Types::BaseModel
HASH_ATTRS = {
object: :object,
id: :id,
first_name: :first_name,
last_name: :last_name,
name: :name,
profile_picture_url: :profile_picture_url,
email: :email,
email_verified: :email_verified,
external_id: :external_id,
metadata: :metadata,
last_sign_in_at: :last_sign_in_at,
locale: :locale,
created_at: :created_at,
updated_at: :updated_at,
radar_auth_attempt_id: :radar_auth_attempt_id
}.freeze

attr_accessor \
:object,
:id,
:first_name,
:last_name,
:name,
:profile_picture_url,
:email,
:email_verified,
:external_id,
:metadata,
:last_sign_in_at,
:locale,
:created_at,
:updated_at,
:radar_auth_attempt_id

def initialize(json)
hash = self.class.normalize(json)
@object = hash[:object]
@id = hash[:id]
@first_name = hash[:first_name]
@last_name = hash[:last_name]
@name = hash[:name]
@profile_picture_url = hash[:profile_picture_url]
@email = hash[:email]
@email_verified = hash[:email_verified]
@external_id = hash[:external_id]
@metadata = hash[:metadata] || {}
@last_sign_in_at = hash[:last_sign_in_at]
@locale = hash[:locale]
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
@radar_auth_attempt_id = hash[:radar_auth_attempt_id]
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,54 @@ module WorkOS
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
def initialize(json); end

sig { returns(String) }
def object; end

sig { params(value: String).returns(String) }
def object=(value); end

sig { returns(String) }
def id; end

sig { params(value: String).returns(String) }
def id=(value); end

sig { returns(String) }
def user_id; end

sig { params(value: String).returns(String) }
def user_id=(value); end

sig { returns(String) }
def email; end

sig { params(value: String).returns(String) }
def email=(value); end

sig { returns(String) }
def expires_at; end

sig { params(value: String).returns(String) }
def expires_at=(value); end

sig { returns(String) }
def created_at; end

sig { params(value: String).returns(String) }
def created_at=(value); end

sig { returns(String) }
def updated_at; end

sig { params(value: String).returns(String) }
def updated_at=(value); end

sig { returns(String) }
def code; end

sig { params(value: String).returns(String) }
def code=(value); end

sig { returns(T.nilable(String)) }
def radar_auth_attempt_id; end

Expand Down
Loading