workos 10.3.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 +2 -2
- data/.github/workflows/docs.yml +4 -4
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +3 -3
- data/.github/workflows/release.yml +2 -2
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +326 -158
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +388 -0
- data/Gemfile.lock +14 -14
- data/README.md +23 -0
- 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 +29 -2
- 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 +30 -1
- data/lib/workos/api_keys/validate_api_key.rb +12 -1
- 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/base_client.rb +6 -2
- data/lib/workos/configuration.rb +3 -2
- 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/inflections.rb +2 -0
- data/lib/workos/multi_factor_auth.rb +1 -1
- data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +37 -0
- data/lib/workos/pipes/connected_account.rb +15 -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_data_integration.rb +3 -0
- data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
- data/lib/workos/pipes/data_integration.rb +3 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
- data/lib/workos/pipes/data_integration_installation.rb +9 -0
- 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 +6 -0
- data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
- data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +15 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +28 -1
- 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 +9 -0
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +43 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
- 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 +498 -30
- data/lib/workos/session_manager.rb +11 -6
- data/lib/workos/shared/account_selection_required_error.rb +22 -0
- 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 +21 -0
- data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
- data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
- data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
- 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_connection_role.rb +13 -0
- 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 +9 -0
- data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +6 -1
- data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
- data/lib/workos/types/data_integration_ownership.rb +9 -0
- 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 +9 -0
- data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
- 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 +9 -0
- 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 +9 -0
- data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/organization_connected_account_state.rb +9 -0
- data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/pipes_ownership.rb +9 -0
- 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 +4 -1
- data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
- data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
- data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
- data/lib/workos/user_management.rb +88 -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/account_selection_required_error.rbi +30 -0
- 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 +14 -3
- data/rbi/workos/authkit_oauth_resource.rbi +54 -0
- data/rbi/workos/connected_account.rbi +30 -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_authkit_oauth_resource.rbi +30 -0
- data/rbi/workos/create_connected_account.rbi +66 -0
- data/rbi/workos/create_data_integration.rbi +6 -0
- data/rbi/workos/create_organization_connected_account.rbi +72 -0
- data/rbi/workos/data_integration.rbi +6 -0
- data/rbi/workos/data_integration_credentials_response.rbi +2 -2
- data/rbi/workos/data_integration_installation.rbi +19 -1
- 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 +12 -0
- data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +30 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +60 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +72 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -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 +42 -0
- data/rbi/workos/pipes.rbi +176 -16
- data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
- 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_management.rbi +28 -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 +80 -0
- data/test/workos/test_pipes_model_round_trip.rb +317 -18
- data/test/workos/test_session.rb +63 -0
- data/test/workos/test_shared_model_round_trip.rb +185 -0
- data/test/workos/test_sso_model_round_trip.rb +1 -0
- data/test/workos/test_user_management.rb +24 -0
- data/test/workos/test_user_management_model_round_trip.rb +32 -0
- data/test/workos/test_vault_model_round_trip.rb +33 -0
- metadata +107 -3
|
@@ -152,12 +152,19 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
152
152
|
fixture = {
|
|
153
153
|
"object" => "connected_account",
|
|
154
154
|
"id" => "stub",
|
|
155
|
+
"connection_role" => "stub",
|
|
156
|
+
"account_identifier" => nil,
|
|
157
|
+
"account_display_name" => nil,
|
|
155
158
|
"data_integration_id" => "stub",
|
|
156
159
|
"provider_slug" => "stub",
|
|
157
160
|
"user_id" => nil,
|
|
158
161
|
"organization_id" => nil,
|
|
159
162
|
"scopes" => [],
|
|
163
|
+
"auth_method" => "stub",
|
|
164
|
+
"api_key_last_4" => nil,
|
|
160
165
|
"state" => "stub",
|
|
166
|
+
"established_by_user_id" => nil,
|
|
167
|
+
"state_reason" => nil,
|
|
161
168
|
"created_at" => "stub",
|
|
162
169
|
"updated_at" => "stub"
|
|
163
170
|
}
|
|
@@ -240,6 +247,7 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
240
247
|
"description" => nil,
|
|
241
248
|
"permissions" => [],
|
|
242
249
|
"invocable_by" => {},
|
|
250
|
+
"invocable_as" => {},
|
|
243
251
|
"session_settings" => {},
|
|
244
252
|
"created_at" => "stub",
|
|
245
253
|
"updated_at" => "stub"
|
|
@@ -266,6 +274,16 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
266
274
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
267
275
|
end
|
|
268
276
|
|
|
277
|
+
def test_agent_blueprint_created_data_invocable_as_round_trip
|
|
278
|
+
fixture = {
|
|
279
|
+
"instance_types" => []
|
|
280
|
+
}
|
|
281
|
+
model = WorkOS::AgentBlueprintCreatedDataInvocableAs.new(fixture.to_json)
|
|
282
|
+
json = model.to_h
|
|
283
|
+
assert_kind_of Hash, json
|
|
284
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
285
|
+
end
|
|
286
|
+
|
|
269
287
|
def test_agent_blueprint_created_data_session_setting_round_trip
|
|
270
288
|
fixture = {
|
|
271
289
|
"max_age_seconds" => 1.0,
|
|
@@ -341,6 +359,7 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
341
359
|
"description" => nil,
|
|
342
360
|
"permissions" => [],
|
|
343
361
|
"invocable_by" => {},
|
|
362
|
+
"invocable_as" => {},
|
|
344
363
|
"session_settings" => {},
|
|
345
364
|
"created_at" => "stub",
|
|
346
365
|
"updated_at" => "stub"
|
|
@@ -367,6 +386,16 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
367
386
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
368
387
|
end
|
|
369
388
|
|
|
389
|
+
def test_agent_blueprint_updated_data_invocable_as_round_trip
|
|
390
|
+
fixture = {
|
|
391
|
+
"instance_types" => []
|
|
392
|
+
}
|
|
393
|
+
model = WorkOS::AgentBlueprintUpdatedDataInvocableAs.new(fixture.to_json)
|
|
394
|
+
json = model.to_h
|
|
395
|
+
assert_kind_of Hash, json
|
|
396
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
397
|
+
end
|
|
398
|
+
|
|
370
399
|
def test_agent_blueprint_updated_data_session_setting_round_trip
|
|
371
400
|
fixture = {
|
|
372
401
|
"max_age_seconds" => 1.0,
|
|
@@ -1006,6 +1035,149 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
1006
1035
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1007
1036
|
end
|
|
1008
1037
|
|
|
1038
|
+
def test_pipes_account_connection_add_failed_round_trip
|
|
1039
|
+
fixture = {
|
|
1040
|
+
"object" => "event",
|
|
1041
|
+
"id" => "stub",
|
|
1042
|
+
"event" => "pipes.account_connection.add_failed",
|
|
1043
|
+
"data" => {},
|
|
1044
|
+
"created_at" => "stub",
|
|
1045
|
+
"context" => {}
|
|
1046
|
+
}
|
|
1047
|
+
model = WorkOS::PipesAccountConnectionAddFailed.new(fixture.to_json)
|
|
1048
|
+
json = model.to_h
|
|
1049
|
+
assert_kind_of Hash, json
|
|
1050
|
+
assert_equal fixture["id"], json[:id]
|
|
1051
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1052
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1053
|
+
end
|
|
1054
|
+
|
|
1055
|
+
def test_pipes_account_connection_add_failed_data_round_trip
|
|
1056
|
+
fixture = {
|
|
1057
|
+
"object" => "connection_failed",
|
|
1058
|
+
"data_integration_id" => "stub",
|
|
1059
|
+
"provider_slug" => "stub",
|
|
1060
|
+
"user_id" => nil,
|
|
1061
|
+
"organization_id" => nil,
|
|
1062
|
+
"account_identifier" => nil,
|
|
1063
|
+
"error_code" => "stub",
|
|
1064
|
+
"error_reason" => nil,
|
|
1065
|
+
"provider_error" => nil,
|
|
1066
|
+
"provider_error_description" => nil,
|
|
1067
|
+
"created_at" => "stub"
|
|
1068
|
+
}
|
|
1069
|
+
model = WorkOS::PipesAccountConnectionAddFailedData.new(fixture.to_json)
|
|
1070
|
+
json = model.to_h
|
|
1071
|
+
assert_kind_of Hash, json
|
|
1072
|
+
assert_equal fixture["data_integration_id"], json[:data_integration_id]
|
|
1073
|
+
assert_equal fixture["provider_slug"], json[:provider_slug]
|
|
1074
|
+
assert_nil json[:user_id]
|
|
1075
|
+
assert_nil json[:organization_id]
|
|
1076
|
+
assert_equal fixture["error_code"], json[:error_code]
|
|
1077
|
+
assert_nil json[:error_reason]
|
|
1078
|
+
assert_nil json[:provider_error]
|
|
1079
|
+
assert_nil json[:provider_error_description]
|
|
1080
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1081
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1082
|
+
end
|
|
1083
|
+
|
|
1084
|
+
def test_pipes_account_connection_connected_round_trip
|
|
1085
|
+
fixture = {
|
|
1086
|
+
"object" => "event",
|
|
1087
|
+
"id" => "stub",
|
|
1088
|
+
"event" => "pipes.account_connection.connected",
|
|
1089
|
+
"data" => {},
|
|
1090
|
+
"created_at" => "stub",
|
|
1091
|
+
"context" => {}
|
|
1092
|
+
}
|
|
1093
|
+
model = WorkOS::PipesAccountConnectionConnected.new(fixture.to_json)
|
|
1094
|
+
json = model.to_h
|
|
1095
|
+
assert_kind_of Hash, json
|
|
1096
|
+
assert_equal fixture["id"], json[:id]
|
|
1097
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1098
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1099
|
+
end
|
|
1100
|
+
|
|
1101
|
+
def test_pipes_account_connection_connection_failed_round_trip
|
|
1102
|
+
fixture = {
|
|
1103
|
+
"object" => "event",
|
|
1104
|
+
"id" => "stub",
|
|
1105
|
+
"event" => "pipes.account_connection.connection_failed",
|
|
1106
|
+
"data" => {},
|
|
1107
|
+
"created_at" => "stub",
|
|
1108
|
+
"context" => {}
|
|
1109
|
+
}
|
|
1110
|
+
model = WorkOS::PipesAccountConnectionConnectionFailed.new(fixture.to_json)
|
|
1111
|
+
json = model.to_h
|
|
1112
|
+
assert_kind_of Hash, json
|
|
1113
|
+
assert_equal fixture["id"], json[:id]
|
|
1114
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1115
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1116
|
+
end
|
|
1117
|
+
|
|
1118
|
+
def test_pipes_account_connection_connection_failed_data_round_trip
|
|
1119
|
+
fixture = {
|
|
1120
|
+
"object" => "connection_failed",
|
|
1121
|
+
"data_integration_id" => "stub",
|
|
1122
|
+
"provider_slug" => "stub",
|
|
1123
|
+
"user_id" => nil,
|
|
1124
|
+
"organization_id" => nil,
|
|
1125
|
+
"account_identifier" => nil,
|
|
1126
|
+
"error_code" => "stub",
|
|
1127
|
+
"error_reason" => nil,
|
|
1128
|
+
"provider_error" => nil,
|
|
1129
|
+
"provider_error_description" => nil,
|
|
1130
|
+
"created_at" => "stub"
|
|
1131
|
+
}
|
|
1132
|
+
model = WorkOS::PipesAccountConnectionConnectionFailedData.new(fixture.to_json)
|
|
1133
|
+
json = model.to_h
|
|
1134
|
+
assert_kind_of Hash, json
|
|
1135
|
+
assert_equal fixture["data_integration_id"], json[:data_integration_id]
|
|
1136
|
+
assert_equal fixture["provider_slug"], json[:provider_slug]
|
|
1137
|
+
assert_nil json[:user_id]
|
|
1138
|
+
assert_nil json[:organization_id]
|
|
1139
|
+
assert_equal fixture["error_code"], json[:error_code]
|
|
1140
|
+
assert_nil json[:error_reason]
|
|
1141
|
+
assert_nil json[:provider_error]
|
|
1142
|
+
assert_nil json[:provider_error_description]
|
|
1143
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1144
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1145
|
+
end
|
|
1146
|
+
|
|
1147
|
+
def test_pipes_account_connection_disconnected_round_trip
|
|
1148
|
+
fixture = {
|
|
1149
|
+
"object" => "event",
|
|
1150
|
+
"id" => "stub",
|
|
1151
|
+
"event" => "pipes.account_connection.disconnected",
|
|
1152
|
+
"data" => {},
|
|
1153
|
+
"created_at" => "stub",
|
|
1154
|
+
"context" => {}
|
|
1155
|
+
}
|
|
1156
|
+
model = WorkOS::PipesAccountConnectionDisconnected.new(fixture.to_json)
|
|
1157
|
+
json = model.to_h
|
|
1158
|
+
assert_kind_of Hash, json
|
|
1159
|
+
assert_equal fixture["id"], json[:id]
|
|
1160
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1161
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
def test_pipes_account_connection_reauthorization_needed_round_trip
|
|
1165
|
+
fixture = {
|
|
1166
|
+
"object" => "event",
|
|
1167
|
+
"id" => "stub",
|
|
1168
|
+
"event" => "pipes.account_connection.reauthorization_needed",
|
|
1169
|
+
"data" => {},
|
|
1170
|
+
"created_at" => "stub",
|
|
1171
|
+
"context" => {}
|
|
1172
|
+
}
|
|
1173
|
+
model = WorkOS::PipesAccountConnectionReauthorizationNeeded.new(fixture.to_json)
|
|
1174
|
+
json = model.to_h
|
|
1175
|
+
assert_kind_of Hash, json
|
|
1176
|
+
assert_equal fixture["id"], json[:id]
|
|
1177
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1178
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1009
1181
|
def test_pipes_connected_account_connected_round_trip
|
|
1010
1182
|
fixture = {
|
|
1011
1183
|
"object" => "event",
|
|
@@ -1047,6 +1219,7 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
1047
1219
|
"provider_slug" => "stub",
|
|
1048
1220
|
"user_id" => nil,
|
|
1049
1221
|
"organization_id" => nil,
|
|
1222
|
+
"account_identifier" => nil,
|
|
1050
1223
|
"error_code" => "stub",
|
|
1051
1224
|
"error_reason" => nil,
|
|
1052
1225
|
"provider_error" => nil,
|
|
@@ -1314,6 +1487,18 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
1314
1487
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1315
1488
|
end
|
|
1316
1489
|
|
|
1490
|
+
def test_account_selection_required_error_round_trip
|
|
1491
|
+
fixture = {
|
|
1492
|
+
"code" => "account_selection_required",
|
|
1493
|
+
"message" => "stub"
|
|
1494
|
+
}
|
|
1495
|
+
model = WorkOS::AccountSelectionRequiredError.new(fixture.to_json)
|
|
1496
|
+
json = model.to_h
|
|
1497
|
+
assert_kind_of Hash, json
|
|
1498
|
+
assert_equal fixture["message"], json[:message]
|
|
1499
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1500
|
+
end
|
|
1501
|
+
|
|
1317
1502
|
def test_event_list_list_metadata_round_trip
|
|
1318
1503
|
fixture = {
|
|
1319
1504
|
"after" => nil
|
|
@@ -187,6 +187,7 @@ class SsoModelRoundTripTest < Minitest::Test
|
|
|
187
187
|
"client_secret" => "stub",
|
|
188
188
|
"code" => "stub",
|
|
189
189
|
"grant_type" => "stub",
|
|
190
|
+
"code_verifier" => "stub",
|
|
190
191
|
"subject_token" => "stub",
|
|
191
192
|
"subject_token_type" => "urn:ietf:params:oauth:token-type:id_token",
|
|
192
193
|
"organization_id" => "stub"
|
|
@@ -203,6 +203,27 @@ class UserManagementTest < Minitest::Test
|
|
|
203
203
|
assert_nil result
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
def test_list_authkit_oauth_resources_returns_expected_result
|
|
207
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)})
|
|
208
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
209
|
+
result = @client.user_management.list_authkit_oauth_resources
|
|
210
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def test_create_authkit_oauth_resource_returns_expected_result
|
|
214
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)})
|
|
215
|
+
.to_return(body: "{}", status: 200)
|
|
216
|
+
result = @client.user_management.create_authkit_oauth_resource(uri: "stub")
|
|
217
|
+
refute_nil result
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
def test_delete_authkit_oauth_resource_returns_expected_result
|
|
221
|
+
stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources/stub(\?|\z)})
|
|
222
|
+
.to_return(body: "{}", status: 200)
|
|
223
|
+
result = @client.user_management.delete_authkit_oauth_resource(id: "stub")
|
|
224
|
+
assert_nil result
|
|
225
|
+
end
|
|
226
|
+
|
|
206
227
|
def test_list_cors_origins_returns_expected_result
|
|
207
228
|
stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)})
|
|
208
229
|
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
@@ -530,6 +551,9 @@ class UserManagementTest < Minitest::Test
|
|
|
530
551
|
{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"}},
|
|
531
552
|
{name: :get_radar_challenge, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)}, args: {id: "stub"}},
|
|
532
553
|
{name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
|
|
554
|
+
{name: :list_authkit_oauth_resources, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)}},
|
|
555
|
+
{name: :create_authkit_oauth_resource, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)}, args: {uri: "stub"}},
|
|
556
|
+
{name: :delete_authkit_oauth_resource, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources/stub(\?|\z)}, args: {id: "stub"}},
|
|
533
557
|
{name: :list_cors_origins, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}},
|
|
534
558
|
{name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},
|
|
535
559
|
{name: :get_email_verification, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/email_verification/stub(\?|\z)}, args: {id: "stub"}},
|
|
@@ -44,6 +44,18 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
44
44
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
def test_create_authkit_oauth_resource_round_trip
|
|
48
|
+
fixture = {
|
|
49
|
+
"uri" => "stub",
|
|
50
|
+
"default" => true
|
|
51
|
+
}
|
|
52
|
+
model = WorkOS::CreateAuthkitOAuthResource.new(fixture.to_json)
|
|
53
|
+
json = model.to_h
|
|
54
|
+
assert_kind_of Hash, json
|
|
55
|
+
assert_equal fixture["uri"], json[:uri]
|
|
56
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
57
|
+
end
|
|
58
|
+
|
|
47
59
|
def test_create_redirect_uri_round_trip
|
|
48
60
|
fixture = {
|
|
49
61
|
"uri" => "stub"
|
|
@@ -1805,6 +1817,26 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
1805
1817
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1806
1818
|
end
|
|
1807
1819
|
|
|
1820
|
+
def test_authkit_oauth_resource_round_trip
|
|
1821
|
+
fixture = {
|
|
1822
|
+
"object" => "authkit_oauth_resource",
|
|
1823
|
+
"id" => "stub",
|
|
1824
|
+
"uri" => "stub",
|
|
1825
|
+
"default" => true,
|
|
1826
|
+
"created_at" => "stub",
|
|
1827
|
+
"updated_at" => "stub"
|
|
1828
|
+
}
|
|
1829
|
+
model = WorkOS::AuthkitOAuthResource.new(fixture.to_json)
|
|
1830
|
+
json = model.to_h
|
|
1831
|
+
assert_kind_of Hash, json
|
|
1832
|
+
assert_equal fixture["id"], json[:id]
|
|
1833
|
+
assert_equal fixture["uri"], json[:uri]
|
|
1834
|
+
assert_equal fixture["default"], json[:default]
|
|
1835
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1836
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1837
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1838
|
+
end
|
|
1839
|
+
|
|
1808
1840
|
def test_redirect_uri_round_trip
|
|
1809
1841
|
fixture = {
|
|
1810
1842
|
"object" => "redirect_uri",
|
|
@@ -435,6 +435,39 @@ class VaultModelRoundTripTest < Minitest::Test
|
|
|
435
435
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
436
436
|
end
|
|
437
437
|
|
|
438
|
+
def test_vault_dek_rekeyed_round_trip
|
|
439
|
+
fixture = {
|
|
440
|
+
"object" => "event",
|
|
441
|
+
"id" => "stub",
|
|
442
|
+
"event" => "vault.dek.rekeyed",
|
|
443
|
+
"data" => {},
|
|
444
|
+
"created_at" => "stub",
|
|
445
|
+
"context" => {}
|
|
446
|
+
}
|
|
447
|
+
model = WorkOS::VaultDekRekeyed.new(fixture.to_json)
|
|
448
|
+
json = model.to_h
|
|
449
|
+
assert_kind_of Hash, json
|
|
450
|
+
assert_equal fixture["id"], json[:id]
|
|
451
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
452
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
def test_vault_dek_rekeyed_data_round_trip
|
|
456
|
+
fixture = {
|
|
457
|
+
"actor_id" => "stub",
|
|
458
|
+
"actor_source" => "stub",
|
|
459
|
+
"actor_name" => "stub",
|
|
460
|
+
"key_ids" => [],
|
|
461
|
+
"key_context" => {}
|
|
462
|
+
}
|
|
463
|
+
model = WorkOS::VaultDekRekeyedData.new(fixture.to_json)
|
|
464
|
+
json = model.to_h
|
|
465
|
+
assert_kind_of Hash, json
|
|
466
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
467
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
468
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
469
|
+
end
|
|
470
|
+
|
|
438
471
|
def test_vault_kek_created_round_trip
|
|
439
472
|
fixture = {
|
|
440
473
|
"object" => "event",
|