workos 9.3.0 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +117 -1
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +139 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/admin_portal/generate_link.rb +0 -3
- data/lib/workos/admin_portal.rb +0 -3
- data/lib/workos/authorization/user_role_assignment.rb +3 -0
- data/lib/workos/authorization/user_role_assignment_source.rb +22 -0
- data/lib/workos/pipes/connected_account_dto.rb +31 -0
- data/lib/workos/pipes/create_data_integration.rb +34 -0
- data/lib/workos/pipes/custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/data_integration.rb +55 -0
- data/lib/workos/pipes/data_integration_credential.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
- data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
- data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/update_data_integration.rb +31 -0
- data/lib/workos/pipes.rb +304 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +5 -2
- data/lib/workos/radar.rb +5 -2
- data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
- data/lib/workos/types/audit_log_export_state.rb +2 -1
- data/lib/workos/types/connected_account_state.rb +1 -2
- data/lib/workos/types/create_webhook_endpoint_events.rb +8 -1
- data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
- data/lib/workos/types/data_integration_credential_type.rb +13 -0
- data/lib/workos/types/data_integration_credentials_response_error.rb +9 -0
- data/lib/workos/types/data_integration_credentials_type.rb +9 -0
- data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
- data/lib/workos/types/data_integration_state.rb +14 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
- data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
- data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
- data/lib/workos/user_management/create_user.rb +9 -0
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
- data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
- data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
- data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
- data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
- data/lib/workos/user_management/user_create_response.rb +61 -0
- data/lib/workos/user_management.rb +261 -9
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/admin_portal.rbi +1 -2
- data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/connected_account_dto.rbi +48 -0
- data/rbi/workos/create_data_integration.rbi +54 -0
- data/rbi/workos/create_magic_code_and_return.rbi +24 -0
- data/rbi/workos/create_user.rbi +18 -0
- data/rbi/workos/custom_provider_definition.rbi +84 -0
- data/rbi/workos/data_integration.rbi +96 -0
- data/rbi/workos/data_integration_credential.rbi +36 -0
- data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
- data/rbi/workos/data_integration_custom_provider.rbi +84 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
- data/rbi/workos/generate_link.rbi +0 -6
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/magic_auth_send_magic_auth_code_and_return_response.rbi +72 -0
- data/rbi/workos/password_session_authenticate_request.rbi +12 -0
- data/rbi/workos/pipes.rbi +104 -0
- data/rbi/workos/radar.rbi +2 -1
- data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +6 -0
- data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
- data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
- data/rbi/workos/update_custom_provider_definition.rbi +84 -0
- data/rbi/workos/update_data_integration.rbi +48 -0
- data/rbi/workos/user_create_response.rbi +108 -0
- data/rbi/workos/user_management.rbi +47 -5
- data/rbi/workos/user_role_assignment.rbi +6 -0
- data/rbi/workos/user_role_assignment_source.rbi +30 -0
- data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
- data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
- data/test/workos/test_authorization_model_round_trip.rb +456 -0
- data/test/workos/test_connect_model_round_trip.rb +30 -0
- data/test/workos/test_groups_model_round_trip.rb +33 -0
- data/test/workos/test_model_round_trip.rb +2 -7857
- data/test/workos/test_organizations_model_round_trip.rb +29 -0
- data/test/workos/test_pipes.rb +72 -0
- data/test/workos/test_pipes_model_round_trip.rb +389 -0
- data/test/workos/test_radar_model_round_trip.rb +85 -0
- data/test/workos/test_shared_model_round_trip.rb +92 -0
- data/test/workos/test_user_management.rb +54 -0
- data/test/workos/test_user_management_model_round_trip.rb +1087 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +62 -1
|
@@ -53,12 +53,17 @@ module WorkOS
|
|
|
53
53
|
# @param ip_address [String, nil] The IP address of the user's request.
|
|
54
54
|
# @param device_id [String, nil] A unique identifier for the device.
|
|
55
55
|
# @param user_agent [String, nil] The user agent string from the user's browser.
|
|
56
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this authentication attempt.
|
|
56
57
|
# @param email [String, nil] The user's email address.
|
|
57
58
|
# @param password [String, nil] The user's password.
|
|
59
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this authentication.
|
|
58
60
|
# @param refresh_token [String, nil] The refresh token to exchange for new tokens.
|
|
59
61
|
# @param organization_id [String, nil] The ID of the organization to scope the session to.
|
|
60
62
|
# @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
|
|
61
63
|
# @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
|
|
64
|
+
# @param radar_challenge_id [String, nil] The ID of the Radar email challenge being verified.
|
|
65
|
+
# @param verification_id [String, nil] The ID of the Radar SMS verification being confirmed.
|
|
66
|
+
# @param phone_number [String, nil] The phone number the Radar SMS challenge was sent to.
|
|
62
67
|
# @param device_code [String, nil] The device verification code.
|
|
63
68
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
64
69
|
# @return [WorkOS::AuthenticateResponse]
|
|
@@ -72,12 +77,17 @@ module WorkOS
|
|
|
72
77
|
ip_address: nil,
|
|
73
78
|
device_id: nil,
|
|
74
79
|
user_agent: nil,
|
|
80
|
+
signals_id: nil,
|
|
75
81
|
email: nil,
|
|
76
82
|
password: nil,
|
|
83
|
+
radar_auth_attempt_id: nil,
|
|
77
84
|
refresh_token: nil,
|
|
78
85
|
organization_id: nil,
|
|
79
86
|
pending_authentication_token: nil,
|
|
80
87
|
authentication_challenge_id: nil,
|
|
88
|
+
radar_challenge_id: nil,
|
|
89
|
+
verification_id: nil,
|
|
90
|
+
phone_number: nil,
|
|
81
91
|
device_code: nil,
|
|
82
92
|
request_options: {}
|
|
83
93
|
)
|
|
@@ -91,12 +101,17 @@ module WorkOS
|
|
|
91
101
|
"ip_address" => ip_address,
|
|
92
102
|
"device_id" => device_id,
|
|
93
103
|
"user_agent" => user_agent,
|
|
104
|
+
"signals_id" => signals_id,
|
|
94
105
|
"email" => email,
|
|
95
106
|
"password" => password,
|
|
107
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
96
108
|
"refresh_token" => refresh_token,
|
|
97
109
|
"organization_id" => organization_id,
|
|
98
110
|
"pending_authentication_token" => pending_authentication_token,
|
|
99
111
|
"authentication_challenge_id" => authentication_challenge_id,
|
|
112
|
+
"radar_challenge_id" => radar_challenge_id,
|
|
113
|
+
"verification_id" => verification_id,
|
|
114
|
+
"phone_number" => phone_number,
|
|
100
115
|
"device_code" => device_code
|
|
101
116
|
}.compact
|
|
102
117
|
response = @client.request(
|
|
@@ -118,6 +133,8 @@ module WorkOS
|
|
|
118
133
|
# @param ip_address [String, nil]
|
|
119
134
|
# @param device_id [String, nil]
|
|
120
135
|
# @param user_agent [String, nil]
|
|
136
|
+
# @param signals_id [String, nil]
|
|
137
|
+
# @param radar_auth_attempt_id [String, nil]
|
|
121
138
|
# @param request_options [Hash] Per-request overrides.
|
|
122
139
|
# @return [WorkOS::AuthenticateResponse]
|
|
123
140
|
def authenticate_with_password(
|
|
@@ -127,6 +144,8 @@ module WorkOS
|
|
|
127
144
|
ip_address: nil,
|
|
128
145
|
device_id: nil,
|
|
129
146
|
user_agent: nil,
|
|
147
|
+
signals_id: nil,
|
|
148
|
+
radar_auth_attempt_id: nil,
|
|
130
149
|
request_options: {}
|
|
131
150
|
)
|
|
132
151
|
body = {
|
|
@@ -138,7 +157,9 @@ module WorkOS
|
|
|
138
157
|
"invitation_token" => invitation_token,
|
|
139
158
|
"ip_address" => ip_address,
|
|
140
159
|
"device_id" => device_id,
|
|
141
|
-
"user_agent" => user_agent
|
|
160
|
+
"user_agent" => user_agent,
|
|
161
|
+
"signals_id" => signals_id,
|
|
162
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id
|
|
142
163
|
}.compact
|
|
143
164
|
response = @client.request(
|
|
144
165
|
method: :post,
|
|
@@ -157,6 +178,7 @@ module WorkOS
|
|
|
157
178
|
# @param ip_address [String, nil]
|
|
158
179
|
# @param device_id [String, nil]
|
|
159
180
|
# @param user_agent [String, nil]
|
|
181
|
+
# @param signals_id [String, nil]
|
|
160
182
|
# @param request_options [Hash] Per-request overrides.
|
|
161
183
|
# @return [WorkOS::AuthenticateResponse]
|
|
162
184
|
def authenticate_with_code(
|
|
@@ -166,6 +188,7 @@ module WorkOS
|
|
|
166
188
|
ip_address: nil,
|
|
167
189
|
device_id: nil,
|
|
168
190
|
user_agent: nil,
|
|
191
|
+
signals_id: nil,
|
|
169
192
|
request_options: {}
|
|
170
193
|
)
|
|
171
194
|
body = {
|
|
@@ -177,7 +200,8 @@ module WorkOS
|
|
|
177
200
|
"invitation_token" => invitation_token,
|
|
178
201
|
"ip_address" => ip_address,
|
|
179
202
|
"device_id" => device_id,
|
|
180
|
-
"user_agent" => user_agent
|
|
203
|
+
"user_agent" => user_agent,
|
|
204
|
+
"signals_id" => signals_id
|
|
181
205
|
}.compact
|
|
182
206
|
response = @client.request(
|
|
183
207
|
method: :post,
|
|
@@ -232,6 +256,7 @@ module WorkOS
|
|
|
232
256
|
# @param ip_address [String, nil]
|
|
233
257
|
# @param device_id [String, nil]
|
|
234
258
|
# @param user_agent [String, nil]
|
|
259
|
+
# @param radar_auth_attempt_id [String, nil]
|
|
235
260
|
# @param request_options [Hash] Per-request overrides.
|
|
236
261
|
# @return [WorkOS::AuthenticateResponse]
|
|
237
262
|
def authenticate_with_magic_auth(
|
|
@@ -241,6 +266,7 @@ module WorkOS
|
|
|
241
266
|
ip_address: nil,
|
|
242
267
|
device_id: nil,
|
|
243
268
|
user_agent: nil,
|
|
269
|
+
radar_auth_attempt_id: nil,
|
|
244
270
|
request_options: {}
|
|
245
271
|
)
|
|
246
272
|
body = {
|
|
@@ -252,7 +278,8 @@ module WorkOS
|
|
|
252
278
|
"invitation_token" => invitation_token,
|
|
253
279
|
"ip_address" => ip_address,
|
|
254
280
|
"device_id" => device_id,
|
|
255
|
-
"user_agent" => user_agent
|
|
281
|
+
"user_agent" => user_agent,
|
|
282
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id
|
|
256
283
|
}.compact
|
|
257
284
|
response = @client.request(
|
|
258
285
|
method: :post,
|
|
@@ -407,6 +434,87 @@ module WorkOS
|
|
|
407
434
|
WorkOS::AuthenticateResponse.new(response.body)
|
|
408
435
|
end
|
|
409
436
|
|
|
437
|
+
# Authenticate with radar email challenge.
|
|
438
|
+
# @param code [String]
|
|
439
|
+
# @param radar_challenge_id [String]
|
|
440
|
+
# @param pending_authentication_token [String]
|
|
441
|
+
# @param ip_address [String, nil]
|
|
442
|
+
# @param device_id [String, nil]
|
|
443
|
+
# @param user_agent [String, nil]
|
|
444
|
+
# @param request_options [Hash] Per-request overrides.
|
|
445
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
446
|
+
def authenticate_with_radar_email_challenge(
|
|
447
|
+
code:,
|
|
448
|
+
radar_challenge_id:,
|
|
449
|
+
pending_authentication_token:,
|
|
450
|
+
ip_address: nil,
|
|
451
|
+
device_id: nil,
|
|
452
|
+
user_agent: nil,
|
|
453
|
+
request_options: {}
|
|
454
|
+
)
|
|
455
|
+
body = {
|
|
456
|
+
"grant_type" => "urn:workos:oauth:grant-type:radar-email-challenge:code",
|
|
457
|
+
"client_id" => @client.client_id,
|
|
458
|
+
"client_secret" => @client.api_key,
|
|
459
|
+
"code" => code,
|
|
460
|
+
"radar_challenge_id" => radar_challenge_id,
|
|
461
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
462
|
+
"ip_address" => ip_address,
|
|
463
|
+
"device_id" => device_id,
|
|
464
|
+
"user_agent" => user_agent
|
|
465
|
+
}.compact
|
|
466
|
+
response = @client.request(
|
|
467
|
+
method: :post,
|
|
468
|
+
path: "/user_management/authenticate",
|
|
469
|
+
auth: true,
|
|
470
|
+
body: body,
|
|
471
|
+
request_options: request_options
|
|
472
|
+
)
|
|
473
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# Authenticate with radar sms challenge.
|
|
477
|
+
# @param code [String]
|
|
478
|
+
# @param verification_id [String]
|
|
479
|
+
# @param phone_number [String]
|
|
480
|
+
# @param pending_authentication_token [String]
|
|
481
|
+
# @param ip_address [String, nil]
|
|
482
|
+
# @param device_id [String, nil]
|
|
483
|
+
# @param user_agent [String, nil]
|
|
484
|
+
# @param request_options [Hash] Per-request overrides.
|
|
485
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
486
|
+
def authenticate_with_radar_sms_challenge(
|
|
487
|
+
code:,
|
|
488
|
+
verification_id:,
|
|
489
|
+
phone_number:,
|
|
490
|
+
pending_authentication_token:,
|
|
491
|
+
ip_address: nil,
|
|
492
|
+
device_id: nil,
|
|
493
|
+
user_agent: nil,
|
|
494
|
+
request_options: {}
|
|
495
|
+
)
|
|
496
|
+
body = {
|
|
497
|
+
"grant_type" => "urn:workos:oauth:grant-type:radar-sms-challenge:code",
|
|
498
|
+
"client_id" => @client.client_id,
|
|
499
|
+
"client_secret" => @client.api_key,
|
|
500
|
+
"code" => code,
|
|
501
|
+
"verification_id" => verification_id,
|
|
502
|
+
"phone_number" => phone_number,
|
|
503
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
504
|
+
"ip_address" => ip_address,
|
|
505
|
+
"device_id" => device_id,
|
|
506
|
+
"user_agent" => user_agent
|
|
507
|
+
}.compact
|
|
508
|
+
response = @client.request(
|
|
509
|
+
method: :post,
|
|
510
|
+
path: "/user_management/authenticate",
|
|
511
|
+
auth: true,
|
|
512
|
+
body: body,
|
|
513
|
+
request_options: request_options
|
|
514
|
+
)
|
|
515
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
516
|
+
end
|
|
517
|
+
|
|
410
518
|
# Get device authorization URL
|
|
411
519
|
# @param client_id [String] The WorkOS client ID for your application.
|
|
412
520
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -430,6 +538,41 @@ module WorkOS
|
|
|
430
538
|
result
|
|
431
539
|
end
|
|
432
540
|
|
|
541
|
+
# Send a Radar SMS challenge
|
|
542
|
+
# @param user_id [String] The ID of the user to send the SMS challenge to.
|
|
543
|
+
# @param pending_authentication_token [String] The pending authentication token from a previous authentication attempt that triggered the Radar challenge.
|
|
544
|
+
# @param phone_number [String] The phone number to send the SMS verification code to.
|
|
545
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
546
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
547
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
548
|
+
# @return [WorkOS::SendRadarSmsChallengeResponse]
|
|
549
|
+
def create_radar_challenge(
|
|
550
|
+
user_id:,
|
|
551
|
+
pending_authentication_token:,
|
|
552
|
+
phone_number:,
|
|
553
|
+
ip_address: nil,
|
|
554
|
+
user_agent: nil,
|
|
555
|
+
request_options: {}
|
|
556
|
+
)
|
|
557
|
+
body = {
|
|
558
|
+
"user_id" => user_id,
|
|
559
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
560
|
+
"phone_number" => phone_number,
|
|
561
|
+
"ip_address" => ip_address,
|
|
562
|
+
"user_agent" => user_agent
|
|
563
|
+
}.compact
|
|
564
|
+
response = @client.request(
|
|
565
|
+
method: :post,
|
|
566
|
+
path: "/user_management/radar_challenges",
|
|
567
|
+
auth: true,
|
|
568
|
+
body: body,
|
|
569
|
+
request_options: request_options
|
|
570
|
+
)
|
|
571
|
+
result = WorkOS::SendRadarSmsChallengeResponse.new(response.body)
|
|
572
|
+
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"])
|
|
573
|
+
result
|
|
574
|
+
end
|
|
575
|
+
|
|
433
576
|
# Revoke Session
|
|
434
577
|
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
|
|
435
578
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -451,6 +594,50 @@ module WorkOS
|
|
|
451
594
|
nil
|
|
452
595
|
end
|
|
453
596
|
|
|
597
|
+
# List CORS origins
|
|
598
|
+
# @param before [String, nil] 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 `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
599
|
+
# @param after [String, nil] 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"`.
|
|
600
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
601
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] 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).
|
|
602
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
603
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::CORSOriginResponse>]
|
|
604
|
+
def list_cors_origins(
|
|
605
|
+
before: nil,
|
|
606
|
+
after: nil,
|
|
607
|
+
limit: 10,
|
|
608
|
+
order: "desc",
|
|
609
|
+
request_options: {}
|
|
610
|
+
)
|
|
611
|
+
params = {
|
|
612
|
+
"before" => before,
|
|
613
|
+
"after" => after,
|
|
614
|
+
"limit" => limit,
|
|
615
|
+
"order" => order
|
|
616
|
+
}.compact
|
|
617
|
+
response = @client.request(
|
|
618
|
+
method: :get,
|
|
619
|
+
path: "/user_management/cors_origins",
|
|
620
|
+
auth: true,
|
|
621
|
+
params: params,
|
|
622
|
+
request_options: request_options
|
|
623
|
+
)
|
|
624
|
+
fetch_next = ->(cursor) {
|
|
625
|
+
list_cors_origins(
|
|
626
|
+
before: before,
|
|
627
|
+
after: cursor,
|
|
628
|
+
limit: limit,
|
|
629
|
+
order: order,
|
|
630
|
+
request_options: request_options
|
|
631
|
+
)
|
|
632
|
+
}
|
|
633
|
+
WorkOS::Types::ListStruct.from_response(
|
|
634
|
+
response,
|
|
635
|
+
model: WorkOS::CORSOriginResponse,
|
|
636
|
+
filters: {before: before, limit: limit, order: order},
|
|
637
|
+
fetch_next: fetch_next
|
|
638
|
+
)
|
|
639
|
+
end
|
|
640
|
+
|
|
454
641
|
# Create a CORS origin
|
|
455
642
|
# @param origin [String] The origin URL to allow for CORS requests.
|
|
456
643
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -625,9 +812,12 @@ module WorkOS
|
|
|
625
812
|
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
626
813
|
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
627
814
|
# @param external_id [String, nil] The external ID of the user.
|
|
815
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
816
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
817
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
628
818
|
# @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password.
|
|
629
819
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
630
|
-
# @return [WorkOS::
|
|
820
|
+
# @return [WorkOS::UserCreateResponse]
|
|
631
821
|
def create_user(
|
|
632
822
|
email:,
|
|
633
823
|
first_name: nil,
|
|
@@ -636,6 +826,9 @@ module WorkOS
|
|
|
636
826
|
email_verified: nil,
|
|
637
827
|
metadata: nil,
|
|
638
828
|
external_id: nil,
|
|
829
|
+
ip_address: nil,
|
|
830
|
+
user_agent: nil,
|
|
831
|
+
signals_id: nil,
|
|
639
832
|
password: nil,
|
|
640
833
|
request_options: {}
|
|
641
834
|
)
|
|
@@ -646,7 +839,10 @@ module WorkOS
|
|
|
646
839
|
"name" => name,
|
|
647
840
|
"email_verified" => email_verified,
|
|
648
841
|
"metadata" => metadata,
|
|
649
|
-
"external_id" => external_id
|
|
842
|
+
"external_id" => external_id,
|
|
843
|
+
"ip_address" => ip_address,
|
|
844
|
+
"user_agent" => user_agent,
|
|
845
|
+
"signals_id" => signals_id
|
|
650
846
|
}.compact
|
|
651
847
|
if password
|
|
652
848
|
case password
|
|
@@ -666,7 +862,7 @@ module WorkOS
|
|
|
666
862
|
body: body,
|
|
667
863
|
request_options: request_options
|
|
668
864
|
)
|
|
669
|
-
result = WorkOS::
|
|
865
|
+
result = WorkOS::UserCreateResponse.new(response.body)
|
|
670
866
|
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"])
|
|
671
867
|
result
|
|
672
868
|
end
|
|
@@ -1176,16 +1372,28 @@ module WorkOS
|
|
|
1176
1372
|
# Create a Magic Auth code
|
|
1177
1373
|
# @param email [String] The email address to send the magic code to.
|
|
1178
1374
|
# @param invitation_token [String, nil] The invitation token to associate with this magic code.
|
|
1375
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
1376
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
1377
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this request.
|
|
1378
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
1179
1379
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1180
|
-
# @return [WorkOS::
|
|
1380
|
+
# @return [WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse]
|
|
1181
1381
|
def create_magic_auth(
|
|
1182
1382
|
email:,
|
|
1183
1383
|
invitation_token: nil,
|
|
1384
|
+
ip_address: nil,
|
|
1385
|
+
user_agent: nil,
|
|
1386
|
+
radar_auth_attempt_id: nil,
|
|
1387
|
+
signals_id: nil,
|
|
1184
1388
|
request_options: {}
|
|
1185
1389
|
)
|
|
1186
1390
|
body = {
|
|
1187
1391
|
"email" => email,
|
|
1188
|
-
"invitation_token" => invitation_token
|
|
1392
|
+
"invitation_token" => invitation_token,
|
|
1393
|
+
"ip_address" => ip_address,
|
|
1394
|
+
"user_agent" => user_agent,
|
|
1395
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
1396
|
+
"signals_id" => signals_id
|
|
1189
1397
|
}.compact
|
|
1190
1398
|
response = @client.request(
|
|
1191
1399
|
method: :post,
|
|
@@ -1194,7 +1402,7 @@ module WorkOS
|
|
|
1194
1402
|
body: body,
|
|
1195
1403
|
request_options: request_options
|
|
1196
1404
|
)
|
|
1197
|
-
result = WorkOS::
|
|
1405
|
+
result = WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse.new(response.body)
|
|
1198
1406
|
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"])
|
|
1199
1407
|
result
|
|
1200
1408
|
end
|
|
@@ -1218,6 +1426,50 @@ module WorkOS
|
|
|
1218
1426
|
result
|
|
1219
1427
|
end
|
|
1220
1428
|
|
|
1429
|
+
# List redirect URIs
|
|
1430
|
+
# @param before [String, nil] 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 `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
1431
|
+
# @param after [String, nil] 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"`.
|
|
1432
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1433
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] 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).
|
|
1434
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1435
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::RedirectUri>]
|
|
1436
|
+
def list_redirect_uris(
|
|
1437
|
+
before: nil,
|
|
1438
|
+
after: nil,
|
|
1439
|
+
limit: 10,
|
|
1440
|
+
order: "desc",
|
|
1441
|
+
request_options: {}
|
|
1442
|
+
)
|
|
1443
|
+
params = {
|
|
1444
|
+
"before" => before,
|
|
1445
|
+
"after" => after,
|
|
1446
|
+
"limit" => limit,
|
|
1447
|
+
"order" => order
|
|
1448
|
+
}.compact
|
|
1449
|
+
response = @client.request(
|
|
1450
|
+
method: :get,
|
|
1451
|
+
path: "/user_management/redirect_uris",
|
|
1452
|
+
auth: true,
|
|
1453
|
+
params: params,
|
|
1454
|
+
request_options: request_options
|
|
1455
|
+
)
|
|
1456
|
+
fetch_next = ->(cursor) {
|
|
1457
|
+
list_redirect_uris(
|
|
1458
|
+
before: before,
|
|
1459
|
+
after: cursor,
|
|
1460
|
+
limit: limit,
|
|
1461
|
+
order: order,
|
|
1462
|
+
request_options: request_options
|
|
1463
|
+
)
|
|
1464
|
+
}
|
|
1465
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1466
|
+
response,
|
|
1467
|
+
model: WorkOS::RedirectUri,
|
|
1468
|
+
filters: {before: before, limit: limit, order: order},
|
|
1469
|
+
fetch_next: fetch_next
|
|
1470
|
+
)
|
|
1471
|
+
end
|
|
1472
|
+
|
|
1221
1473
|
# Create a redirect URI
|
|
1222
1474
|
# @param uri [String] The redirect URI to create.
|
|
1223
1475
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
data/lib/workos/version.rb
CHANGED
data/rbi/workos/admin_portal.rbi
CHANGED
|
@@ -15,12 +15,11 @@ module WorkOS
|
|
|
15
15
|
return_url: T.nilable(String),
|
|
16
16
|
success_url: T.nilable(String),
|
|
17
17
|
intent: T.nilable(String),
|
|
18
|
-
intent_options: T.nilable(WorkOS::IntentOptions),
|
|
19
18
|
it_contact_emails: T.nilable(T::Array[String]),
|
|
20
19
|
request_options: T::Hash[Symbol, T.untyped]
|
|
21
20
|
).returns(WorkOS::PortalLinkResponse)
|
|
22
21
|
end
|
|
23
|
-
def generate_link(organization:, return_url:, success_url:, intent:,
|
|
22
|
+
def generate_link(organization:, return_url:, success_url:, intent:, it_contact_emails:, request_options:); end
|
|
24
23
|
|
|
25
24
|
end
|
|
26
25
|
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
# typed: strong
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class AuthMethodMismatchError
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
def code; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def code=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def message; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def message=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
|
+
def to_h; end
|
|
26
|
+
|
|
27
|
+
sig { params(args: T.untyped).returns(String) }
|
|
28
|
+
def to_json(*args); end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -63,6 +63,12 @@ module WorkOS
|
|
|
63
63
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
64
64
|
def user_agent=(value); end
|
|
65
65
|
|
|
66
|
+
sig { returns(T.nilable(String)) }
|
|
67
|
+
def signals_id; end
|
|
68
|
+
|
|
69
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
70
|
+
def signals_id=(value); end
|
|
71
|
+
|
|
66
72
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
67
73
|
def to_h; end
|
|
68
74
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
# typed: strong
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class ConnectedAccountDto
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
def access_token; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
16
|
+
def access_token=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
def refresh_token; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
+
def refresh_token=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
def expires_at; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
|
+
def expires_at=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
31
|
+
def scopes; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
34
|
+
def scopes=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
def state; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
|
+
def state=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
43
|
+
def to_h; end
|
|
44
|
+
|
|
45
|
+
sig { params(args: T.untyped).returns(String) }
|
|
46
|
+
def to_json(*args); end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
# typed: strong
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class CreateDataIntegration
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
def provider; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def provider=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
def description; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
+
def description=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
25
|
+
def enabled; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
|
|
28
|
+
def enabled=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
31
|
+
def scopes; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
34
|
+
def scopes=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(WorkOS::DataIntegrationCredentialsDto)) }
|
|
37
|
+
def credentials; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(WorkOS::DataIntegrationCredentialsDto)).returns(T.nilable(WorkOS::DataIntegrationCredentialsDto)) }
|
|
40
|
+
def credentials=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(WorkOS::CustomProviderDefinition)) }
|
|
43
|
+
def custom_provider; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(WorkOS::CustomProviderDefinition)).returns(T.nilable(WorkOS::CustomProviderDefinition)) }
|
|
46
|
+
def custom_provider=(value); end
|
|
47
|
+
|
|
48
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
49
|
+
def to_h; end
|
|
50
|
+
|
|
51
|
+
sig { params(args: T.untyped).returns(String) }
|
|
52
|
+
def to_json(*args); end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -21,6 +21,30 @@ module WorkOS
|
|
|
21
21
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
22
|
def invitation_token=(value); end
|
|
23
23
|
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
def ip_address; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
|
+
def ip_address=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
def user_agent; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
34
|
+
def user_agent=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
def radar_auth_attempt_id; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
|
+
def radar_auth_attempt_id=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
def signals_id; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
46
|
+
def signals_id=(value); end
|
|
47
|
+
|
|
24
48
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
25
49
|
def to_h; end
|
|
26
50
|
|
data/rbi/workos/create_user.rbi
CHANGED
|
@@ -51,6 +51,24 @@ module WorkOS
|
|
|
51
51
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
52
52
|
def external_id=(value); end
|
|
53
53
|
|
|
54
|
+
sig { returns(T.nilable(String)) }
|
|
55
|
+
def ip_address; end
|
|
56
|
+
|
|
57
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
58
|
+
def ip_address=(value); end
|
|
59
|
+
|
|
60
|
+
sig { returns(T.nilable(String)) }
|
|
61
|
+
def user_agent; end
|
|
62
|
+
|
|
63
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
64
|
+
def user_agent=(value); end
|
|
65
|
+
|
|
66
|
+
sig { returns(T.nilable(String)) }
|
|
67
|
+
def signals_id; end
|
|
68
|
+
|
|
69
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
70
|
+
def signals_id=(value); end
|
|
71
|
+
|
|
54
72
|
sig { returns(T.nilable(String)) }
|
|
55
73
|
def password; end
|
|
56
74
|
|