workos 10.4.0 → 10.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/.github/workflows/ci.yml +1 -1
- data/.github/workflows/docs.yml +2 -2
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/release-please.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +92 -2
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +214 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/admin_portal/generate_link.rb +3 -0
- data/lib/workos/admin_portal/revoke_link.rb +22 -0
- data/lib/workos/admin_portal.rb +27 -0
- data/lib/workos/agents/agent_blueprint.rb +3 -0
- data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
- data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
- data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_registration.rb +3 -0
- data/lib/workos/agents.rb +25 -0
- data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
- data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
- data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
- data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
- data/lib/workos/directory_sync.rb +19 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +3 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
- data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +37 -0
- data/lib/workos/pipes/connected_account.rb +6 -0
- data/lib/workos/pipes/connected_account_input.rb +6 -0
- data/lib/workos/pipes/connected_account_write_response.rb +73 -0
- data/lib/workos/pipes/connected_account_write_response_warning.rb +22 -0
- data/lib/workos/pipes/create_connected_account.rb +40 -0
- data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
- data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
- data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
- data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +6 -3
- data/lib/workos/pipes/data_integrations_upsert_api_key_request_2.rb +37 -0
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -3
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +43 -0
- data/lib/workos/pipes/organization_connected_account.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_get_data_integration_authorize_url_request.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_upsert_api_key_request.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_upsert_client_credentials_request.rb +46 -0
- data/lib/workos/pipes.rb +192 -31
- data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
- data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
- data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
- data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
- data/lib/workos/shared/pipe_connected_account.rb +6 -0
- data/lib/workos/sso/token_query.rb +3 -0
- data/lib/workos/sso.rb +3 -0
- data/lib/workos/types/add_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +13 -0
- data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
- data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
- data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
- data/lib/workos/types/agent_instance_type.rb +1 -1
- data/lib/workos/types/connected_account_write_response_auth_method.rb +9 -0
- data/lib/workos/types/connected_account_write_response_connection_role.rb +9 -0
- data/lib/workos/types/connected_account_write_response_state.rb +9 -0
- data/lib/workos/types/create_connected_account_state.rb +9 -0
- data/lib/workos/types/create_data_integration_ownership.rb +1 -5
- data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
- data/lib/workos/types/data_integration_ownership.rb +1 -1
- data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +1 -1
- data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +1 -1
- data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +1 -1
- data/lib/workos/types/data_integrations_upsert_api_key_request_2_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +1 -1
- data/lib/workos/types/data_integrations_upsert_client_credentials_request_2_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +1 -1
- data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +1 -1
- data/lib/workos/types/organization_connected_account_state.rb +9 -0
- data/lib/workos/types/pipes_ownership.rb +1 -1
- data/lib/workos/types/reauthorize_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
- data/lib/workos/types/reauthorize_data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
- data/lib/workos/types/reauthorize_data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/resource_export_completed_data_resource_type.rb +2 -1
- data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
- data/lib/workos/user_management.rb +1 -1
- data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
- data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/add_data_integrations_get_data_integration_authorize_url_request.rbi +60 -0
- data/rbi/workos/admin_portal.rbi +11 -1
- data/rbi/workos/agent_blueprint.rbi +6 -0
- data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
- data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
- data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
- data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
- data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
- data/rbi/workos/agent_registration.rbi +6 -0
- data/rbi/workos/agents.rbi +12 -2
- data/rbi/workos/connected_account.rbi +12 -0
- data/rbi/workos/connected_account_input.rbi +12 -0
- data/rbi/workos/connected_account_write_response.rbi +132 -0
- data/rbi/workos/connected_account_write_response_warning.rbi +30 -0
- data/rbi/workos/create_connected_account.rbi +66 -0
- data/rbi/workos/create_organization_connected_account.rbi +72 -0
- data/rbi/workos/data_integration_credentials_response.rbi +2 -2
- data/rbi/workos/data_integration_vended_credential.rbi +66 -0
- data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
- data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -6
- data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +60 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -6
- data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +72 -0
- data/rbi/workos/directory_sync.rbi +8 -0
- data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
- data/rbi/workos/directory_sync_response.rbi +24 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
- data/rbi/workos/generate_link.rbi +6 -0
- data/rbi/workos/organization_connected_account.rbi +66 -0
- data/rbi/workos/pipe_connected_account.rbi +12 -0
- data/rbi/workos/pipes.rbi +64 -15
- data/rbi/workos/reauthorize_data_integrations_get_data_integration_authorize_url_request.rbi +66 -0
- data/rbi/workos/reauthorize_data_integrations_upsert_api_key_request.rbi +66 -0
- data/rbi/workos/reauthorize_data_integrations_upsert_client_credentials_request.rbi +78 -0
- data/rbi/workos/revoke_link.rbi +30 -0
- data/rbi/workos/sso.rbi +2 -1
- data/rbi/workos/token_query.rbi +6 -0
- data/rbi/workos/user_role_assignment_source.rbi +6 -0
- data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
- data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
- data/rbi/workos/{data_integration_credentials_response_credential.rbi → vault_dek_rekeyed_data.rbi} +13 -19
- data/test/workos/test_admin_portal.rb +9 -1
- data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
- data/test/workos/test_agents.rb +8 -0
- data/test/workos/test_agents_model_round_trip.rb +35 -0
- data/test/workos/test_authorization_model_round_trip.rb +15 -1
- data/test/workos/test_directory_sync.rb +8 -0
- data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
- data/test/workos/test_feature_flags_model_round_trip.rb +16 -0
- data/test/workos/test_pipes.rb +20 -4
- data/test/workos/test_pipes_model_round_trip.rb +284 -15
- data/test/workos/test_shared_model_round_trip.rb +30 -6
- data/test/workos/test_sso_model_round_trip.rb +1 -0
- data/test/workos/test_vault_model_round_trip.rb +33 -0
- metadata +73 -3
|
@@ -11,6 +11,7 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
11
11
|
"agent_identity" => {},
|
|
12
12
|
"organization_id" => "stub",
|
|
13
13
|
"status" => "stub",
|
|
14
|
+
"revoked_at" => nil,
|
|
14
15
|
"kind" => "stub",
|
|
15
16
|
"claim" => nil,
|
|
16
17
|
"created_at" => "stub",
|
|
@@ -21,6 +22,7 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
21
22
|
assert_kind_of Hash, json
|
|
22
23
|
assert_equal fixture["id"], json[:id]
|
|
23
24
|
assert_equal fixture["organization_id"], json[:organization_id]
|
|
25
|
+
assert_nil json[:revoked_at]
|
|
24
26
|
assert_equal fixture["created_at"], json[:created_at]
|
|
25
27
|
assert_equal fixture["updated_at"], json[:updated_at]
|
|
26
28
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
@@ -64,6 +66,7 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
64
66
|
"description" => nil,
|
|
65
67
|
"permissions" => [],
|
|
66
68
|
"invocable_by" => {},
|
|
69
|
+
"invocable_as" => {},
|
|
67
70
|
"session_settings" => {},
|
|
68
71
|
"created_at" => "stub",
|
|
69
72
|
"updated_at" => "stub"
|
|
@@ -182,6 +185,16 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
182
185
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
183
186
|
end
|
|
184
187
|
|
|
188
|
+
def test_agent_blueprint_invocable_as_round_trip
|
|
189
|
+
fixture = {
|
|
190
|
+
"instance_types" => []
|
|
191
|
+
}
|
|
192
|
+
model = WorkOS::AgentBlueprintInvocableAs.new(fixture.to_json)
|
|
193
|
+
json = model.to_h
|
|
194
|
+
assert_kind_of Hash, json
|
|
195
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
196
|
+
end
|
|
197
|
+
|
|
185
198
|
def test_agent_blueprint_session_setting_round_trip
|
|
186
199
|
fixture = {
|
|
187
200
|
"max_age_seconds" => 1,
|
|
@@ -251,6 +264,7 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
251
264
|
"description" => "stub",
|
|
252
265
|
"permissions" => [],
|
|
253
266
|
"invocable_by" => {},
|
|
267
|
+
"invocable_as" => {},
|
|
254
268
|
"session_settings" => {}
|
|
255
269
|
}
|
|
256
270
|
model = WorkOS::AgentBlueprintsCreateRequest.new(fixture.to_json)
|
|
@@ -271,6 +285,16 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
271
285
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
272
286
|
end
|
|
273
287
|
|
|
288
|
+
def test_agent_blueprints_create_request_invocable_as_round_trip
|
|
289
|
+
fixture = {
|
|
290
|
+
"instance_types" => []
|
|
291
|
+
}
|
|
292
|
+
model = WorkOS::AgentBlueprintsCreateRequestInvocableAs.new(fixture.to_json)
|
|
293
|
+
json = model.to_h
|
|
294
|
+
assert_kind_of Hash, json
|
|
295
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
296
|
+
end
|
|
297
|
+
|
|
274
298
|
def test_agent_blueprints_create_request_session_setting_round_trip
|
|
275
299
|
fixture = {
|
|
276
300
|
"max_age_seconds" => 1,
|
|
@@ -292,6 +316,7 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
292
316
|
"description" => nil,
|
|
293
317
|
"permissions" => [],
|
|
294
318
|
"invocable_by" => {},
|
|
319
|
+
"invocable_as" => {},
|
|
295
320
|
"session_settings" => {}
|
|
296
321
|
}
|
|
297
322
|
model = WorkOS::AgentBlueprintsUpdateRequest.new(fixture.to_json)
|
|
@@ -311,6 +336,16 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
311
336
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
312
337
|
end
|
|
313
338
|
|
|
339
|
+
def test_agent_blueprints_update_request_invocable_as_round_trip
|
|
340
|
+
fixture = {
|
|
341
|
+
"instance_types" => []
|
|
342
|
+
}
|
|
343
|
+
model = WorkOS::AgentBlueprintsUpdateRequestInvocableAs.new(fixture.to_json)
|
|
344
|
+
json = model.to_h
|
|
345
|
+
assert_kind_of Hash, json
|
|
346
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
347
|
+
end
|
|
348
|
+
|
|
314
349
|
def test_agent_blueprints_update_request_session_setting_round_trip
|
|
315
350
|
fixture = {
|
|
316
351
|
"max_age_seconds" => 1,
|
|
@@ -641,7 +641,8 @@ class AuthorizationModelRoundTripTest < Minitest::Test
|
|
|
641
641
|
def test_user_role_assignment_source_round_trip
|
|
642
642
|
fixture = {
|
|
643
643
|
"type" => "stub",
|
|
644
|
-
"group_role_assignment_id" => nil
|
|
644
|
+
"group_role_assignment_id" => nil,
|
|
645
|
+
"group" => nil
|
|
645
646
|
}
|
|
646
647
|
model = WorkOS::UserRoleAssignmentSource.new(fixture.to_json)
|
|
647
648
|
json = model.to_h
|
|
@@ -690,4 +691,17 @@ class AuthorizationModelRoundTripTest < Minitest::Test
|
|
|
690
691
|
assert_equal fixture["updated_at"], json[:updated_at]
|
|
691
692
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
692
693
|
end
|
|
694
|
+
|
|
695
|
+
def test_user_role_assignment_source_group_round_trip
|
|
696
|
+
fixture = {
|
|
697
|
+
"id" => "stub",
|
|
698
|
+
"name" => "stub"
|
|
699
|
+
}
|
|
700
|
+
model = WorkOS::UserRoleAssignmentSourceGroup.new(fixture.to_json)
|
|
701
|
+
json = model.to_h
|
|
702
|
+
assert_kind_of Hash, json
|
|
703
|
+
assert_equal fixture["id"], json[:id]
|
|
704
|
+
assert_equal fixture["name"], json[:name]
|
|
705
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
706
|
+
end
|
|
693
707
|
end
|
|
@@ -32,6 +32,13 @@ class DirectorySyncTest < Minitest::Test
|
|
|
32
32
|
assert_nil result
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def test_create_directory_sync_returns_expected_result
|
|
36
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/directories/stub/sync(\?|\z)})
|
|
37
|
+
.to_return(body: "{}", status: 200)
|
|
38
|
+
result = @client.directory_sync.create_directory_sync(id: "stub")
|
|
39
|
+
refute_nil result
|
|
40
|
+
end
|
|
41
|
+
|
|
35
42
|
def test_list_groups_returns_expected_result
|
|
36
43
|
stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)})
|
|
37
44
|
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
@@ -65,6 +72,7 @@ class DirectorySyncTest < Minitest::Test
|
|
|
65
72
|
{name: :list_directories, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories(\?|\z)}},
|
|
66
73
|
{name: :get_directory, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}},
|
|
67
74
|
{name: :delete_directory, verb: :delete, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}},
|
|
75
|
+
{name: :create_directory_sync, verb: :post, url: %r{\Ahttps://api\.workos\.com/directories/stub/sync(\?|\z)}, args: {id: "stub"}},
|
|
68
76
|
{name: :list_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)}},
|
|
69
77
|
{name: :get_group, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups/stub(\?|\z)}, args: {id: "stub"}},
|
|
70
78
|
{name: :list_users, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_users(\?|\z)}},
|
|
@@ -31,6 +31,30 @@ class DirectorySyncModelRoundTripTest < Minitest::Test
|
|
|
31
31
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def test_directory_sync_response_round_trip
|
|
35
|
+
fixture = {
|
|
36
|
+
"status" => "queued"
|
|
37
|
+
}
|
|
38
|
+
model = WorkOS::DirectorySyncResponse.new(fixture.to_json)
|
|
39
|
+
json = model.to_h
|
|
40
|
+
assert_kind_of Hash, json
|
|
41
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def test_directory_sync_rate_limit_error_round_trip
|
|
45
|
+
fixture = {
|
|
46
|
+
"code" => "directory_sync_rate_limited",
|
|
47
|
+
"message" => "stub",
|
|
48
|
+
"retry_after_seconds" => 1
|
|
49
|
+
}
|
|
50
|
+
model = WorkOS::DirectorySyncRateLimitError.new(fixture.to_json)
|
|
51
|
+
json = model.to_h
|
|
52
|
+
assert_kind_of Hash, json
|
|
53
|
+
assert_equal fixture["message"], json[:message]
|
|
54
|
+
assert_equal fixture["retry_after_seconds"], json[:retry_after_seconds]
|
|
55
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
56
|
+
end
|
|
57
|
+
|
|
34
58
|
def test_directory_group_round_trip
|
|
35
59
|
fixture = {
|
|
36
60
|
"object" => "directory_group",
|
|
@@ -483,6 +483,7 @@ class FeatureFlagsModelRoundTripTest < Minitest::Test
|
|
|
483
483
|
"name" => "stub",
|
|
484
484
|
"description" => nil,
|
|
485
485
|
"tags" => [],
|
|
486
|
+
"owner" => nil,
|
|
486
487
|
"enabled" => true,
|
|
487
488
|
"default_value" => true
|
|
488
489
|
}
|
|
@@ -492,6 +493,21 @@ class FeatureFlagsModelRoundTripTest < Minitest::Test
|
|
|
492
493
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
493
494
|
end
|
|
494
495
|
|
|
496
|
+
def test_flag_updated_context_previous_attribute_data_owner_round_trip
|
|
497
|
+
fixture = {
|
|
498
|
+
"email" => "stub",
|
|
499
|
+
"first_name" => nil,
|
|
500
|
+
"last_name" => nil
|
|
501
|
+
}
|
|
502
|
+
model = WorkOS::FlagUpdatedContextPreviousAttributeDataOwner.new(fixture.to_json)
|
|
503
|
+
json = model.to_h
|
|
504
|
+
assert_kind_of Hash, json
|
|
505
|
+
assert_equal fixture["email"], json[:email]
|
|
506
|
+
assert_nil json[:first_name]
|
|
507
|
+
assert_nil json[:last_name]
|
|
508
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
509
|
+
end
|
|
510
|
+
|
|
495
511
|
def test_flag_round_trip
|
|
496
512
|
fixture = {
|
|
497
513
|
"object" => "feature_flag",
|
data/test/workos/test_pipes.rb
CHANGED
|
@@ -46,6 +46,13 @@ class PipesTest < Minitest::Test
|
|
|
46
46
|
assert_nil result
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
def test_create_data_integration_api_key_returns_expected_result
|
|
50
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/api-key(\?|\z)})
|
|
51
|
+
.to_return(body: "{}", status: 200)
|
|
52
|
+
result = @client.pipes.create_data_integration_api_key(slug: "stub", user_id: "stub", secret: "stub", connection_intent: "add")
|
|
53
|
+
refute_nil result
|
|
54
|
+
end
|
|
55
|
+
|
|
49
56
|
def test_update_data_integration_api_key_returns_expected_result
|
|
50
57
|
stub_request(:put, %r{\Ahttps://api\.workos\.com/data-integrations/stub/api-key(\?|\z)})
|
|
51
58
|
.to_return(body: "{}", status: 200)
|
|
@@ -60,6 +67,13 @@ class PipesTest < Minitest::Test
|
|
|
60
67
|
refute_nil result
|
|
61
68
|
end
|
|
62
69
|
|
|
70
|
+
def test_create_data_integration_client_credential_returns_expected_result
|
|
71
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/client-credentials(\?|\z)})
|
|
72
|
+
.to_return(body: "{}", status: 200)
|
|
73
|
+
result = @client.pipes.create_data_integration_client_credential(slug: "stub", user_id: "stub", client_id: "stub", client_secret: "stub", connection_intent: "add")
|
|
74
|
+
refute_nil result
|
|
75
|
+
end
|
|
76
|
+
|
|
63
77
|
def test_update_data_integration_client_credentials_returns_expected_result
|
|
64
78
|
stub_request(:put, %r{\Ahttps://api\.workos\.com/data-integrations/stub/client-credentials(\?|\z)})
|
|
65
79
|
.to_return(body: "{}", status: 200)
|
|
@@ -112,14 +126,14 @@ class PipesTest < Minitest::Test
|
|
|
112
126
|
def test_create_organization_connected_account_returns_expected_result
|
|
113
127
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
|
114
128
|
.to_return(body: "{}", status: 200)
|
|
115
|
-
result = @client.pipes.create_organization_connected_account(organization_id: "stub", slug: "stub")
|
|
129
|
+
result = @client.pipes.create_organization_connected_account(organization_id: "stub", slug: "stub", user_id: "stub")
|
|
116
130
|
refute_nil result
|
|
117
131
|
end
|
|
118
132
|
|
|
119
133
|
def test_update_organization_connected_account_returns_expected_result
|
|
120
134
|
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
|
121
135
|
.to_return(body: "{}", status: 200)
|
|
122
|
-
result = @client.pipes.update_organization_connected_account(organization_id: "stub", slug: "stub")
|
|
136
|
+
result = @client.pipes.update_organization_connected_account(organization_id: "stub", slug: "stub", user_id: "stub")
|
|
123
137
|
refute_nil result
|
|
124
138
|
end
|
|
125
139
|
|
|
@@ -179,8 +193,10 @@ class PipesTest < Minitest::Test
|
|
|
179
193
|
{name: :get_data_integration, verb: :get, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub(\?|\z)}, args: {slug: "stub"}},
|
|
180
194
|
{name: :update_data_integration, verb: :put, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub(\?|\z)}, args: {slug: "stub"}},
|
|
181
195
|
{name: :delete_data_integration, verb: :delete, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub(\?|\z)}, args: {slug: "stub"}},
|
|
196
|
+
{name: :create_data_integration_api_key, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/api-key(\?|\z)}, args: {slug: "stub", user_id: "stub", secret: "stub", connection_intent: "add"}},
|
|
182
197
|
{name: :update_data_integration_api_key, verb: :put, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/api-key(\?|\z)}, args: {slug: "stub", user_id: "stub", secret: "stub"}},
|
|
183
198
|
{name: :authorize_data_integration, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/authorize(\?|\z)}, args: {slug: "stub", user_id: "stub"}},
|
|
199
|
+
{name: :create_data_integration_client_credential, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/client-credentials(\?|\z)}, args: {slug: "stub", user_id: "stub", client_id: "stub", client_secret: "stub", connection_intent: "add"}},
|
|
184
200
|
{name: :update_data_integration_client_credentials, verb: :put, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/client-credentials(\?|\z)}, args: {slug: "stub", user_id: "stub", client_id: "stub", client_secret: "stub"}},
|
|
185
201
|
{name: :create_data_integration_credential, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/credentials(\?|\z)}, args: {slug: "stub", user_id: "stub"}},
|
|
186
202
|
{name: :list_data_integration_organization, verb: :get, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/organization(\?|\z)}, args: {slug: "stub"}},
|
|
@@ -188,8 +204,8 @@ class PipesTest < Minitest::Test
|
|
|
188
204
|
{name: :delete_data_integration_organization, verb: :delete, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/organization(\?|\z)}, args: {slug: "stub"}},
|
|
189
205
|
{name: :get_access_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {provider: "stub", user_id: "stub"}},
|
|
190
206
|
{name: :get_organization_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
|
191
|
-
{name: :create_organization_connected_account, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
|
192
|
-
{name: :update_organization_connected_account, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
|
207
|
+
{name: :create_organization_connected_account, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub", user_id: "stub"}},
|
|
208
|
+
{name: :update_organization_connected_account, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub", user_id: "stub"}},
|
|
193
209
|
{name: :delete_organization_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
|
194
210
|
{name: :list_organization_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_providers(\?|\z)}, args: {organization_id: "stub"}},
|
|
195
211
|
{name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}},
|
|
@@ -107,8 +107,64 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
107
107
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
+
def test_create_organization_connected_account_round_trip
|
|
111
|
+
fixture = {
|
|
112
|
+
"account_display_name" => nil,
|
|
113
|
+
"account_identifier" => nil,
|
|
114
|
+
"access_token" => "stub",
|
|
115
|
+
"refresh_token" => "stub",
|
|
116
|
+
"expires_at" => "stub",
|
|
117
|
+
"scopes" => [],
|
|
118
|
+
"state" => "stub",
|
|
119
|
+
"user_id" => "stub",
|
|
120
|
+
"connection_intent" => "add"
|
|
121
|
+
}
|
|
122
|
+
model = WorkOS::CreateOrganizationConnectedAccount.new(fixture.to_json)
|
|
123
|
+
json = model.to_h
|
|
124
|
+
assert_kind_of Hash, json
|
|
125
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
126
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def test_organization_connected_account_round_trip
|
|
130
|
+
fixture = {
|
|
131
|
+
"account_display_name" => nil,
|
|
132
|
+
"account_identifier" => nil,
|
|
133
|
+
"access_token" => "stub",
|
|
134
|
+
"refresh_token" => "stub",
|
|
135
|
+
"expires_at" => "stub",
|
|
136
|
+
"scopes" => [],
|
|
137
|
+
"state" => "stub",
|
|
138
|
+
"user_id" => "stub"
|
|
139
|
+
}
|
|
140
|
+
model = WorkOS::OrganizationConnectedAccount.new(fixture.to_json)
|
|
141
|
+
json = model.to_h
|
|
142
|
+
assert_kind_of Hash, json
|
|
143
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
144
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def test_create_connected_account_round_trip
|
|
148
|
+
fixture = {
|
|
149
|
+
"account_display_name" => nil,
|
|
150
|
+
"account_identifier" => nil,
|
|
151
|
+
"access_token" => "stub",
|
|
152
|
+
"refresh_token" => "stub",
|
|
153
|
+
"expires_at" => "stub",
|
|
154
|
+
"scopes" => [],
|
|
155
|
+
"state" => "stub",
|
|
156
|
+
"connection_intent" => "add"
|
|
157
|
+
}
|
|
158
|
+
model = WorkOS::CreateConnectedAccount.new(fixture.to_json)
|
|
159
|
+
json = model.to_h
|
|
160
|
+
assert_kind_of Hash, json
|
|
161
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
162
|
+
end
|
|
163
|
+
|
|
110
164
|
def test_connected_account_input_round_trip
|
|
111
165
|
fixture = {
|
|
166
|
+
"account_display_name" => nil,
|
|
167
|
+
"account_identifier" => nil,
|
|
112
168
|
"access_token" => "stub",
|
|
113
169
|
"refresh_token" => "stub",
|
|
114
170
|
"expires_at" => "stub",
|
|
@@ -178,6 +234,23 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
178
234
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
179
235
|
end
|
|
180
236
|
|
|
237
|
+
def test_data_integration_vended_credential_round_trip
|
|
238
|
+
fixture = {
|
|
239
|
+
"object" => "credential",
|
|
240
|
+
"auth_method" => "oauth",
|
|
241
|
+
"value" => "stub",
|
|
242
|
+
"expires_at" => nil,
|
|
243
|
+
"scopes" => [],
|
|
244
|
+
"missing_scopes" => [],
|
|
245
|
+
"config" => {},
|
|
246
|
+
"metadata" => {}
|
|
247
|
+
}
|
|
248
|
+
model = WorkOS::DataIntegrationVendedCredential.new(fixture.to_json)
|
|
249
|
+
json = model.to_h
|
|
250
|
+
assert_kind_of Hash, json
|
|
251
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
252
|
+
end
|
|
253
|
+
|
|
181
254
|
def test_data_integration_credentials_response_round_trip
|
|
182
255
|
fixture = {
|
|
183
256
|
"active" => true,
|
|
@@ -190,7 +263,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
190
263
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
191
264
|
end
|
|
192
265
|
|
|
193
|
-
def
|
|
266
|
+
def test_connected_account_write_response_round_trip
|
|
194
267
|
fixture = {
|
|
195
268
|
"object" => "connected_account",
|
|
196
269
|
"id" => "stub",
|
|
@@ -206,10 +279,13 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
206
279
|
"client_secret_last_4" => nil,
|
|
207
280
|
"config" => {},
|
|
208
281
|
"state" => "stub",
|
|
282
|
+
"established_by_user_id" => nil,
|
|
283
|
+
"state_reason" => nil,
|
|
209
284
|
"created_at" => "stub",
|
|
210
|
-
"updated_at" => "stub"
|
|
285
|
+
"updated_at" => "stub",
|
|
286
|
+
"warnings" => []
|
|
211
287
|
}
|
|
212
|
-
model = WorkOS::
|
|
288
|
+
model = WorkOS::ConnectedAccountWriteResponse.new(fixture.to_json)
|
|
213
289
|
json = model.to_h
|
|
214
290
|
assert_kind_of Hash, json
|
|
215
291
|
assert_equal fixture["id"], json[:id]
|
|
@@ -233,6 +309,40 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
233
309
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
234
310
|
end
|
|
235
311
|
|
|
312
|
+
def test_connected_account_round_trip
|
|
313
|
+
fixture = {
|
|
314
|
+
"object" => "connected_account",
|
|
315
|
+
"id" => "stub",
|
|
316
|
+
"connection_role" => "stub",
|
|
317
|
+
"account_identifier" => nil,
|
|
318
|
+
"account_display_name" => nil,
|
|
319
|
+
"user_id" => nil,
|
|
320
|
+
"organization_id" => nil,
|
|
321
|
+
"scopes" => [],
|
|
322
|
+
"auth_method" => "stub",
|
|
323
|
+
"api_key_last_4" => nil,
|
|
324
|
+
"client_id" => nil,
|
|
325
|
+
"client_secret_last_4" => nil,
|
|
326
|
+
"config" => {},
|
|
327
|
+
"state" => "stub",
|
|
328
|
+
"established_by_user_id" => nil,
|
|
329
|
+
"state_reason" => nil,
|
|
330
|
+
"created_at" => "stub",
|
|
331
|
+
"updated_at" => "stub"
|
|
332
|
+
}
|
|
333
|
+
model = WorkOS::ConnectedAccount.new(fixture.to_json)
|
|
334
|
+
json = model.to_h
|
|
335
|
+
assert_kind_of Hash, json
|
|
336
|
+
assert_equal fixture["id"], json[:id]
|
|
337
|
+
assert_nil json[:account_identifier]
|
|
338
|
+
assert_nil json[:account_display_name]
|
|
339
|
+
assert_nil json[:user_id]
|
|
340
|
+
assert_nil json[:organization_id]
|
|
341
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
342
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
343
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
344
|
+
end
|
|
345
|
+
|
|
236
346
|
def test_data_integrations_list_response_data_round_trip
|
|
237
347
|
fixture = {
|
|
238
348
|
"object" => "data_provider",
|
|
@@ -265,20 +375,15 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
265
375
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
266
376
|
end
|
|
267
377
|
|
|
268
|
-
def
|
|
378
|
+
def test_connected_account_write_response_warning_round_trip
|
|
269
379
|
fixture = {
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"value" => "stub",
|
|
273
|
-
"expires_at" => nil,
|
|
274
|
-
"scopes" => [],
|
|
275
|
-
"missing_scopes" => []
|
|
380
|
+
"code" => "duplicate_account_display_name",
|
|
381
|
+
"message" => "stub"
|
|
276
382
|
}
|
|
277
|
-
model = WorkOS::
|
|
383
|
+
model = WorkOS::ConnectedAccountWriteResponseWarning.new(fixture.to_json)
|
|
278
384
|
json = model.to_h
|
|
279
385
|
assert_kind_of Hash, json
|
|
280
|
-
assert_equal fixture["
|
|
281
|
-
assert_nil json[:expires_at]
|
|
386
|
+
assert_equal fixture["message"], json[:message]
|
|
282
387
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
283
388
|
end
|
|
284
389
|
|
|
@@ -363,11 +468,30 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
363
468
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
364
469
|
end
|
|
365
470
|
|
|
471
|
+
def test_data_integrations_create_api_key_connection_request_round_trip
|
|
472
|
+
fixture = {
|
|
473
|
+
"account_display_name" => nil,
|
|
474
|
+
"account_identifier" => nil,
|
|
475
|
+
"user_id" => "stub",
|
|
476
|
+
"organization_id" => "stub",
|
|
477
|
+
"connection_owner" => "stub",
|
|
478
|
+
"secret" => "stub",
|
|
479
|
+
"connection_intent" => "add"
|
|
480
|
+
}
|
|
481
|
+
model = WorkOS::DataIntegrationsCreateApiKeyConnectionRequest.new(fixture.to_json)
|
|
482
|
+
json = model.to_h
|
|
483
|
+
assert_kind_of Hash, json
|
|
484
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
485
|
+
assert_equal fixture["secret"], json[:secret]
|
|
486
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
487
|
+
end
|
|
488
|
+
|
|
366
489
|
def test_data_integrations_upsert_api_key_request_round_trip
|
|
367
490
|
fixture = {
|
|
491
|
+
"account_display_name" => nil,
|
|
492
|
+
"account_identifier" => nil,
|
|
368
493
|
"user_id" => "stub",
|
|
369
494
|
"organization_id" => "stub",
|
|
370
|
-
"connected_account_id" => "stub",
|
|
371
495
|
"connection_owner" => "stub",
|
|
372
496
|
"secret" => "stub"
|
|
373
497
|
}
|
|
@@ -379,8 +503,48 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
379
503
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
380
504
|
end
|
|
381
505
|
|
|
506
|
+
def test_reauthorize_data_integrations_upsert_api_key_request_round_trip
|
|
507
|
+
fixture = {
|
|
508
|
+
"account_display_name" => nil,
|
|
509
|
+
"account_identifier" => nil,
|
|
510
|
+
"user_id" => "stub",
|
|
511
|
+
"organization_id" => "stub",
|
|
512
|
+
"connection_owner" => "stub",
|
|
513
|
+
"secret" => "stub",
|
|
514
|
+
"connection_intent" => "reauthorize",
|
|
515
|
+
"connected_account_id" => "stub"
|
|
516
|
+
}
|
|
517
|
+
model = WorkOS::ReauthorizeDataIntegrationsUpsertApiKeyRequest.new(fixture.to_json)
|
|
518
|
+
json = model.to_h
|
|
519
|
+
assert_kind_of Hash, json
|
|
520
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
521
|
+
assert_equal fixture["secret"], json[:secret]
|
|
522
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
523
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
524
|
+
end
|
|
525
|
+
|
|
526
|
+
def test_data_integrations_upsert_api_key_request_2_round_trip
|
|
527
|
+
fixture = {
|
|
528
|
+
"account_display_name" => nil,
|
|
529
|
+
"account_identifier" => nil,
|
|
530
|
+
"user_id" => "stub",
|
|
531
|
+
"organization_id" => "stub",
|
|
532
|
+
"connection_owner" => "stub",
|
|
533
|
+
"secret" => "stub",
|
|
534
|
+
"connected_account_id" => "stub"
|
|
535
|
+
}
|
|
536
|
+
model = WorkOS::DataIntegrationsUpsertApiKeyRequest2.new(fixture.to_json)
|
|
537
|
+
json = model.to_h
|
|
538
|
+
assert_kind_of Hash, json
|
|
539
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
540
|
+
assert_equal fixture["secret"], json[:secret]
|
|
541
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
542
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
543
|
+
end
|
|
544
|
+
|
|
382
545
|
def test_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
383
546
|
fixture = {
|
|
547
|
+
"account_display_name" => nil,
|
|
384
548
|
"user_id" => "stub",
|
|
385
549
|
"organization_id" => "stub",
|
|
386
550
|
"connection_owner" => "stub",
|
|
@@ -394,11 +558,69 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
394
558
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
395
559
|
end
|
|
396
560
|
|
|
561
|
+
def test_add_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
562
|
+
fixture = {
|
|
563
|
+
"account_display_name" => nil,
|
|
564
|
+
"user_id" => "stub",
|
|
565
|
+
"organization_id" => "stub",
|
|
566
|
+
"connection_owner" => "stub",
|
|
567
|
+
"return_to" => "stub",
|
|
568
|
+
"config" => {},
|
|
569
|
+
"connection_intent" => "add"
|
|
570
|
+
}
|
|
571
|
+
model = WorkOS::AddDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
|
|
572
|
+
json = model.to_h
|
|
573
|
+
assert_kind_of Hash, json
|
|
574
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
575
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
def test_reauthorize_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
579
|
+
fixture = {
|
|
580
|
+
"account_display_name" => nil,
|
|
581
|
+
"user_id" => "stub",
|
|
582
|
+
"organization_id" => "stub",
|
|
583
|
+
"connection_owner" => "stub",
|
|
584
|
+
"return_to" => "stub",
|
|
585
|
+
"config" => {},
|
|
586
|
+
"connection_intent" => "reauthorize",
|
|
587
|
+
"connected_account_id" => "stub"
|
|
588
|
+
}
|
|
589
|
+
model = WorkOS::ReauthorizeDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
|
|
590
|
+
json = model.to_h
|
|
591
|
+
assert_kind_of Hash, json
|
|
592
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
593
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
594
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
def test_data_integrations_create_client_credentials_connection_request_round_trip
|
|
598
|
+
fixture = {
|
|
599
|
+
"account_display_name" => nil,
|
|
600
|
+
"account_identifier" => nil,
|
|
601
|
+
"user_id" => "stub",
|
|
602
|
+
"organization_id" => "stub",
|
|
603
|
+
"connection_owner" => "stub",
|
|
604
|
+
"client_id" => "stub",
|
|
605
|
+
"client_secret" => "stub",
|
|
606
|
+
"config" => {},
|
|
607
|
+
"connection_intent" => "add"
|
|
608
|
+
}
|
|
609
|
+
model = WorkOS::DataIntegrationsCreateClientCredentialsConnectionRequest.new(fixture.to_json)
|
|
610
|
+
json = model.to_h
|
|
611
|
+
assert_kind_of Hash, json
|
|
612
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
613
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
614
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
615
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
616
|
+
end
|
|
617
|
+
|
|
397
618
|
def test_data_integrations_upsert_client_credentials_request_round_trip
|
|
398
619
|
fixture = {
|
|
620
|
+
"account_display_name" => nil,
|
|
621
|
+
"account_identifier" => nil,
|
|
399
622
|
"user_id" => "stub",
|
|
400
623
|
"organization_id" => "stub",
|
|
401
|
-
"connected_account_id" => "stub",
|
|
402
624
|
"connection_owner" => "stub",
|
|
403
625
|
"client_id" => "stub",
|
|
404
626
|
"client_secret" => "stub",
|
|
@@ -413,6 +635,51 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
413
635
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
414
636
|
end
|
|
415
637
|
|
|
638
|
+
def test_reauthorize_data_integrations_upsert_client_credentials_request_round_trip
|
|
639
|
+
fixture = {
|
|
640
|
+
"account_display_name" => nil,
|
|
641
|
+
"account_identifier" => nil,
|
|
642
|
+
"user_id" => "stub",
|
|
643
|
+
"organization_id" => "stub",
|
|
644
|
+
"connection_owner" => "stub",
|
|
645
|
+
"client_id" => "stub",
|
|
646
|
+
"client_secret" => "stub",
|
|
647
|
+
"config" => {},
|
|
648
|
+
"connection_intent" => "reauthorize",
|
|
649
|
+
"connected_account_id" => "stub"
|
|
650
|
+
}
|
|
651
|
+
model = WorkOS::ReauthorizeDataIntegrationsUpsertClientCredentialsRequest.new(fixture.to_json)
|
|
652
|
+
json = model.to_h
|
|
653
|
+
assert_kind_of Hash, json
|
|
654
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
655
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
656
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
657
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
658
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
def test_data_integrations_upsert_client_credentials_request_2_round_trip
|
|
662
|
+
fixture = {
|
|
663
|
+
"account_display_name" => nil,
|
|
664
|
+
"account_identifier" => nil,
|
|
665
|
+
"user_id" => "stub",
|
|
666
|
+
"organization_id" => "stub",
|
|
667
|
+
"connection_owner" => "stub",
|
|
668
|
+
"client_id" => "stub",
|
|
669
|
+
"client_secret" => "stub",
|
|
670
|
+
"config" => {},
|
|
671
|
+
"connected_account_id" => "stub"
|
|
672
|
+
}
|
|
673
|
+
model = WorkOS::DataIntegrationsUpsertClientCredentialsRequest2.new(fixture.to_json)
|
|
674
|
+
json = model.to_h
|
|
675
|
+
assert_kind_of Hash, json
|
|
676
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
677
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
678
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
679
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
680
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
681
|
+
end
|
|
682
|
+
|
|
416
683
|
def test_data_integrations_vend_credentials_request_round_trip
|
|
417
684
|
fixture = {
|
|
418
685
|
"user_id" => "stub",
|
|
@@ -459,6 +726,8 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
459
726
|
"client_secret_last_4" => nil,
|
|
460
727
|
"config" => {},
|
|
461
728
|
"state" => "stub",
|
|
729
|
+
"established_by_user_id" => nil,
|
|
730
|
+
"state_reason" => nil,
|
|
462
731
|
"created_at" => "stub",
|
|
463
732
|
"updated_at" => "stub",
|
|
464
733
|
"userlandUserId" => nil
|