workos 9.5.0 → 10.1.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.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/CLAUDE.md +38 -0
  3. data/.github/workflows/block-generated-edits.yml +13 -0
  4. data/.github/workflows/ci.yml +1 -1
  5. data/.github/workflows/docs.yml +1 -1
  6. data/.github/workflows/lint.yml +1 -1
  7. data/.github/workflows/release-please.yml +7 -1
  8. data/.github/workflows/release.yml +1 -1
  9. data/.last-synced-sha +1 -1
  10. data/.oagen-manifest.json +197 -75
  11. data/.release-please-manifest.json +1 -1
  12. data/AGENTS.md +1 -0
  13. data/CHANGELOG.md +118 -0
  14. data/Gemfile.lock +2 -2
  15. data/README.md +15 -14
  16. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
  17. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
  18. data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
  19. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  20. data/lib/workos/agents/agent_registration.rb +40 -0
  21. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  22. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  23. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  24. data/lib/workos/agents/claim_view_response.rb +28 -0
  25. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  26. data/lib/workos/agents.rb +93 -0
  27. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  28. data/lib/workos/api_keys.rb +3 -4
  29. data/lib/workos/authorization/permission_created_data.rb +1 -34
  30. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  31. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  32. data/lib/workos/authorization.rb +24 -24
  33. data/lib/workos/base_client.rb +4 -4
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/connect.rb +23 -19
  36. data/lib/workos/directory_sync.rb +10 -2
  37. data/lib/workos/groups.rb +7 -7
  38. data/lib/workos/inflections.rb +0 -1
  39. data/lib/workos/organization_domains.rb +4 -4
  40. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  41. data/lib/workos/organizations.rb +57 -10
  42. data/lib/workos/pipes/api_key_installation.rb +25 -0
  43. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  44. data/lib/workos/pipes/create_data_integration.rb +10 -1
  45. data/lib/workos/pipes/data_integration.rb +9 -0
  46. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  47. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  48. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
  49. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  50. data/lib/workos/pipes/update_data_integration.rb +4 -1
  51. data/lib/workos/pipes.rb +32 -17
  52. data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
  53. data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
  54. data/lib/workos/pipes_provider.rb +6 -3
  55. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  56. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  57. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  58. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  59. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  60. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  61. data/lib/workos/shared/agent_registration_created.rb +34 -0
  62. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
  63. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  64. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  65. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  66. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  67. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  68. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  69. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  70. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  71. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  72. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  73. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  74. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  75. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  76. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  77. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  78. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  79. data/lib/workos/sso/connection.rb +0 -3
  80. data/lib/workos/sso.rb +73 -26
  81. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  82. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  83. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  84. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  85. data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
  86. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
  87. data/lib/workos/types/applications_registration_types.rb +13 -0
  88. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
  89. data/lib/workos/types/connected_account_auth_method.rb +2 -1
  90. data/lib/workos/types/connected_account_input_state.rb +13 -0
  91. data/lib/workos/types/connected_account_state.rb +2 -1
  92. data/lib/workos/types/create_data_integration_auth_methods.rb +13 -0
  93. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  94. data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
  95. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  96. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  97. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  98. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  99. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  100. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  101. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  102. data/lib/workos/user_management/radar_challenge.rb +43 -0
  103. data/lib/workos/user_management.rb +149 -67
  104. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  105. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  106. data/lib/workos/vault.rb +4 -4
  107. data/lib/workos/version.rb +1 -1
  108. data/lib/workos/widgets.rb +2 -2
  109. data/lib/workos.rb +11 -0
  110. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  111. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  112. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  113. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  114. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  115. data/rbi/workos/agent_registration.rbi +66 -0
  116. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  117. data/rbi/workos/agent_registration_claim.rbi +48 -0
  118. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  119. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  120. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  121. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  122. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  123. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  124. data/rbi/workos/agent_registration_created.rbi +54 -0
  125. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  126. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  127. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  128. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  129. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  130. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  131. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  132. data/rbi/workos/agent_registration_expired.rbi +54 -0
  133. data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
  134. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  135. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  136. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  137. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  138. data/rbi/workos/agents.rbi +42 -0
  139. data/rbi/workos/api_key_installation.rbi +36 -0
  140. data/rbi/workos/api_key_validation_response.rbi +6 -0
  141. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  142. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  143. data/rbi/workos/claim_view_response.rbi +42 -0
  144. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  145. data/rbi/workos/client.rbi +3 -0
  146. data/rbi/workos/configure_data_integration_body.rbi +6 -0
  147. data/rbi/workos/connect.rbi +2 -1
  148. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  149. data/rbi/workos/connection.rbi +0 -6
  150. data/rbi/workos/create_data_integration.rbi +20 -2
  151. data/rbi/workos/data_integration.rbi +18 -0
  152. data/rbi/workos/data_integration_configuration_response.rbi +6 -0
  153. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  154. data/rbi/workos/data_integration_installation.rbi +42 -0
  155. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  156. data/rbi/workos/directory_sync.rbi +3 -1
  157. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  158. data/rbi/workos/organization_domains.rbi +2 -2
  159. data/rbi/workos/organizations.rbi +12 -0
  160. data/rbi/workos/permission_created_data.rbi +6 -0
  161. data/rbi/workos/permission_deleted_data.rbi +6 -0
  162. data/rbi/workos/permission_updated_data.rbi +6 -0
  163. data/rbi/workos/pipes.rbi +10 -5
  164. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  165. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  166. data/rbi/workos/pipes_provider.rbi +2 -1
  167. data/rbi/workos/radar_challenge.rbi +72 -0
  168. data/rbi/workos/radar_challenge_created.rbi +54 -0
  169. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  170. data/rbi/workos/sso.rbi +26 -0
  171. data/rbi/workos/update_data_integration.rbi +8 -2
  172. data/rbi/workos/user_management.rbi +46 -0
  173. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  174. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  175. data/rbi/workos/widget_session_token.rbi +2 -2
  176. data/rbi/workos/widgets.rbi +1 -1
  177. data/test/workos/test_agents.rb +49 -0
  178. data/test/workos/test_agents_model_round_trip.rb +165 -0
  179. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  180. data/test/workos/test_authkit_helpers.rb +22 -10
  181. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  182. data/test/workos/test_base_client.rb +27 -0
  183. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  184. data/test/workos/test_connect_model_round_trip.rb +175 -0
  185. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  186. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  187. data/test/workos/test_groups_model_round_trip.rb +56 -0
  188. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  189. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  190. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  191. data/test/workos/test_organizations.rb +9 -1
  192. data/test/workos/test_organizations_model_round_trip.rb +602 -0
  193. data/test/workos/test_pipes_model_round_trip.rb +44 -5
  194. data/test/workos/test_pipes_provider_model_round_trip.rb +77 -0
  195. data/test/workos/test_shared_model_round_trip.rb +725 -0
  196. data/test/workos/test_sso_model_round_trip.rb +421 -0
  197. data/test/workos/test_user_management.rb +16 -0
  198. data/test/workos/test_user_management_model_round_trip.rb +1501 -0
  199. data/test/workos/test_vault_model_round_trip.rb +571 -0
  200. data/test/workos/test_widgets.rb +2 -2
  201. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  202. metadata +120 -19
  203. data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
  204. data/lib/workos/admin_portal/intent_options.rb +0 -22
  205. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  206. data/lib/workos/sso/connection_option.rb +0 -18
  207. data/rbi/workos/intent_options.rbi +0 -30
  208. data/test/workos/test_model_round_trip.rb +0 -6
