workos 9.5.0 → 10.0.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/block-generated-edits.yml +13 -0
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/docs.yml +1 -1
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/release-please.yml +7 -1
- data/.github/workflows/release.yml +1 -1
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +197 -75
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +87 -0
- data/Gemfile.lock +2 -2
- data/README.md +15 -14
- data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
- data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
- data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
- data/lib/workos/agents/agent_credential_validation.rb +25 -0
- data/lib/workos/agents/agent_registration.rb +40 -0
- data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
- data/lib/workos/agents/agent_registration_claim.rb +31 -0
- data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
- data/lib/workos/agents/claim_view_response.rb +28 -0
- data/lib/workos/agents/claim_view_response_organization.rb +7 -0
- data/lib/workos/agents.rb +93 -0
- data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
- data/lib/workos/api_keys.rb +3 -4
- data/lib/workos/authorization/permission_created_data.rb +1 -34
- data/lib/workos/authorization/permission_deleted_data.rb +1 -1
- data/lib/workos/authorization/permission_updated_data.rb +1 -1
- data/lib/workos/authorization.rb +24 -24
- data/lib/workos/base_client.rb +4 -4
- data/lib/workos/client.rb +4 -0
- data/lib/workos/connect.rb +23 -19
- data/lib/workos/directory_sync.rb +10 -2
- data/lib/workos/groups.rb +7 -7
- data/lib/workos/inflections.rb +0 -1
- data/lib/workos/organization_domains.rb +4 -4
- data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
- data/lib/workos/organizations.rb +57 -10
- data/lib/workos/pipes/api_key_installation.rb +25 -0
- data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
- data/lib/workos/pipes/create_data_integration.rb +7 -1
- data/lib/workos/pipes/data_integration.rb +6 -0
- data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
- data/lib/workos/pipes/data_integration_installation.rb +28 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
- data/lib/workos/pipes/update_data_integration.rb +4 -1
- data/lib/workos/pipes.rb +25 -16
- data/lib/workos/pipes_provider.rb +2 -2
- data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
- data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
- data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
- data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
- data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
- data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
- data/lib/workos/shared/agent_registration_created.rb +34 -0
- data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
- data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
- data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
- data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
- data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
- data/lib/workos/shared/agent_registration_deleted.rb +34 -0
- data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
- data/lib/workos/shared/agent_registration_expired.rb +34 -0
- data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
- data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
- data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
- data/lib/workos/shared/agent_registration_revoked.rb +34 -0
- data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
- data/lib/workos/shared/radar_challenge_created.rb +34 -0
- data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
- data/lib/workos/sso/connection.rb +3 -3
- data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
- data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
- data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
- data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
- data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
- data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
- data/lib/workos/types/applications_registration_types.rb +13 -0
- data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
- data/lib/workos/types/connected_account_input_state.rb +13 -0
- data/lib/workos/types/connected_account_state.rb +2 -1
- data/lib/workos/types/create_data_integration_auth_methods.rb +9 -0
- data/lib/workos/types/create_user_password_hash_type.rb +2 -1
- data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
- data/lib/workos/types/data_integration_auth_methods.rb +9 -0
- data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
- data/lib/workos/types/pipe_connected_account_state.rb +1 -5
- data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
- data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
- data/lib/workos/user_management/radar_challenge.rb +43 -0
- data/lib/workos/user_management.rb +59 -23
- data/lib/workos/vault/vault_kek_deleted.rb +34 -0
- data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
- data/lib/workos/vault.rb +4 -4
- data/lib/workos/version.rb +1 -1
- data/lib/workos/widgets.rb +2 -2
- data/lib/workos.rb +11 -0
- data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
- data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
- data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
- data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
- data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
- data/rbi/workos/agent_registration.rbi +66 -0
- data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
- data/rbi/workos/agent_registration_claim.rbi +48 -0
- data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
- data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
- data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
- data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
- data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
- data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
- data/rbi/workos/agent_registration_created.rbi +54 -0
- data/rbi/workos/agent_registration_created_data.rbi +72 -0
- data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
- data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
- data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
- data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
- data/rbi/workos/agent_registration_deleted.rbi +54 -0
- data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
- data/rbi/workos/agent_registration_expired.rbi +54 -0
- data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
- data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
- data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
- data/rbi/workos/agent_registration_revoked.rbi +54 -0
- data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
- data/rbi/workos/agents.rbi +42 -0
- data/rbi/workos/api_key_installation.rbi +36 -0
- data/rbi/workos/api_key_validation_response.rbi +6 -0
- data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
- data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
- data/rbi/workos/claim_view_response.rbi +42 -0
- data/rbi/workos/claim_view_response_organization.rbi +30 -0
- data/rbi/workos/client.rbi +3 -0
- data/rbi/workos/connect.rbi +2 -1
- data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
- data/rbi/workos/connection.rbi +4 -4
- data/rbi/workos/create_data_integration.rbi +14 -2
- data/rbi/workos/data_integration.rbi +12 -0
- data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
- data/rbi/workos/data_integration_installation.rbi +42 -0
- data/rbi/workos/directory_sync.rbi +3 -1
- data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
- data/rbi/workos/organization_domains.rbi +2 -2
- data/rbi/workos/organizations.rbi +12 -0
- data/rbi/workos/permission_created_data.rbi +6 -0
- data/rbi/workos/permission_deleted_data.rbi +6 -0
- data/rbi/workos/permission_updated_data.rbi +6 -0
- data/rbi/workos/pipes.rbi +7 -4
- data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
- data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
- data/rbi/workos/radar_challenge.rbi +72 -0
- data/rbi/workos/radar_challenge_created.rbi +54 -0
- data/rbi/workos/radar_challenge_created_data.rbi +42 -0
- data/rbi/workos/update_data_integration.rbi +8 -2
- data/rbi/workos/user_management.rbi +16 -0
- data/rbi/workos/vault_kek_deleted.rbi +54 -0
- data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
- data/rbi/workos/widget_session_token.rbi +2 -2
- data/rbi/workos/widgets.rbi +1 -1
- data/test/workos/test_agents.rb +49 -0
- data/test/workos/test_agents_model_round_trip.rb +165 -0
- data/test/workos/test_api_keys_model_round_trip.rb +307 -0
- data/test/workos/test_authorization_model_round_trip.rb +237 -0
- data/test/workos/test_base_client.rb +27 -0
- data/test/workos/test_client_api_model_round_trip.rb +31 -0
- data/test/workos/test_connect_model_round_trip.rb +175 -0
- data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
- data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
- data/test/workos/test_groups_model_round_trip.rb +56 -0
- data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
- data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
- data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
- data/test/workos/test_organizations.rb +9 -1
- data/test/workos/test_organizations_model_round_trip.rb +602 -0
- data/test/workos/test_pipes_model_round_trip.rb +40 -4
- data/test/workos/test_pipes_provider_model_round_trip.rb +75 -0
- data/test/workos/test_shared_model_round_trip.rb +787 -0
- data/test/workos/test_sso_model_round_trip.rb +422 -0
- data/test/workos/test_user_management.rb +16 -0
- data/test/workos/test_user_management_model_round_trip.rb +1501 -0
- data/test/workos/test_vault_model_round_trip.rb +571 -0
- data/test/workos/test_widgets.rb +2 -2
- data/test/workos/test_widgets_model_round_trip.rb +30 -0
- metadata +118 -19
- data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
- data/lib/workos/admin_portal/intent_options.rb +0 -22
- data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
- data/lib/workos/sso/connection_option.rb +0 -18
- data/rbi/workos/intent_options.rbi +0 -30
- data/test/workos/test_model_round_trip.rb +0 -6
|
@@ -0,0 +1,192 @@
|
|
|
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 MultiFactorAuthModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_challenge_authentication_factor_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"sms_template" => "stub"
|
|
11
|
+
}
|
|
12
|
+
model = WorkOS::ChallengeAuthenticationFactor.new(fixture.to_json)
|
|
13
|
+
json = model.to_h
|
|
14
|
+
assert_kind_of Hash, json
|
|
15
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_enroll_user_authentication_factor_round_trip
|
|
19
|
+
fixture = {
|
|
20
|
+
"type" => "totp",
|
|
21
|
+
"totp_issuer" => "stub",
|
|
22
|
+
"totp_user" => "stub",
|
|
23
|
+
"totp_secret" => "stub"
|
|
24
|
+
}
|
|
25
|
+
model = WorkOS::EnrollUserAuthenticationFactor.new(fixture.to_json)
|
|
26
|
+
json = model.to_h
|
|
27
|
+
assert_kind_of Hash, json
|
|
28
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def test_authentication_challenge_round_trip
|
|
32
|
+
fixture = {
|
|
33
|
+
"object" => "authentication_challenge",
|
|
34
|
+
"id" => "stub",
|
|
35
|
+
"expires_at" => "stub",
|
|
36
|
+
"code" => "stub",
|
|
37
|
+
"authentication_factor_id" => "stub",
|
|
38
|
+
"created_at" => "stub",
|
|
39
|
+
"updated_at" => "stub"
|
|
40
|
+
}
|
|
41
|
+
model = WorkOS::AuthenticationChallenge.new(fixture.to_json)
|
|
42
|
+
json = model.to_h
|
|
43
|
+
assert_kind_of Hash, json
|
|
44
|
+
assert_equal fixture["id"], json[:id]
|
|
45
|
+
assert_equal fixture["authentication_factor_id"], json[:authentication_factor_id]
|
|
46
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
47
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
48
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def test_authentication_challenge_verify_response_round_trip
|
|
52
|
+
fixture = {
|
|
53
|
+
"challenge" => {},
|
|
54
|
+
"valid" => true
|
|
55
|
+
}
|
|
56
|
+
model = WorkOS::AuthenticationChallengeVerifyResponse.new(fixture.to_json)
|
|
57
|
+
json = model.to_h
|
|
58
|
+
assert_kind_of Hash, json
|
|
59
|
+
assert_equal fixture["valid"], json[:valid]
|
|
60
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def test_authentication_factor_enrolled_round_trip
|
|
64
|
+
fixture = {
|
|
65
|
+
"object" => "authentication_factor",
|
|
66
|
+
"id" => "stub",
|
|
67
|
+
"type" => "stub",
|
|
68
|
+
"user_id" => "stub",
|
|
69
|
+
"sms" => {},
|
|
70
|
+
"totp" => {},
|
|
71
|
+
"created_at" => "stub",
|
|
72
|
+
"updated_at" => "stub"
|
|
73
|
+
}
|
|
74
|
+
model = WorkOS::AuthenticationFactorEnrolled.new(fixture.to_json)
|
|
75
|
+
json = model.to_h
|
|
76
|
+
assert_kind_of Hash, json
|
|
77
|
+
assert_equal fixture["id"], json[:id]
|
|
78
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
79
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
80
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def test_authentication_factor_round_trip
|
|
84
|
+
fixture = {
|
|
85
|
+
"object" => "authentication_factor",
|
|
86
|
+
"id" => "stub",
|
|
87
|
+
"type" => "stub",
|
|
88
|
+
"user_id" => "stub",
|
|
89
|
+
"sms" => {},
|
|
90
|
+
"totp" => {},
|
|
91
|
+
"created_at" => "stub",
|
|
92
|
+
"updated_at" => "stub"
|
|
93
|
+
}
|
|
94
|
+
model = WorkOS::AuthenticationFactor.new(fixture.to_json)
|
|
95
|
+
json = model.to_h
|
|
96
|
+
assert_kind_of Hash, json
|
|
97
|
+
assert_equal fixture["id"], json[:id]
|
|
98
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
99
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
100
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def test_user_authentication_factor_enroll_response_round_trip
|
|
104
|
+
fixture = {
|
|
105
|
+
"authentication_factor" => {},
|
|
106
|
+
"authentication_challenge" => {}
|
|
107
|
+
}
|
|
108
|
+
model = WorkOS::UserAuthenticationFactorEnrollResponse.new(fixture.to_json)
|
|
109
|
+
json = model.to_h
|
|
110
|
+
assert_kind_of Hash, json
|
|
111
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def test_authentication_factor_sms_round_trip
|
|
115
|
+
fixture = {
|
|
116
|
+
"phone_number" => "stub"
|
|
117
|
+
}
|
|
118
|
+
model = WorkOS::AuthenticationFactorSms.new(fixture.to_json)
|
|
119
|
+
json = model.to_h
|
|
120
|
+
assert_kind_of Hash, json
|
|
121
|
+
assert_equal fixture["phone_number"], json[:phone_number]
|
|
122
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def test_authentication_factor_totp_round_trip
|
|
126
|
+
fixture = {
|
|
127
|
+
"issuer" => "stub",
|
|
128
|
+
"user" => "stub"
|
|
129
|
+
}
|
|
130
|
+
model = WorkOS::AuthenticationFactorTotp.new(fixture.to_json)
|
|
131
|
+
json = model.to_h
|
|
132
|
+
assert_kind_of Hash, json
|
|
133
|
+
assert_equal fixture["issuer"], json[:issuer]
|
|
134
|
+
assert_equal fixture["user"], json[:user]
|
|
135
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def test_authentication_factor_enrolled_sms_round_trip
|
|
139
|
+
fixture = {
|
|
140
|
+
"phone_number" => "stub"
|
|
141
|
+
}
|
|
142
|
+
model = WorkOS::AuthenticationFactorEnrolledSms.new(fixture.to_json)
|
|
143
|
+
json = model.to_h
|
|
144
|
+
assert_kind_of Hash, json
|
|
145
|
+
assert_equal fixture["phone_number"], json[:phone_number]
|
|
146
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def test_authentication_factor_enrolled_totp_round_trip
|
|
150
|
+
fixture = {
|
|
151
|
+
"issuer" => "stub",
|
|
152
|
+
"user" => "stub",
|
|
153
|
+
"secret" => "stub",
|
|
154
|
+
"qr_code" => "stub",
|
|
155
|
+
"uri" => "stub"
|
|
156
|
+
}
|
|
157
|
+
model = WorkOS::AuthenticationFactorEnrolledTotp.new(fixture.to_json)
|
|
158
|
+
json = model.to_h
|
|
159
|
+
assert_kind_of Hash, json
|
|
160
|
+
assert_equal fixture["issuer"], json[:issuer]
|
|
161
|
+
assert_equal fixture["user"], json[:user]
|
|
162
|
+
assert_equal fixture["secret"], json[:secret]
|
|
163
|
+
assert_equal fixture["qr_code"], json[:qr_code]
|
|
164
|
+
assert_equal fixture["uri"], json[:uri]
|
|
165
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def test_authentication_challenges_verify_request_round_trip
|
|
169
|
+
fixture = {
|
|
170
|
+
"code" => "stub"
|
|
171
|
+
}
|
|
172
|
+
model = WorkOS::AuthenticationChallengesVerifyRequest.new(fixture.to_json)
|
|
173
|
+
json = model.to_h
|
|
174
|
+
assert_kind_of Hash, json
|
|
175
|
+
assert_equal fixture["code"], json[:code]
|
|
176
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def test_authentication_factors_create_request_round_trip
|
|
180
|
+
fixture = {
|
|
181
|
+
"type" => "stub",
|
|
182
|
+
"phone_number" => "stub",
|
|
183
|
+
"totp_issuer" => "stub",
|
|
184
|
+
"totp_user" => "stub",
|
|
185
|
+
"user_id" => "stub"
|
|
186
|
+
}
|
|
187
|
+
model = WorkOS::AuthenticationFactorsCreateRequest.new(fixture.to_json)
|
|
188
|
+
json = model.to_h
|
|
189
|
+
assert_kind_of Hash, json
|
|
190
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
191
|
+
end
|
|
192
|
+
end
|
|
@@ -0,0 +1,260 @@
|
|
|
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 OrganizationDomainsModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_create_organization_domain_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"domain" => "stub",
|
|
11
|
+
"organization_id" => "stub"
|
|
12
|
+
}
|
|
13
|
+
model = WorkOS::CreateOrganizationDomain.new(fixture.to_json)
|
|
14
|
+
json = model.to_h
|
|
15
|
+
assert_kind_of Hash, json
|
|
16
|
+
assert_equal fixture["domain"], json[:domain]
|
|
17
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
18
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def test_organization_domain_created_round_trip
|
|
22
|
+
fixture = {
|
|
23
|
+
"object" => "event",
|
|
24
|
+
"id" => "stub",
|
|
25
|
+
"event" => "organization_domain.created",
|
|
26
|
+
"data" => {},
|
|
27
|
+
"created_at" => "stub",
|
|
28
|
+
"context" => {}
|
|
29
|
+
}
|
|
30
|
+
model = WorkOS::OrganizationDomainCreated.new(fixture.to_json)
|
|
31
|
+
json = model.to_h
|
|
32
|
+
assert_kind_of Hash, json
|
|
33
|
+
assert_equal fixture["id"], json[:id]
|
|
34
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
35
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_organization_domain_created_data_round_trip
|
|
39
|
+
fixture = {
|
|
40
|
+
"object" => "organization_domain",
|
|
41
|
+
"id" => "stub",
|
|
42
|
+
"organization_id" => "stub",
|
|
43
|
+
"domain" => "stub",
|
|
44
|
+
"state" => "stub",
|
|
45
|
+
"verification_prefix" => "stub",
|
|
46
|
+
"verification_token" => "stub",
|
|
47
|
+
"verification_strategy" => "stub",
|
|
48
|
+
"created_at" => "stub",
|
|
49
|
+
"updated_at" => "stub"
|
|
50
|
+
}
|
|
51
|
+
model = WorkOS::OrganizationDomainCreatedData.new(fixture.to_json)
|
|
52
|
+
json = model.to_h
|
|
53
|
+
assert_kind_of Hash, json
|
|
54
|
+
assert_equal fixture["id"], json[:id]
|
|
55
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
56
|
+
assert_equal fixture["domain"], json[:domain]
|
|
57
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
58
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
59
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def test_organization_domain_deleted_round_trip
|
|
63
|
+
fixture = {
|
|
64
|
+
"object" => "event",
|
|
65
|
+
"id" => "stub",
|
|
66
|
+
"event" => "organization_domain.deleted",
|
|
67
|
+
"data" => {},
|
|
68
|
+
"created_at" => "stub",
|
|
69
|
+
"context" => {}
|
|
70
|
+
}
|
|
71
|
+
model = WorkOS::OrganizationDomainDeleted.new(fixture.to_json)
|
|
72
|
+
json = model.to_h
|
|
73
|
+
assert_kind_of Hash, json
|
|
74
|
+
assert_equal fixture["id"], json[:id]
|
|
75
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
76
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def test_organization_domain_deleted_data_round_trip
|
|
80
|
+
fixture = {
|
|
81
|
+
"object" => "organization_domain",
|
|
82
|
+
"id" => "stub",
|
|
83
|
+
"organization_id" => "stub",
|
|
84
|
+
"domain" => "stub",
|
|
85
|
+
"state" => "stub",
|
|
86
|
+
"verification_prefix" => "stub",
|
|
87
|
+
"verification_token" => "stub",
|
|
88
|
+
"verification_strategy" => "stub",
|
|
89
|
+
"created_at" => "stub",
|
|
90
|
+
"updated_at" => "stub"
|
|
91
|
+
}
|
|
92
|
+
model = WorkOS::OrganizationDomainDeletedData.new(fixture.to_json)
|
|
93
|
+
json = model.to_h
|
|
94
|
+
assert_kind_of Hash, json
|
|
95
|
+
assert_equal fixture["id"], json[:id]
|
|
96
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
97
|
+
assert_equal fixture["domain"], json[:domain]
|
|
98
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
99
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
100
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def test_organization_domain_updated_round_trip
|
|
104
|
+
fixture = {
|
|
105
|
+
"object" => "event",
|
|
106
|
+
"id" => "stub",
|
|
107
|
+
"event" => "organization_domain.updated",
|
|
108
|
+
"data" => {},
|
|
109
|
+
"created_at" => "stub",
|
|
110
|
+
"context" => {}
|
|
111
|
+
}
|
|
112
|
+
model = WorkOS::OrganizationDomainUpdated.new(fixture.to_json)
|
|
113
|
+
json = model.to_h
|
|
114
|
+
assert_kind_of Hash, json
|
|
115
|
+
assert_equal fixture["id"], json[:id]
|
|
116
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
117
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def test_organization_domain_updated_data_round_trip
|
|
121
|
+
fixture = {
|
|
122
|
+
"object" => "organization_domain",
|
|
123
|
+
"id" => "stub",
|
|
124
|
+
"organization_id" => "stub",
|
|
125
|
+
"domain" => "stub",
|
|
126
|
+
"state" => "stub",
|
|
127
|
+
"verification_prefix" => "stub",
|
|
128
|
+
"verification_token" => "stub",
|
|
129
|
+
"verification_strategy" => "stub",
|
|
130
|
+
"created_at" => "stub",
|
|
131
|
+
"updated_at" => "stub"
|
|
132
|
+
}
|
|
133
|
+
model = WorkOS::OrganizationDomainUpdatedData.new(fixture.to_json)
|
|
134
|
+
json = model.to_h
|
|
135
|
+
assert_kind_of Hash, json
|
|
136
|
+
assert_equal fixture["id"], json[:id]
|
|
137
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
138
|
+
assert_equal fixture["domain"], json[:domain]
|
|
139
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
140
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
141
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def test_organization_domain_verification_failed_round_trip
|
|
145
|
+
fixture = {
|
|
146
|
+
"object" => "event",
|
|
147
|
+
"id" => "stub",
|
|
148
|
+
"event" => "organization_domain.verification_failed",
|
|
149
|
+
"data" => {},
|
|
150
|
+
"created_at" => "stub",
|
|
151
|
+
"context" => {}
|
|
152
|
+
}
|
|
153
|
+
model = WorkOS::OrganizationDomainVerificationFailed.new(fixture.to_json)
|
|
154
|
+
json = model.to_h
|
|
155
|
+
assert_kind_of Hash, json
|
|
156
|
+
assert_equal fixture["id"], json[:id]
|
|
157
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
158
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def test_organization_domain_verification_failed_data_round_trip
|
|
162
|
+
fixture = {
|
|
163
|
+
"reason" => "stub",
|
|
164
|
+
"organization_domain" => {}
|
|
165
|
+
}
|
|
166
|
+
model = WorkOS::OrganizationDomainVerificationFailedData.new(fixture.to_json)
|
|
167
|
+
json = model.to_h
|
|
168
|
+
assert_kind_of Hash, json
|
|
169
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def test_organization_domain_verification_failed_data_organization_domain_round_trip
|
|
173
|
+
fixture = {
|
|
174
|
+
"object" => "organization_domain",
|
|
175
|
+
"id" => "stub",
|
|
176
|
+
"organization_id" => "stub",
|
|
177
|
+
"domain" => "stub",
|
|
178
|
+
"state" => "stub",
|
|
179
|
+
"verification_prefix" => "stub",
|
|
180
|
+
"verification_token" => "stub",
|
|
181
|
+
"verification_strategy" => "stub",
|
|
182
|
+
"created_at" => "stub",
|
|
183
|
+
"updated_at" => "stub"
|
|
184
|
+
}
|
|
185
|
+
model = WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain.new(fixture.to_json)
|
|
186
|
+
json = model.to_h
|
|
187
|
+
assert_kind_of Hash, json
|
|
188
|
+
assert_equal fixture["id"], json[:id]
|
|
189
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
190
|
+
assert_equal fixture["domain"], json[:domain]
|
|
191
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
192
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
193
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def test_organization_domain_verified_round_trip
|
|
197
|
+
fixture = {
|
|
198
|
+
"object" => "event",
|
|
199
|
+
"id" => "stub",
|
|
200
|
+
"event" => "organization_domain.verified",
|
|
201
|
+
"data" => {},
|
|
202
|
+
"created_at" => "stub",
|
|
203
|
+
"context" => {}
|
|
204
|
+
}
|
|
205
|
+
model = WorkOS::OrganizationDomainVerified.new(fixture.to_json)
|
|
206
|
+
json = model.to_h
|
|
207
|
+
assert_kind_of Hash, json
|
|
208
|
+
assert_equal fixture["id"], json[:id]
|
|
209
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
210
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def test_organization_domain_verified_data_round_trip
|
|
214
|
+
fixture = {
|
|
215
|
+
"object" => "organization_domain",
|
|
216
|
+
"id" => "stub",
|
|
217
|
+
"organization_id" => "stub",
|
|
218
|
+
"domain" => "stub",
|
|
219
|
+
"state" => "stub",
|
|
220
|
+
"verification_prefix" => "stub",
|
|
221
|
+
"verification_token" => "stub",
|
|
222
|
+
"verification_strategy" => "stub",
|
|
223
|
+
"created_at" => "stub",
|
|
224
|
+
"updated_at" => "stub"
|
|
225
|
+
}
|
|
226
|
+
model = WorkOS::OrganizationDomainVerifiedData.new(fixture.to_json)
|
|
227
|
+
json = model.to_h
|
|
228
|
+
assert_kind_of Hash, json
|
|
229
|
+
assert_equal fixture["id"], json[:id]
|
|
230
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
231
|
+
assert_equal fixture["domain"], json[:domain]
|
|
232
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
233
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
234
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
def test_organization_domain_round_trip
|
|
238
|
+
fixture = {
|
|
239
|
+
"object" => "organization_domain",
|
|
240
|
+
"id" => "stub",
|
|
241
|
+
"organization_id" => "stub",
|
|
242
|
+
"domain" => "stub",
|
|
243
|
+
"state" => "stub",
|
|
244
|
+
"verification_prefix" => "stub",
|
|
245
|
+
"verification_token" => "stub",
|
|
246
|
+
"verification_strategy" => "stub",
|
|
247
|
+
"created_at" => "stub",
|
|
248
|
+
"updated_at" => "stub"
|
|
249
|
+
}
|
|
250
|
+
model = WorkOS::OrganizationDomain.new(fixture.to_json)
|
|
251
|
+
json = model.to_h
|
|
252
|
+
assert_kind_of Hash, json
|
|
253
|
+
assert_equal fixture["id"], json[:id]
|
|
254
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
255
|
+
assert_equal fixture["domain"], json[:domain]
|
|
256
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
257
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
258
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
259
|
+
end
|
|
260
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
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 OrganizationMembershipModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_create_user_organization_membership_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"user_id" => "stub",
|
|
11
|
+
"organization_id" => "stub",
|
|
12
|
+
"role_slug" => "stub",
|
|
13
|
+
"role_slugs" => []
|
|
14
|
+
}
|
|
15
|
+
model = WorkOS::CreateUserOrganizationMembership.new(fixture.to_json)
|
|
16
|
+
json = model.to_h
|
|
17
|
+
assert_kind_of Hash, json
|
|
18
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
19
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
20
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def test_update_user_organization_membership_round_trip
|
|
24
|
+
fixture = {
|
|
25
|
+
"role_slug" => "stub",
|
|
26
|
+
"role_slugs" => []
|
|
27
|
+
}
|
|
28
|
+
model = WorkOS::UpdateUserOrganizationMembership.new(fixture.to_json)
|
|
29
|
+
json = model.to_h
|
|
30
|
+
assert_kind_of Hash, json
|
|
31
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def test_user_organization_membership_round_trip
|
|
35
|
+
fixture = {
|
|
36
|
+
"object" => "organization_membership",
|
|
37
|
+
"id" => "stub",
|
|
38
|
+
"user_id" => "stub",
|
|
39
|
+
"organization_id" => "stub",
|
|
40
|
+
"status" => "stub",
|
|
41
|
+
"directory_managed" => true,
|
|
42
|
+
"organization_name" => "stub",
|
|
43
|
+
"custom_attributes" => {},
|
|
44
|
+
"created_at" => "stub",
|
|
45
|
+
"updated_at" => "stub",
|
|
46
|
+
"role" => {},
|
|
47
|
+
"roles" => [],
|
|
48
|
+
"user" => {}
|
|
49
|
+
}
|
|
50
|
+
model = WorkOS::UserOrganizationMembership.new(fixture.to_json)
|
|
51
|
+
json = model.to_h
|
|
52
|
+
assert_kind_of Hash, json
|
|
53
|
+
assert_equal fixture["id"], json[:id]
|
|
54
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
55
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
56
|
+
assert_equal fixture["directory_managed"], json[:directory_managed]
|
|
57
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
58
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
59
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def test_organization_membership_round_trip
|
|
63
|
+
fixture = {
|
|
64
|
+
"object" => "organization_membership",
|
|
65
|
+
"id" => "stub",
|
|
66
|
+
"user_id" => "stub",
|
|
67
|
+
"organization_id" => "stub",
|
|
68
|
+
"status" => "stub",
|
|
69
|
+
"directory_managed" => true,
|
|
70
|
+
"organization_name" => "stub",
|
|
71
|
+
"custom_attributes" => {},
|
|
72
|
+
"created_at" => "stub",
|
|
73
|
+
"updated_at" => "stub",
|
|
74
|
+
"role" => {},
|
|
75
|
+
"roles" => [],
|
|
76
|
+
"user" => {}
|
|
77
|
+
}
|
|
78
|
+
model = WorkOS::OrganizationMembership.new(fixture.to_json)
|
|
79
|
+
json = model.to_h
|
|
80
|
+
assert_kind_of Hash, json
|
|
81
|
+
assert_equal fixture["id"], json[:id]
|
|
82
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
83
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
84
|
+
assert_equal fixture["directory_managed"], json[:directory_managed]
|
|
85
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
86
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
87
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -60,6 +60,13 @@ class OrganizationsTest < Minitest::Test
|
|
|
60
60
|
refute_nil result
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
def test_list_authorized_applications_returns_expected_result
|
|
64
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/authorized_applications(\?|\z)})
|
|
65
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
66
|
+
result = @client.organizations.list_authorized_applications(organization_id: "stub")
|
|
67
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
68
|
+
end
|
|
69
|
+
|
|
63
70
|
# Parameterized authentication error tests (one per endpoint).
|
|
64
71
|
[
|
|
65
72
|
{name: :list_organizations, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations(\?|\z)}},
|
|
@@ -68,7 +75,8 @@ class OrganizationsTest < Minitest::Test
|
|
|
68
75
|
{name: :get_organization, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}},
|
|
69
76
|
{name: :update_organization, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}},
|
|
70
77
|
{name: :delete_organization, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}},
|
|
71
|
-
{name: :get_audit_log_configuration, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_log_configuration(\?|\z)}, args: {id: "stub"}}
|
|
78
|
+
{name: :get_audit_log_configuration, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_log_configuration(\?|\z)}, args: {id: "stub"}},
|
|
79
|
+
{name: :list_authorized_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/authorized_applications(\?|\z)}, args: {organization_id: "stub"}}
|
|
72
80
|
].each do |spec|
|
|
73
81
|
define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
|
|
74
82
|
stub_request(spec[:verb], spec[:url])
|