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,571 @@
|
|
|
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 VaultModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_actor_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"id" => "stub",
|
|
11
|
+
"name" => "stub"
|
|
12
|
+
}
|
|
13
|
+
model = WorkOS::Actor.new(fixture.to_json)
|
|
14
|
+
json = model.to_h
|
|
15
|
+
assert_kind_of Hash, json
|
|
16
|
+
assert_equal fixture["id"], json[:id]
|
|
17
|
+
assert_equal fixture["name"], json[:name]
|
|
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_create_data_key_request_round_trip
|
|
22
|
+
fixture = {
|
|
23
|
+
"context" => {}
|
|
24
|
+
}
|
|
25
|
+
model = WorkOS::CreateDataKeyRequest.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_create_data_key_response_round_trip
|
|
32
|
+
fixture = {
|
|
33
|
+
"context" => {},
|
|
34
|
+
"data_key" => "stub",
|
|
35
|
+
"encrypted_keys" => "stub",
|
|
36
|
+
"id" => "stub"
|
|
37
|
+
}
|
|
38
|
+
model = WorkOS::CreateDataKeyResponse.new(fixture.to_json)
|
|
39
|
+
json = model.to_h
|
|
40
|
+
assert_kind_of Hash, json
|
|
41
|
+
assert_equal fixture["data_key"], json[:data_key]
|
|
42
|
+
assert_equal fixture["encrypted_keys"], json[:encrypted_keys]
|
|
43
|
+
assert_equal fixture["id"], json[:id]
|
|
44
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def test_create_object_request_round_trip
|
|
48
|
+
fixture = {
|
|
49
|
+
"key_context" => {},
|
|
50
|
+
"name" => "stub",
|
|
51
|
+
"value" => "stub"
|
|
52
|
+
}
|
|
53
|
+
model = WorkOS::CreateObjectRequest.new(fixture.to_json)
|
|
54
|
+
json = model.to_h
|
|
55
|
+
assert_kind_of Hash, json
|
|
56
|
+
assert_equal fixture["name"], json[:name]
|
|
57
|
+
assert_equal fixture["value"], json[:value]
|
|
58
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def test_decrypt_request_round_trip
|
|
62
|
+
fixture = {
|
|
63
|
+
"keys" => "stub"
|
|
64
|
+
}
|
|
65
|
+
model = WorkOS::DecryptRequest.new(fixture.to_json)
|
|
66
|
+
json = model.to_h
|
|
67
|
+
assert_kind_of Hash, json
|
|
68
|
+
assert_equal fixture["keys"], json[:keys]
|
|
69
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def test_decrypt_response_round_trip
|
|
73
|
+
fixture = {
|
|
74
|
+
"data_key" => "stub",
|
|
75
|
+
"id" => "stub"
|
|
76
|
+
}
|
|
77
|
+
model = WorkOS::DecryptResponse.new(fixture.to_json)
|
|
78
|
+
json = model.to_h
|
|
79
|
+
assert_kind_of Hash, json
|
|
80
|
+
assert_equal fixture["data_key"], json[:data_key]
|
|
81
|
+
assert_equal fixture["id"], json[:id]
|
|
82
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def test_delete_object_response_round_trip
|
|
86
|
+
fixture = {
|
|
87
|
+
"name" => "stub",
|
|
88
|
+
"success" => true
|
|
89
|
+
}
|
|
90
|
+
model = WorkOS::DeleteObjectResponse.new(fixture.to_json)
|
|
91
|
+
json = model.to_h
|
|
92
|
+
assert_kind_of Hash, json
|
|
93
|
+
assert_equal fixture["name"], json[:name]
|
|
94
|
+
assert_equal fixture["success"], json[:success]
|
|
95
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def test_vault_object_round_trip
|
|
99
|
+
fixture = {
|
|
100
|
+
"id" => "stub",
|
|
101
|
+
"metadata" => {},
|
|
102
|
+
"name" => "stub",
|
|
103
|
+
"value" => "stub"
|
|
104
|
+
}
|
|
105
|
+
model = WorkOS::VaultObject.new(fixture.to_json)
|
|
106
|
+
json = model.to_h
|
|
107
|
+
assert_kind_of Hash, json
|
|
108
|
+
assert_equal fixture["id"], json[:id]
|
|
109
|
+
assert_equal fixture["name"], json[:name]
|
|
110
|
+
assert_equal fixture["value"], json[:value]
|
|
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_object_metadata_round_trip
|
|
115
|
+
fixture = {
|
|
116
|
+
"context" => {},
|
|
117
|
+
"environment_id" => "stub",
|
|
118
|
+
"id" => "stub",
|
|
119
|
+
"key_id" => "stub",
|
|
120
|
+
"updated_at" => "stub",
|
|
121
|
+
"updated_by" => {},
|
|
122
|
+
"version_id" => nil
|
|
123
|
+
}
|
|
124
|
+
model = WorkOS::ObjectMetadata.new(fixture.to_json)
|
|
125
|
+
json = model.to_h
|
|
126
|
+
assert_kind_of Hash, json
|
|
127
|
+
assert_equal fixture["environment_id"], json[:environment_id]
|
|
128
|
+
assert_equal fixture["id"], json[:id]
|
|
129
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
130
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
131
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def test_object_without_value_round_trip
|
|
135
|
+
fixture = {
|
|
136
|
+
"id" => "stub",
|
|
137
|
+
"metadata" => {},
|
|
138
|
+
"name" => "stub"
|
|
139
|
+
}
|
|
140
|
+
model = WorkOS::ObjectWithoutValue.new(fixture.to_json)
|
|
141
|
+
json = model.to_h
|
|
142
|
+
assert_kind_of Hash, json
|
|
143
|
+
assert_equal fixture["id"], json[:id]
|
|
144
|
+
assert_equal fixture["name"], json[:name]
|
|
145
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def test_rekey_request_round_trip
|
|
149
|
+
fixture = {
|
|
150
|
+
"context" => {},
|
|
151
|
+
"encrypted_keys" => "stub"
|
|
152
|
+
}
|
|
153
|
+
model = WorkOS::RekeyRequest.new(fixture.to_json)
|
|
154
|
+
json = model.to_h
|
|
155
|
+
assert_kind_of Hash, json
|
|
156
|
+
assert_equal fixture["encrypted_keys"], json[:encrypted_keys]
|
|
157
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def test_update_object_request_round_trip
|
|
161
|
+
fixture = {
|
|
162
|
+
"value" => "stub",
|
|
163
|
+
"version_check" => nil
|
|
164
|
+
}
|
|
165
|
+
model = WorkOS::UpdateObjectRequest.new(fixture.to_json)
|
|
166
|
+
json = model.to_h
|
|
167
|
+
assert_kind_of Hash, json
|
|
168
|
+
assert_equal fixture["value"], json[:value]
|
|
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_vault_byok_key_deleted_round_trip
|
|
173
|
+
fixture = {
|
|
174
|
+
"object" => "event",
|
|
175
|
+
"id" => "stub",
|
|
176
|
+
"event" => "vault.byok_key.deleted",
|
|
177
|
+
"data" => {},
|
|
178
|
+
"created_at" => "stub",
|
|
179
|
+
"context" => {}
|
|
180
|
+
}
|
|
181
|
+
model = WorkOS::VaultByokKeyDeleted.new(fixture.to_json)
|
|
182
|
+
json = model.to_h
|
|
183
|
+
assert_kind_of Hash, json
|
|
184
|
+
assert_equal fixture["id"], json[:id]
|
|
185
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
186
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def test_vault_byok_key_deleted_data_round_trip
|
|
190
|
+
fixture = {
|
|
191
|
+
"organization_id" => "stub",
|
|
192
|
+
"key_provider" => "stub"
|
|
193
|
+
}
|
|
194
|
+
model = WorkOS::VaultByokKeyDeletedData.new(fixture.to_json)
|
|
195
|
+
json = model.to_h
|
|
196
|
+
assert_kind_of Hash, json
|
|
197
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
198
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def test_vault_byok_key_verification_completed_round_trip
|
|
202
|
+
fixture = {
|
|
203
|
+
"object" => "event",
|
|
204
|
+
"id" => "stub",
|
|
205
|
+
"event" => "vault.byok_key.verification_completed",
|
|
206
|
+
"data" => {},
|
|
207
|
+
"created_at" => "stub",
|
|
208
|
+
"context" => {}
|
|
209
|
+
}
|
|
210
|
+
model = WorkOS::VaultByokKeyVerificationCompleted.new(fixture.to_json)
|
|
211
|
+
json = model.to_h
|
|
212
|
+
assert_kind_of Hash, json
|
|
213
|
+
assert_equal fixture["id"], json[:id]
|
|
214
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
215
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def test_vault_byok_key_verification_completed_data_round_trip
|
|
219
|
+
fixture = {
|
|
220
|
+
"organization_id" => "stub",
|
|
221
|
+
"key_provider" => "stub",
|
|
222
|
+
"verified" => true
|
|
223
|
+
}
|
|
224
|
+
model = WorkOS::VaultByokKeyVerificationCompletedData.new(fixture.to_json)
|
|
225
|
+
json = model.to_h
|
|
226
|
+
assert_kind_of Hash, json
|
|
227
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
228
|
+
assert_equal fixture["verified"], json[:verified]
|
|
229
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def test_vault_data_created_round_trip
|
|
233
|
+
fixture = {
|
|
234
|
+
"object" => "event",
|
|
235
|
+
"id" => "stub",
|
|
236
|
+
"event" => "vault.data.created",
|
|
237
|
+
"data" => {},
|
|
238
|
+
"created_at" => "stub",
|
|
239
|
+
"context" => {}
|
|
240
|
+
}
|
|
241
|
+
model = WorkOS::VaultDataCreated.new(fixture.to_json)
|
|
242
|
+
json = model.to_h
|
|
243
|
+
assert_kind_of Hash, json
|
|
244
|
+
assert_equal fixture["id"], json[:id]
|
|
245
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
246
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def test_vault_data_created_data_round_trip
|
|
250
|
+
fixture = {
|
|
251
|
+
"actor_id" => "stub",
|
|
252
|
+
"actor_source" => "stub",
|
|
253
|
+
"actor_name" => "stub",
|
|
254
|
+
"kv_name" => "stub",
|
|
255
|
+
"key_id" => "stub",
|
|
256
|
+
"key_context" => {}
|
|
257
|
+
}
|
|
258
|
+
model = WorkOS::VaultDataCreatedData.new(fixture.to_json)
|
|
259
|
+
json = model.to_h
|
|
260
|
+
assert_kind_of Hash, json
|
|
261
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
262
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
263
|
+
assert_equal fixture["kv_name"], json[:kv_name]
|
|
264
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
265
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def test_vault_data_deleted_round_trip
|
|
269
|
+
fixture = {
|
|
270
|
+
"object" => "event",
|
|
271
|
+
"id" => "stub",
|
|
272
|
+
"event" => "vault.data.deleted",
|
|
273
|
+
"data" => {},
|
|
274
|
+
"created_at" => "stub",
|
|
275
|
+
"context" => {}
|
|
276
|
+
}
|
|
277
|
+
model = WorkOS::VaultDataDeleted.new(fixture.to_json)
|
|
278
|
+
json = model.to_h
|
|
279
|
+
assert_kind_of Hash, json
|
|
280
|
+
assert_equal fixture["id"], json[:id]
|
|
281
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
282
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def test_vault_data_deleted_data_round_trip
|
|
286
|
+
fixture = {
|
|
287
|
+
"actor_id" => "stub",
|
|
288
|
+
"actor_source" => "stub",
|
|
289
|
+
"actor_name" => "stub",
|
|
290
|
+
"kv_name" => "stub"
|
|
291
|
+
}
|
|
292
|
+
model = WorkOS::VaultDataDeletedData.new(fixture.to_json)
|
|
293
|
+
json = model.to_h
|
|
294
|
+
assert_kind_of Hash, json
|
|
295
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
296
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
297
|
+
assert_equal fixture["kv_name"], json[:kv_name]
|
|
298
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
def test_vault_data_read_round_trip
|
|
302
|
+
fixture = {
|
|
303
|
+
"object" => "event",
|
|
304
|
+
"id" => "stub",
|
|
305
|
+
"event" => "vault.data.read",
|
|
306
|
+
"data" => {},
|
|
307
|
+
"created_at" => "stub",
|
|
308
|
+
"context" => {}
|
|
309
|
+
}
|
|
310
|
+
model = WorkOS::VaultDataRead.new(fixture.to_json)
|
|
311
|
+
json = model.to_h
|
|
312
|
+
assert_kind_of Hash, json
|
|
313
|
+
assert_equal fixture["id"], json[:id]
|
|
314
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
315
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def test_vault_data_read_data_round_trip
|
|
319
|
+
fixture = {
|
|
320
|
+
"actor_id" => "stub",
|
|
321
|
+
"actor_source" => "stub",
|
|
322
|
+
"actor_name" => "stub",
|
|
323
|
+
"kv_name" => "stub",
|
|
324
|
+
"key_id" => "stub"
|
|
325
|
+
}
|
|
326
|
+
model = WorkOS::VaultDataReadData.new(fixture.to_json)
|
|
327
|
+
json = model.to_h
|
|
328
|
+
assert_kind_of Hash, json
|
|
329
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
330
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
331
|
+
assert_equal fixture["kv_name"], json[:kv_name]
|
|
332
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
333
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
def test_vault_data_updated_round_trip
|
|
337
|
+
fixture = {
|
|
338
|
+
"object" => "event",
|
|
339
|
+
"id" => "stub",
|
|
340
|
+
"event" => "vault.data.updated",
|
|
341
|
+
"data" => {},
|
|
342
|
+
"created_at" => "stub",
|
|
343
|
+
"context" => {}
|
|
344
|
+
}
|
|
345
|
+
model = WorkOS::VaultDataUpdated.new(fixture.to_json)
|
|
346
|
+
json = model.to_h
|
|
347
|
+
assert_kind_of Hash, json
|
|
348
|
+
assert_equal fixture["id"], json[:id]
|
|
349
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
350
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
def test_vault_data_updated_data_round_trip
|
|
354
|
+
fixture = {
|
|
355
|
+
"actor_id" => "stub",
|
|
356
|
+
"actor_source" => "stub",
|
|
357
|
+
"actor_name" => "stub",
|
|
358
|
+
"kv_name" => "stub",
|
|
359
|
+
"key_id" => "stub",
|
|
360
|
+
"key_context" => {}
|
|
361
|
+
}
|
|
362
|
+
model = WorkOS::VaultDataUpdatedData.new(fixture.to_json)
|
|
363
|
+
json = model.to_h
|
|
364
|
+
assert_kind_of Hash, json
|
|
365
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
366
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
367
|
+
assert_equal fixture["kv_name"], json[:kv_name]
|
|
368
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
369
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
def test_vault_dek_decrypted_round_trip
|
|
373
|
+
fixture = {
|
|
374
|
+
"object" => "event",
|
|
375
|
+
"id" => "stub",
|
|
376
|
+
"event" => "vault.dek.decrypted",
|
|
377
|
+
"data" => {},
|
|
378
|
+
"created_at" => "stub",
|
|
379
|
+
"context" => {}
|
|
380
|
+
}
|
|
381
|
+
model = WorkOS::VaultDekDecrypted.new(fixture.to_json)
|
|
382
|
+
json = model.to_h
|
|
383
|
+
assert_kind_of Hash, json
|
|
384
|
+
assert_equal fixture["id"], json[:id]
|
|
385
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
386
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
def test_vault_dek_decrypted_data_round_trip
|
|
390
|
+
fixture = {
|
|
391
|
+
"actor_id" => "stub",
|
|
392
|
+
"actor_source" => "stub",
|
|
393
|
+
"actor_name" => "stub",
|
|
394
|
+
"key_id" => "stub"
|
|
395
|
+
}
|
|
396
|
+
model = WorkOS::VaultDekDecryptedData.new(fixture.to_json)
|
|
397
|
+
json = model.to_h
|
|
398
|
+
assert_kind_of Hash, json
|
|
399
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
400
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
401
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
402
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
def test_vault_dek_read_round_trip
|
|
406
|
+
fixture = {
|
|
407
|
+
"object" => "event",
|
|
408
|
+
"id" => "stub",
|
|
409
|
+
"event" => "vault.dek.read",
|
|
410
|
+
"data" => {},
|
|
411
|
+
"created_at" => "stub",
|
|
412
|
+
"context" => {}
|
|
413
|
+
}
|
|
414
|
+
model = WorkOS::VaultDekRead.new(fixture.to_json)
|
|
415
|
+
json = model.to_h
|
|
416
|
+
assert_kind_of Hash, json
|
|
417
|
+
assert_equal fixture["id"], json[:id]
|
|
418
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
419
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
def test_vault_dek_read_data_round_trip
|
|
423
|
+
fixture = {
|
|
424
|
+
"actor_id" => "stub",
|
|
425
|
+
"actor_source" => "stub",
|
|
426
|
+
"actor_name" => "stub",
|
|
427
|
+
"key_ids" => [],
|
|
428
|
+
"key_context" => {}
|
|
429
|
+
}
|
|
430
|
+
model = WorkOS::VaultDekReadData.new(fixture.to_json)
|
|
431
|
+
json = model.to_h
|
|
432
|
+
assert_kind_of Hash, json
|
|
433
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
434
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
435
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
def test_vault_kek_created_round_trip
|
|
439
|
+
fixture = {
|
|
440
|
+
"object" => "event",
|
|
441
|
+
"id" => "stub",
|
|
442
|
+
"event" => "vault.kek.created",
|
|
443
|
+
"data" => {},
|
|
444
|
+
"created_at" => "stub",
|
|
445
|
+
"context" => {}
|
|
446
|
+
}
|
|
447
|
+
model = WorkOS::VaultKekCreated.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_kek_created_data_round_trip
|
|
456
|
+
fixture = {
|
|
457
|
+
"actor_id" => "stub",
|
|
458
|
+
"actor_source" => "stub",
|
|
459
|
+
"actor_name" => "stub",
|
|
460
|
+
"key_name" => "stub",
|
|
461
|
+
"key_id" => "stub"
|
|
462
|
+
}
|
|
463
|
+
model = WorkOS::VaultKekCreatedData.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
|
+
assert_equal fixture["key_name"], json[:key_name]
|
|
469
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
470
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
def test_vault_kek_deleted_round_trip
|
|
474
|
+
fixture = {
|
|
475
|
+
"object" => "event",
|
|
476
|
+
"id" => "stub",
|
|
477
|
+
"event" => "vault.kek.deleted",
|
|
478
|
+
"data" => {},
|
|
479
|
+
"created_at" => "stub",
|
|
480
|
+
"context" => {}
|
|
481
|
+
}
|
|
482
|
+
model = WorkOS::VaultKekDeleted.new(fixture.to_json)
|
|
483
|
+
json = model.to_h
|
|
484
|
+
assert_kind_of Hash, json
|
|
485
|
+
assert_equal fixture["id"], json[:id]
|
|
486
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
487
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
def test_vault_kek_deleted_data_round_trip
|
|
491
|
+
fixture = {
|
|
492
|
+
"actor_id" => "stub",
|
|
493
|
+
"actor_source" => "stub",
|
|
494
|
+
"actor_name" => "stub",
|
|
495
|
+
"key_name" => "stub",
|
|
496
|
+
"key_id" => "stub"
|
|
497
|
+
}
|
|
498
|
+
model = WorkOS::VaultKekDeletedData.new(fixture.to_json)
|
|
499
|
+
json = model.to_h
|
|
500
|
+
assert_kind_of Hash, json
|
|
501
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
502
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
503
|
+
assert_equal fixture["key_name"], json[:key_name]
|
|
504
|
+
assert_equal fixture["key_id"], json[:key_id]
|
|
505
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
def test_vault_metadata_read_round_trip
|
|
509
|
+
fixture = {
|
|
510
|
+
"object" => "event",
|
|
511
|
+
"id" => "stub",
|
|
512
|
+
"event" => "vault.metadata.read",
|
|
513
|
+
"data" => {},
|
|
514
|
+
"created_at" => "stub",
|
|
515
|
+
"context" => {}
|
|
516
|
+
}
|
|
517
|
+
model = WorkOS::VaultMetadataRead.new(fixture.to_json)
|
|
518
|
+
json = model.to_h
|
|
519
|
+
assert_kind_of Hash, json
|
|
520
|
+
assert_equal fixture["id"], json[:id]
|
|
521
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
522
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
def test_vault_metadata_read_data_round_trip
|
|
526
|
+
fixture = {
|
|
527
|
+
"actor_id" => "stub",
|
|
528
|
+
"actor_source" => "stub",
|
|
529
|
+
"actor_name" => "stub",
|
|
530
|
+
"kv_name" => "stub"
|
|
531
|
+
}
|
|
532
|
+
model = WorkOS::VaultMetadataReadData.new(fixture.to_json)
|
|
533
|
+
json = model.to_h
|
|
534
|
+
assert_kind_of Hash, json
|
|
535
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
536
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
537
|
+
assert_equal fixture["kv_name"], json[:kv_name]
|
|
538
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
def test_vault_names_listed_round_trip
|
|
542
|
+
fixture = {
|
|
543
|
+
"object" => "event",
|
|
544
|
+
"id" => "stub",
|
|
545
|
+
"event" => "vault.names.listed",
|
|
546
|
+
"data" => {},
|
|
547
|
+
"created_at" => "stub",
|
|
548
|
+
"context" => {}
|
|
549
|
+
}
|
|
550
|
+
model = WorkOS::VaultNamesListed.new(fixture.to_json)
|
|
551
|
+
json = model.to_h
|
|
552
|
+
assert_kind_of Hash, json
|
|
553
|
+
assert_equal fixture["id"], json[:id]
|
|
554
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
555
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
def test_vault_names_listed_data_round_trip
|
|
559
|
+
fixture = {
|
|
560
|
+
"actor_id" => "stub",
|
|
561
|
+
"actor_source" => "stub",
|
|
562
|
+
"actor_name" => "stub"
|
|
563
|
+
}
|
|
564
|
+
model = WorkOS::VaultNamesListedData.new(fixture.to_json)
|
|
565
|
+
json = model.to_h
|
|
566
|
+
assert_kind_of Hash, json
|
|
567
|
+
assert_equal fixture["actor_id"], json[:actor_id]
|
|
568
|
+
assert_equal fixture["actor_name"], json[:actor_name]
|
|
569
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
570
|
+
end
|
|
571
|
+
end
|
data/test/workos/test_widgets.rb
CHANGED
|
@@ -14,13 +14,13 @@ class WidgetsTest < Minitest::Test
|
|
|
14
14
|
def test_create_token_returns_expected_result
|
|
15
15
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/widgets/token(\?|\z)})
|
|
16
16
|
.to_return(body: "{}", status: 200)
|
|
17
|
-
result = @client.widgets.create_token
|
|
17
|
+
result = @client.widgets.create_token
|
|
18
18
|
refute_nil result
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# Parameterized authentication error tests (one per endpoint).
|
|
22
22
|
[
|
|
23
|
-
{name: :create_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/widgets/token(\?|\z)}
|
|
23
|
+
{name: :create_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/widgets/token(\?|\z)}}
|
|
24
24
|
].each do |spec|
|
|
25
25
|
define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
|
|
26
26
|
stub_request(spec[:verb], spec[:url])
|
|
@@ -0,0 +1,30 @@
|
|
|
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 WidgetsModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_widget_session_token_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"organization_id" => "stub",
|
|
11
|
+
"user_id" => "stub",
|
|
12
|
+
"scopes" => []
|
|
13
|
+
}
|
|
14
|
+
model = WorkOS::WidgetSessionToken.new(fixture.to_json)
|
|
15
|
+
json = model.to_h
|
|
16
|
+
assert_kind_of Hash, json
|
|
17
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_widget_session_token_response_round_trip
|
|
21
|
+
fixture = {
|
|
22
|
+
"token" => "stub"
|
|
23
|
+
}
|
|
24
|
+
model = WorkOS::WidgetSessionTokenResponse.new(fixture.to_json)
|
|
25
|
+
json = model.to_h
|
|
26
|
+
assert_kind_of Hash, json
|
|
27
|
+
assert_equal fixture["token"], json[:token]
|
|
28
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
29
|
+
end
|
|
30
|
+
end
|