@@ -0,0 +1,421 @@
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 SsoModelRoundTripTest < Minitest::Test
8
+ def test_token_query_round_trip
9
+ fixture = {
10
+ "client_id" => "stub",
11
+ "client_secret" => "stub",
12
+ "code" => "stub",
13
+ "grant_type" => "authorization_code"
14
+ }
15
+ model = WorkOS::TokenQuery.new(fixture.to_json)
16
+ json = model.to_h
17
+ assert_kind_of Hash, json
18
+ assert_equal fixture["client_id"], json[:client_id]
19
+ assert_equal fixture["client_secret"], json[:client_secret]
20
+ assert_equal fixture["code"], json[:code]
21
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
22
+ end
23
+
24
+ def test_connection_round_trip
25
+ fixture = {
26
+ "object" => "connection",
27
+ "id" => "stub",
28
+ "organization_id" => "stub",
29
+ "connection_type" => "stub",
30
+ "name" => "stub",
31
+ "state" => "stub",
32
+ "status" => "stub",
33
+ "domains" => [],
34
+ "created_at" => "stub",
35
+ "updated_at" => "stub"
36
+ }
37
+ model = WorkOS::Connection.new(fixture.to_json)
38
+ json = model.to_h
39
+ assert_kind_of Hash, json
40
+ assert_equal fixture["id"], json[:id]
41
+ assert_equal fixture["name"], json[:name]
42
+ assert_equal fixture["created_at"], json[:created_at]
43
+ assert_equal fixture["updated_at"], json[:updated_at]
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_connection_activated_round_trip
48
+ fixture = {
49
+ "object" => "event",
50
+ "id" => "stub",
51
+ "event" => "connection.activated",
52
+ "data" => {},
53
+ "created_at" => "stub",
54
+ "context" => {}
55
+ }
56
+ model = WorkOS::ConnectionActivated.new(fixture.to_json)
57
+ json = model.to_h
58
+ assert_kind_of Hash, json
59
+ assert_equal fixture["id"], json[:id]
60
+ assert_equal fixture["created_at"], json[:created_at]
61
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
62
+ end
63
+
64
+ def test_connection_activated_data_round_trip
65
+ fixture = {
66
+ "object" => "connection",
67
+ "id" => "stub",
68
+ "state" => "stub",
69
+ "name" => "stub",
70
+ "connection_type" => "stub",
71
+ "organization_id" => "stub",
72
+ "created_at" => "stub",
73
+ "updated_at" => "stub",
74
+ "external_key" => "stub",
75
+ "status" => "stub",
76
+ "domains" => []
77
+ }
78
+ model = WorkOS::ConnectionActivatedData.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["name"], json[:name]
83
+ assert_equal fixture["created_at"], json[:created_at]
84
+ assert_equal fixture["updated_at"], json[:updated_at]
85
+ assert_equal fixture["external_key"], json[:external_key]
86
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
87
+ end
88
+
89
+ def test_connection_activated_data_domain_round_trip
90
+ fixture = {
91
+ "object" => "connection_domain",
92
+ "id" => "stub",
93
+ "domain" => "stub"
94
+ }
95
+ model = WorkOS::ConnectionActivatedDataDomain.new(fixture.to_json)
96
+ json = model.to_h
97
+ assert_kind_of Hash, json
98
+ assert_equal fixture["id"], json[:id]
99
+ assert_equal fixture["domain"], json[:domain]
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_connection_deactivated_round_trip
104
+ fixture = {
105
+ "object" => "event",
106
+ "id" => "stub",
107
+ "event" => "connection.deactivated",
108
+ "data" => {},
109
+ "created_at" => "stub",
110
+ "context" => {}
111
+ }
112
+ model = WorkOS::ConnectionDeactivated.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_connection_deactivated_data_round_trip
121
+ fixture = {
122
+ "object" => "connection",
123
+ "id" => "stub",
124
+ "state" => "stub",
125
+ "name" => "stub",
126
+ "connection_type" => "stub",
127
+ "organization_id" => "stub",
128
+ "created_at" => "stub",
129
+ "updated_at" => "stub",
130
+ "external_key" => "stub",
131
+ "status" => "stub",
132
+ "domains" => []
133
+ }
134
+ model = WorkOS::ConnectionDeactivatedData.new(fixture.to_json)
135
+ json = model.to_h
136
+ assert_kind_of Hash, json
137
+ assert_equal fixture["id"], json[:id]
138
+ assert_equal fixture["name"], json[:name]
139
+ assert_equal fixture["created_at"], json[:created_at]
140
+ assert_equal fixture["updated_at"], json[:updated_at]
141
+ assert_equal fixture["external_key"], json[:external_key]
142
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
143
+ end
144
+
145
+ def test_connection_deactivated_data_domain_round_trip
146
+ fixture = {
147
+ "object" => "connection_domain",
148
+ "id" => "stub",
149
+ "domain" => "stub"
150
+ }
151
+ model = WorkOS::ConnectionDeactivatedDataDomain.new(fixture.to_json)
152
+ json = model.to_h
153
+ assert_kind_of Hash, json
154
+ assert_equal fixture["id"], json[:id]
155
+ assert_equal fixture["domain"], json[:domain]
156
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
157
+ end
158
+
159
+ def test_connection_deleted_round_trip
160
+ fixture = {
161
+ "object" => "event",
162
+ "id" => "stub",
163
+ "event" => "connection.deleted",
164
+ "data" => {},
165
+ "created_at" => "stub",
166
+ "context" => {}
167
+ }
168
+ model = WorkOS::ConnectionDeleted.new(fixture.to_json)
169
+ json = model.to_h
170
+ assert_kind_of Hash, json
171
+ assert_equal fixture["id"], json[:id]
172
+ assert_equal fixture["created_at"], json[:created_at]
173
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
174
+ end
175
+
176
+ def test_connection_deleted_data_round_trip
177
+ fixture = {
178
+ "object" => "connection",
179
+ "id" => "stub",
180
+ "state" => "stub",
181
+ "name" => "stub",
182
+ "connection_type" => "stub",
183
+ "organization_id" => "stub",
184
+ "created_at" => "stub",
185
+ "updated_at" => "stub"
186
+ }
187
+ model = WorkOS::ConnectionDeletedData.new(fixture.to_json)
188
+ json = model.to_h
189
+ assert_kind_of Hash, json
190
+ assert_equal fixture["id"], json[:id]
191
+ assert_equal fixture["name"], json[:name]
192
+ assert_equal fixture["created_at"], json[:created_at]
193
+ assert_equal fixture["updated_at"], json[:updated_at]
194
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
195
+ end
196
+
197
+ def test_connection_saml_certificate_renewal_required_round_trip
198
+ fixture = {
199
+ "object" => "event",
200
+ "id" => "stub",
201
+ "event" => "connection.saml_certificate_renewal_required",
202
+ "data" => {},
203
+ "created_at" => "stub",
204
+ "context" => {}
205
+ }
206
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequired.new(fixture.to_json)
207
+ json = model.to_h
208
+ assert_kind_of Hash, json
209
+ assert_equal fixture["id"], json[:id]
210
+ assert_equal fixture["created_at"], json[:created_at]
211
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
212
+ end
213
+
214
+ def test_connection_saml_certificate_renewal_required_data_round_trip
215
+ fixture = {
216
+ "connection" => {},
217
+ "certificate" => {},
218
+ "days_until_expiry" => 1
219
+ }
220
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredData.new(fixture.to_json)
221
+ json = model.to_h
222
+ assert_kind_of Hash, json
223
+ assert_equal fixture["days_until_expiry"], json[:days_until_expiry]
224
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
225
+ end
226
+
227
+ def test_connection_saml_certificate_renewal_required_data_connection_round_trip
228
+ fixture = {
229
+ "id" => "stub",
230
+ "organization_id" => "stub"
231
+ }
232
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection.new(fixture.to_json)
233
+ json = model.to_h
234
+ assert_kind_of Hash, json
235
+ assert_equal fixture["id"], json[:id]
236
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
237
+ end
238
+
239
+ def test_connection_saml_certificate_renewal_required_data_certificate_round_trip
240
+ fixture = {
241
+ "certificate_type" => "stub",
242
+ "expiry_date" => "stub",
243
+ "is_expired" => true
244
+ }
245
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate.new(fixture.to_json)
246
+ json = model.to_h
247
+ assert_kind_of Hash, json
248
+ assert_equal fixture["expiry_date"], json[:expiry_date]
249
+ assert_equal fixture["is_expired"], json[:is_expired]
250
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
251
+ end
252
+
253
+ def test_connection_saml_certificate_renewed_round_trip
254
+ fixture = {
255
+ "object" => "event",
256
+ "id" => "stub",
257
+ "event" => "connection.saml_certificate_renewed",
258
+ "data" => {},
259
+ "created_at" => "stub",
260
+ "context" => {}
261
+ }
262
+ model = WorkOS::ConnectionSAMLCertificateRenewed.new(fixture.to_json)
263
+ json = model.to_h
264
+ assert_kind_of Hash, json
265
+ assert_equal fixture["id"], json[:id]
266
+ assert_equal fixture["created_at"], json[:created_at]
267
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
268
+ end
269
+
270
+ def test_connection_saml_certificate_renewed_data_round_trip
271
+ fixture = {
272
+ "connection" => {},
273
+ "certificate" => {},
274
+ "renewed_at" => "stub"
275
+ }
276
+ model = WorkOS::ConnectionSAMLCertificateRenewedData.new(fixture.to_json)
277
+ json = model.to_h
278
+ assert_kind_of Hash, json
279
+ assert_equal fixture["renewed_at"], json[:renewed_at]
280
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
281
+ end
282
+
283
+ def test_connection_saml_certificate_renewed_data_connection_round_trip
284
+ fixture = {
285
+ "id" => "stub",
286
+ "organization_id" => "stub"
287
+ }
288
+ model = WorkOS::ConnectionSAMLCertificateRenewedDataConnection.new(fixture.to_json)
289
+ json = model.to_h
290
+ assert_kind_of Hash, json
291
+ assert_equal fixture["id"], json[:id]
292
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
293
+ end
294
+
295
+ def test_connection_saml_certificate_renewed_data_certificate_round_trip
296
+ fixture = {
297
+ "certificate_type" => "stub",
298
+ "expiry_date" => "stub"
299
+ }
300
+ model = WorkOS::ConnectionSAMLCertificateRenewedDataCertificate.new(fixture.to_json)
301
+ json = model.to_h
302
+ assert_kind_of Hash, json
303
+ assert_equal fixture["expiry_date"], json[:expiry_date]
304
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
305
+ end
306
+
307
+ def test_sso_authorize_url_response_round_trip
308
+ fixture = {
309
+ "url" => "stub"
310
+ }
311
+ model = WorkOS::SSOAuthorizeUrlResponse.new(fixture.to_json)
312
+ json = model.to_h
313
+ assert_kind_of Hash, json
314
+ assert_equal fixture["url"], json[:url]
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_profile_round_trip
319
+ fixture = {
320
+ "object" => "profile",
321
+ "id" => "stub",
322
+ "organization_id" => nil,
323
+ "connection_id" => "stub",
324
+ "connection_type" => "stub",
325
+ "idp_id" => "stub",
326
+ "email" => "stub",
327
+ "first_name" => nil,
328
+ "last_name" => nil,
329
+ "name" => nil,
330
+ "role" => nil,
331
+ "roles" => nil,
332
+ "groups" => [],
333
+ "custom_attributes" => {},
334
+ "raw_attributes" => {}
335
+ }
336
+ model = WorkOS::Profile.new(fixture.to_json)
337
+ json = model.to_h
338
+ assert_kind_of Hash, json
339
+ assert_equal fixture["id"], json[:id]
340
+ assert_nil json[:organization_id]
341
+ assert_equal fixture["connection_id"], json[:connection_id]
342
+ assert_equal fixture["idp_id"], json[:idp_id]
343
+ assert_equal fixture["email"], json[:email]
344
+ assert_nil json[:first_name]
345
+ assert_nil json[:last_name]
346
+ assert_nil json[:name]
347
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
348
+ end
349
+
350
+ def test_sso_token_response_round_trip
351
+ fixture = {
352
+ "token_type" => "Bearer",
353
+ "access_token" => "stub",
354
+ "expires_in" => 1,
355
+ "profile" => {},
356
+ "oauth_tokens" => {}
357
+ }
358
+ model = WorkOS::SSOTokenResponse.new(fixture.to_json)
359
+ json = model.to_h
360
+ assert_kind_of Hash, json
361
+ assert_equal fixture["access_token"], json[:access_token]
362
+ assert_equal fixture["expires_in"], json[:expires_in]
363
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
364
+ end
365
+
366
+ def test_sso_logout_authorize_response_round_trip
367
+ fixture = {
368
+ "logout_url" => "stub",
369
+ "logout_token" => "stub"
370
+ }
371
+ model = WorkOS::SSOLogoutAuthorizeResponse.new(fixture.to_json)
372
+ json = model.to_h
373
+ assert_kind_of Hash, json
374
+ assert_equal fixture["logout_url"], json[:logout_url]
375
+ assert_equal fixture["logout_token"], json[:logout_token]
376
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
377
+ end
378
+
379
+ def test_sso_token_response_oauth_token_round_trip
380
+ fixture = {
381
+ "provider" => "stub",
382
+ "refresh_token" => "stub",
383
+ "access_token" => "stub",
384
+ "expires_at" => 1,
385
+ "scopes" => []
386
+ }
387
+ model = WorkOS::SSOTokenResponseOAuthToken.new(fixture.to_json)
388
+ json = model.to_h
389
+ assert_kind_of Hash, json
390
+ assert_equal fixture["provider"], json[:provider]
391
+ assert_equal fixture["refresh_token"], json[:refresh_token]
392
+ assert_equal fixture["access_token"], json[:access_token]
393
+ assert_equal fixture["expires_at"], json[:expires_at]
394
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
395
+ end
396
+
397
+ def test_connection_domain_round_trip
398
+ fixture = {
399
+ "id" => "stub",
400
+ "object" => "connection_domain",
401
+ "domain" => "stub"
402
+ }
403
+ model = WorkOS::ConnectionDomain.new(fixture.to_json)
404
+ json = model.to_h
405
+ assert_kind_of Hash, json
406
+ assert_equal fixture["id"], json[:id]
407
+ assert_equal fixture["domain"], json[:domain]
408
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
409
+ end
410
+
411
+ def test_sso_logout_authorize_request_round_trip
412
+ fixture = {
413
+ "profile_id" => "stub"
414
+ }
415
+ model = WorkOS::SSOLogoutAuthorizeRequest.new(fixture.to_json)
416
+ json = model.to_h
417
+ assert_kind_of Hash, json
418
+ assert_equal fixture["profile_id"], json[:profile_id]
419
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
420
+ end
421
+ end
@@ -189,6 +189,13 @@ class UserManagementTest < Minitest::Test
189
189
  refute_nil result
