workos 9.3.0 → 9.4.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 +110 -1
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +123 -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 +18 -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 +7 -0
- data/lib/workos/user_management.rb +165 -6
- 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 +24 -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 +24 -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 +24 -0
- data/test/workos/test_user_management_model_round_trip.rb +1048 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +62 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "test_helper"
|
|
6
|
+
|
|
7
|
+
class SharedModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_connect_application_oauth_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"object" => "connect_application",
|
|
11
|
+
"id" => "stub",
|
|
12
|
+
"client_id" => "stub",
|
|
13
|
+
"description" => nil,
|
|
14
|
+
"name" => "stub",
|
|
15
|
+
"scopes" => [],
|
|
16
|
+
"created_at" => "stub",
|
|
17
|
+
"updated_at" => "stub",
|
|
18
|
+
"application_type" => "oauth",
|
|
19
|
+
"redirect_uris" => [],
|
|
20
|
+
"uses_pkce" => true,
|
|
21
|
+
"is_first_party" => true,
|
|
22
|
+
"was_dynamically_registered" => true,
|
|
23
|
+
"organization_id" => "stub"
|
|
24
|
+
}
|
|
25
|
+
model = WorkOS::ConnectApplicationOAuth.new(fixture.to_json)
|
|
26
|
+
json = model.to_h
|
|
27
|
+
assert_kind_of Hash, json
|
|
28
|
+
assert_equal fixture["id"], json[:id]
|
|
29
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
30
|
+
assert_nil json[:description]
|
|
31
|
+
assert_equal fixture["name"], json[:name]
|
|
32
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
33
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
34
|
+
assert_equal fixture["uses_pkce"], json[:uses_pkce]
|
|
35
|
+
assert_equal fixture["is_first_party"], json[:is_first_party]
|
|
36
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def test_connect_application_oauth_redirect_uris_round_trip
|
|
40
|
+
fixture = {
|
|
41
|
+
"uri" => "stub",
|
|
42
|
+
"default" => true
|
|
43
|
+
}
|
|
44
|
+
model = WorkOS::ConnectApplicationOAuthRedirectUris.new(fixture.to_json)
|
|
45
|
+
json = model.to_h
|
|
46
|
+
assert_kind_of Hash, json
|
|
47
|
+
assert_equal fixture["uri"], json[:uri]
|
|
48
|
+
assert_equal fixture["default"], json[:default]
|
|
49
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def test_connect_application_m2m_round_trip
|
|
53
|
+
fixture = {
|
|
54
|
+
"object" => "connect_application",
|
|
55
|
+
"id" => "stub",
|
|
56
|
+
"client_id" => "stub",
|
|
57
|
+
"description" => nil,
|
|
58
|
+
"name" => "stub",
|
|
59
|
+
"scopes" => [],
|
|
60
|
+
"created_at" => "stub",
|
|
61
|
+
"updated_at" => "stub",
|
|
62
|
+
"application_type" => "m2m",
|
|
63
|
+
"organization_id" => "stub"
|
|
64
|
+
}
|
|
65
|
+
model = WorkOS::ConnectApplicationM2M.new(fixture.to_json)
|
|
66
|
+
json = model.to_h
|
|
67
|
+
assert_kind_of Hash, json
|
|
68
|
+
assert_equal fixture["id"], json[:id]
|
|
69
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
70
|
+
assert_nil json[:description]
|
|
71
|
+
assert_equal fixture["name"], json[:name]
|
|
72
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
73
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
74
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
75
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def test_authorized_connect_application_list_data_round_trip
|
|
79
|
+
fixture = {
|
|
80
|
+
"object" => "authorized_connect_application",
|
|
81
|
+
"id" => "stub",
|
|
82
|
+
"granted_scopes" => [],
|
|
83
|
+
"oauth_resource" => "stub",
|
|
84
|
+
"application" => {}
|
|
85
|
+
}
|
|
86
|
+
model = WorkOS::AuthorizedConnectApplicationListData.new(fixture.to_json)
|
|
87
|
+
json = model.to_h
|
|
88
|
+
assert_kind_of Hash, json
|
|
89
|
+
assert_equal fixture["id"], json[:id]
|
|
90
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -152,6 +152,13 @@ class UserManagementTest < Minitest::Test
|
|
|
152
152
|
refute_nil result
|
|
153
153
|
end
|
|
154
154
|
|
|
155
|
+
def test_create_radar_challenge_returns_expected_result
|
|
156
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/radar_challenges(\?|\z)})
|
|
157
|
+
.to_return(body: "{}", status: 200)
|
|
158
|
+
result = @client.user_management.create_radar_challenge(user_id: "stub", pending_authentication_token: "stub", phone_number: "stub")
|
|
159
|
+
refute_nil result
|
|
160
|
+
end
|
|
161
|
+
|
|
155
162
|
def test_revoke_session_returns_expected_result
|
|
156
163
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)})
|
|
157
164
|
.to_return(body: "{}", status: 200)
|
|
@@ -159,6 +166,13 @@ class UserManagementTest < Minitest::Test
|
|
|
159
166
|
assert_nil result
|
|
160
167
|
end
|
|
161
168
|
|
|
169
|
+
def test_list_cors_origins_returns_expected_result
|
|
170
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)})
|
|
171
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
172
|
+
result = @client.user_management.list_cors_origins
|
|
173
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
174
|
+
end
|
|
175
|
+
|
|
162
176
|
def test_create_cors_origin_returns_expected_result
|
|
163
177
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)})
|
|
164
178
|
.to_return(body: "{}", status: 200)
|
|
@@ -373,6 +387,13 @@ class UserManagementTest < Minitest::Test
|
|
|
373
387
|
refute_nil result
|
|
374
388
|
end
|
|
375
389
|
|
|
390
|
+
def test_list_redirect_uris_returns_expected_result
|
|
391
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)})
|
|
392
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
393
|
+
result = @client.user_management.list_redirect_uris
|
|
394
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
395
|
+
end
|
|
396
|
+
|
|
376
397
|
def test_create_redirect_uri_returns_expected_result
|
|
377
398
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)})
|
|
378
399
|
.to_return(body: "{}", status: 200)
|
|
@@ -413,7 +434,9 @@ class UserManagementTest < Minitest::Test
|
|
|
413
434
|
{name: :get_jwks, verb: :get, url: %r{\Ahttps://api\.workos\.com/sso/jwks/stub(\?|\z)}, args: {client_id: "stub"}},
|
|
414
435
|
{name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", grant_type: "authorization_code", code: "stub"}},
|
|
415
436
|
{name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}},
|
|
437
|
+
{name: :create_radar_challenge, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges(\?|\z)}, args: {user_id: "stub", pending_authentication_token: "stub", phone_number: "stub"}},
|
|
416
438
|
{name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
|
|
439
|
+
{name: :list_cors_origins, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}},
|
|
417
440
|
{name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},
|
|
418
441
|
{name: :get_email_verification, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/email_verification/stub(\?|\z)}, args: {id: "stub"}},
|
|
419
442
|
{name: :reset_password, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/password_reset(\?|\z)}, args: {email: "stub"}},
|
|
@@ -442,6 +465,7 @@ class UserManagementTest < Minitest::Test
|
|
|
442
465
|
{name: :update_jwt_template, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/jwt_template(\?|\z)}, args: {content: "stub"}},
|
|
443
466
|
{name: :create_magic_auth, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth(\?|\z)}, args: {email: "stub"}},
|
|
444
467
|
{name: :get_magic_auth, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth/stub(\?|\z)}, args: {id: "stub"}},
|
|
468
|
+
{name: :list_redirect_uris, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}},
|
|
445
469
|
{name: :create_redirect_uri, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}, args: {uri: "stub"}},
|
|
446
470
|
{name: :list_user_authorized_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)}, args: {user_id: "stub"}},
|
|
447
471
|
{name: :delete_user_authorized_application, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications/stub(\?|\z)}, args: {application_id: "stub", user_id: "stub"}},
|