190
190
  end
191
191
 
192
+ def test_get_radar_challenge_returns_expected_result
193
+ stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)})
194
+ .to_return(body: "{}", status: 200)
195
+ result = @client.user_management.get_radar_challenge(id: "stub")
196
+ refute_nil result
197
+ end
198
+
192
199
  def test_revoke_session_returns_expected_result
193
200
  stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)})
194
201
  .to_return(body: "{}", status: 200)
@@ -431,6 +438,13 @@ class UserManagementTest < Minitest::Test
431
438
  refute_nil result
432
439
  end
433
440
 
441
+ def test_delete_redirect_uris_returns_expected_result
442
+ stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/redirect_uris/stub(\?|\z)})
443
+ .to_return(body: "{}", status: 200)
444
+ result = @client.user_management.delete_redirect_uris(id: "stub")
445
+ assert_nil result
446
+ end
447
+
434
448
  def test_list_user_authorized_applications_returns_expected_result
435
449
  stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)})
436
450
  .to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
@@ -465,6 +479,7 @@ class UserManagementTest < Minitest::Test
465
479
  {name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", grant_type: "authorization_code", code: "stub"}},
466
480
  {name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}},
467
481
  {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"}},
482
+ {name: :get_radar_challenge, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)}, args: {id: "stub"}},
468
483
  {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
469
484
  {name: :list_cors_origins, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}},
470
485
  {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},
@@ -497,6 +512,7 @@ class UserManagementTest < Minitest::Test
497
512
  {name: :get_magic_auth, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth/stub(\?|\z)}, args: {id: "stub"}},
498
513
  {name: :list_redirect_uris, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}},
499
514
  {name: :create_redirect_uri, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}, args: {uri: "stub"}},
515
+ {name: :delete_redirect_uris, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris/stub(\?|\z)}, args: {id: "stub"}},
500
516
  {name: :list_user_authorized_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)}, args: {user_id: "stub"}},
501
517
  {name: :delete_user_authorized_application, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications/stub(\?|\z)}, args: {application_id: "stub", user_id: "stub"}},
502
518
  {name: :list_user_api_keys, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}, args: {user_id: "stub"}},