workos 10.3.0 → 10.4.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +3 -3
  4. data/.github/workflows/lint.yml +2 -2
  5. data/.github/workflows/release-please.yml +3 -3
  6. data/.github/workflows/release.yml +2 -2
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +234 -156
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +174 -0
  12. data/Gemfile.lock +14 -14
  13. data/README.md +23 -0
  14. data/lib/workos/admin_portal.rb +2 -2
  15. data/lib/workos/agents.rb +5 -1
  16. data/lib/workos/api_keys/validate_api_key.rb +12 -1
  17. data/lib/workos/base_client.rb +6 -2
  18. data/lib/workos/configuration.rb +3 -2
  19. data/lib/workos/inflections.rb +2 -0
  20. data/lib/workos/multi_factor_auth.rb +1 -1
  21. data/lib/workos/pipes/connected_account.rb +9 -0
  22. data/lib/workos/pipes/create_data_integration.rb +3 -0
  23. data/lib/workos/pipes/data_integration.rb +3 -0
  24. data/lib/workos/pipes/data_integration_installation.rb +9 -0
  25. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
  26. data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
  27. data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
  28. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
  29. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -1
  30. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -0
  31. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
  32. data/lib/workos/pipes.rb +324 -17
  33. data/lib/workos/session_manager.rb +11 -6
  34. data/lib/workos/shared/account_selection_required_error.rb +22 -0
  35. data/lib/workos/shared/pipe_connected_account.rb +15 -0
  36. data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
  37. data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
  38. data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
  39. data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
  40. data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
  41. data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
  42. data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
  43. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
  44. data/lib/workos/types/connected_account_connection_role.rb +13 -0
  45. data/lib/workos/types/create_data_integration_ownership.rb +13 -0
  46. data/lib/workos/types/create_webhook_endpoint_events.rb +6 -1
  47. data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
  48. data/lib/workos/types/data_integration_ownership.rb +9 -0
  49. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  50. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
  51. data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
  52. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
  53. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  54. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  55. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
  56. data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
  57. data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
  58. data/lib/workos/types/pipes_ownership.rb +9 -0
  59. data/lib/workos/types/resource_export_completed_data_resource_type.rb +3 -1
  60. data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
  61. data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
  62. data/lib/workos/user_management.rb +87 -0
  63. data/lib/workos/version.rb +1 -1
  64. data/rbi/workos/account_selection_required_error.rbi +30 -0
  65. data/rbi/workos/agents.rbi +2 -1
  66. data/rbi/workos/authkit_oauth_resource.rbi +54 -0
  67. data/rbi/workos/connected_account.rbi +18 -0
  68. data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
  69. data/rbi/workos/create_data_integration.rbi +6 -0
  70. data/rbi/workos/data_integration.rbi +6 -0
  71. data/rbi/workos/data_integration_installation.rbi +19 -1
  72. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  73. data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
  74. data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
  75. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  76. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
  77. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
  78. data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
  79. data/rbi/workos/pipe_connected_account.rbi +30 -0
  80. data/rbi/workos/pipes.rbi +122 -11
  81. data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
  82. data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
  83. data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
  84. data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
  85. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
  86. data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
  87. data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
  88. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
  89. data/rbi/workos/user_management.rbi +28 -0
  90. data/test/workos/test_pipes.rb +64 -0
  91. data/test/workos/test_pipes_model_round_trip.rb +35 -5
  92. data/test/workos/test_session.rb +63 -0
  93. data/test/workos/test_shared_model_round_trip.rb +161 -0
  94. data/test/workos/test_user_management.rb +24 -0
  95. data/test/workos/test_user_management_model_round_trip.rb +32 -0
  96. metadata +35 -1
@@ -220,6 +220,69 @@ class SessionTest < Minitest::Test
220
220
  assert_equal "session_expired", result.session_id
221
221
  end
222
222
 
223
+ # --- jwt_issuer -----------------------------------------------------------
224
+
225
+ def authenticate_with_issuer(jwt_issuer, iss)
226
+ rsa, pub = signing_key_pair
227
+ client = WorkOS::Client.new(api_key: "sk_test_session", client_id: "client_001", jwt_issuer: jwt_issuer)
228
+ sm = client.session_manager
229
+ claims = {"sid" => "session_iss", "exp" => Time.now.to_i + 60}
230
+ claims["iss"] = iss unless iss.nil?
231
+ access_token = make_jwt(claims, rsa)
232
+ sealed = sm.seal_data({"access_token" => access_token}, PASSWORD)
233
+
234
+ stub_request(:get, "https://api.workos.com/sso/jwks/client_001")
235
+ .to_return(status: 200, body: jwks_payload(pub).to_json)
236
+
237
+ sm.authenticate(seal_data: sealed, cookie_password: PASSWORD)
238
+ end
239
+
240
+ def test_authenticate_ignores_issuer_when_jwt_issuer_is_not_configured
241
+ result = authenticate_with_issuer(nil, "https://other.example.com")
242
+ assert_kind_of WorkOS::SessionManager::AuthSuccess, result
243
+ assert result.authenticated
244
+ end
245
+
246
+ def test_authenticate_accepts_matching_jwt_issuer
247
+ result = authenticate_with_issuer("https://api.workos.com", "https://api.workos.com")
248
+ assert_kind_of WorkOS::SessionManager::AuthSuccess, result
249
+ assert result.authenticated
250
+ end
251
+
252
+ def test_authenticate_rejects_mismatched_jwt_issuer
253
+ result = authenticate_with_issuer("https://api.workos.com", "https://other.example.com")
254
+ assert_kind_of WorkOS::SessionManager::AuthError, result
255
+ assert_equal WorkOS::SessionManager::INVALID_JWT, result.reason
256
+ end
257
+
258
+ def test_authenticate_rejects_missing_iss_when_jwt_issuer_is_configured
259
+ result = authenticate_with_issuer("https://api.workos.com", nil)
260
+ assert_kind_of WorkOS::SessionManager::AuthError, result
261
+ assert_equal WorkOS::SessionManager::INVALID_JWT, result.reason
262
+ end
263
+
264
+ def test_authenticate_accepts_any_listed_jwt_issuer
265
+ issuers = ["https://api.workos.com", "https://auth.example.com"]
266
+ result = authenticate_with_issuer(issuers, "https://auth.example.com")
267
+ assert_kind_of WorkOS::SessionManager::AuthSuccess, result
268
+ assert result.authenticated
269
+ end
270
+
271
+ def test_authenticate_rejects_all_tokens_when_jwt_issuer_list_is_empty
272
+ result = authenticate_with_issuer([], "https://api.workos.com")
273
+ assert_kind_of WorkOS::SessionManager::AuthError, result
274
+ assert_equal WorkOS::SessionManager::INVALID_JWT, result.reason
275
+ end
276
+
277
+ def test_global_configuration_passes_jwt_issuer_to_client
278
+ WorkOS.reset_client
279
+ WorkOS.configure { |config| config.jwt_issuer = "https://api.workos.com" }
280
+ assert_equal "https://api.workos.com", WorkOS.client.jwt_issuer
281
+ ensure
282
+ WorkOS.configuration.jwt_issuer = nil
283
+ WorkOS.reset_client
284
+ end
285
+
223
286
  # --- get_logout_url -------------------------------------------------------
224
287
 
225
288
  def test_get_logout_url_includes_session_id_from_authenticate
@@ -152,11 +152,16 @@ class SharedModelRoundTripTest < Minitest::Test
152
152
  fixture = {
153
153
  "object" => "connected_account",
154
154
  "id" => "stub",
155
+ "connection_role" => "stub",
156
+ "account_identifier" => nil,
157
+ "account_display_name" => nil,
155
158
  "data_integration_id" => "stub",
156
159
  "provider_slug" => "stub",
157
160
  "user_id" => nil,
158
161
  "organization_id" => nil,
159
162
  "scopes" => [],
163
+ "auth_method" => "stub",
164
+ "api_key_last_4" => nil,
160
165
  "state" => "stub",
161
166
  "created_at" => "stub",
162
167
  "updated_at" => "stub"
@@ -1006,6 +1011,149 @@ class SharedModelRoundTripTest < Minitest::Test
1006
1011
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1007
1012
  end
1008
1013
 
1014
+ def test_pipes_account_connection_add_failed_round_trip
1015
+ fixture = {
1016
+ "object" => "event",
1017
+ "id" => "stub",
1018
+ "event" => "pipes.account_connection.add_failed",
1019
+ "data" => {},
1020
+ "created_at" => "stub",
1021
+ "context" => {}
1022
+ }
1023
+ model = WorkOS::PipesAccountConnectionAddFailed.new(fixture.to_json)
1024
+ json = model.to_h
1025
+ assert_kind_of Hash, json
1026
+ assert_equal fixture["id"], json[:id]
1027
+ assert_equal fixture["created_at"], json[:created_at]
1028
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1029
+ end
1030
+
1031
+ def test_pipes_account_connection_add_failed_data_round_trip
1032
+ fixture = {
1033
+ "object" => "connection_failed",
1034
+ "data_integration_id" => "stub",
1035
+ "provider_slug" => "stub",
1036
+ "user_id" => nil,
1037
+ "organization_id" => nil,
1038
+ "account_identifier" => nil,
1039
+ "error_code" => "stub",
1040
+ "error_reason" => nil,
1041
+ "provider_error" => nil,
1042
+ "provider_error_description" => nil,
1043
+ "created_at" => "stub"
1044
+ }
1045
+ model = WorkOS::PipesAccountConnectionAddFailedData.new(fixture.to_json)
1046
+ json = model.to_h
1047
+ assert_kind_of Hash, json
1048
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1049
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1050
+ assert_nil json[:user_id]
1051
+ assert_nil json[:organization_id]
1052
+ assert_equal fixture["error_code"], json[:error_code]
1053
+ assert_nil json[:error_reason]
1054
+ assert_nil json[:provider_error]
1055
+ assert_nil json[:provider_error_description]
1056
+ assert_equal fixture["created_at"], json[:created_at]
1057
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1058
+ end
1059
+
1060
+ def test_pipes_account_connection_connected_round_trip
1061
+ fixture = {
1062
+ "object" => "event",
1063
+ "id" => "stub",
1064
+ "event" => "pipes.account_connection.connected",
1065
+ "data" => {},
1066
+ "created_at" => "stub",
1067
+ "context" => {}
1068
+ }
1069
+ model = WorkOS::PipesAccountConnectionConnected.new(fixture.to_json)
1070
+ json = model.to_h
1071
+ assert_kind_of Hash, json
1072
+ assert_equal fixture["id"], json[:id]
1073
+ assert_equal fixture["created_at"], json[:created_at]
1074
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1075
+ end
1076
+
1077
+ def test_pipes_account_connection_connection_failed_round_trip
1078
+ fixture = {
1079
+ "object" => "event",
1080
+ "id" => "stub",
1081
+ "event" => "pipes.account_connection.connection_failed",
1082
+ "data" => {},
1083
+ "created_at" => "stub",
1084
+ "context" => {}
1085
+ }
1086
+ model = WorkOS::PipesAccountConnectionConnectionFailed.new(fixture.to_json)
1087
+ json = model.to_h
1088
+ assert_kind_of Hash, json
1089
+ assert_equal fixture["id"], json[:id]
1090
+ assert_equal fixture["created_at"], json[:created_at]
1091
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1092
+ end
1093
+
1094
+ def test_pipes_account_connection_connection_failed_data_round_trip
1095
+ fixture = {
1096
+ "object" => "connection_failed",
1097
+ "data_integration_id" => "stub",
1098
+ "provider_slug" => "stub",
1099
+ "user_id" => nil,
1100
+ "organization_id" => nil,
1101
+ "account_identifier" => nil,
1102
+ "error_code" => "stub",
1103
+ "error_reason" => nil,
1104
+ "provider_error" => nil,
1105
+ "provider_error_description" => nil,
1106
+ "created_at" => "stub"
1107
+ }
1108
+ model = WorkOS::PipesAccountConnectionConnectionFailedData.new(fixture.to_json)
1109
+ json = model.to_h
1110
+ assert_kind_of Hash, json
1111
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1112
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1113
+ assert_nil json[:user_id]
1114
+ assert_nil json[:organization_id]
1115
+ assert_equal fixture["error_code"], json[:error_code]
1116
+ assert_nil json[:error_reason]
1117
+ assert_nil json[:provider_error]
1118
+ assert_nil json[:provider_error_description]
1119
+ assert_equal fixture["created_at"], json[:created_at]
1120
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1121
+ end
1122
+
1123
+ def test_pipes_account_connection_disconnected_round_trip
1124
+ fixture = {
1125
+ "object" => "event",
1126
+ "id" => "stub",
1127
+ "event" => "pipes.account_connection.disconnected",
1128
+ "data" => {},
1129
+ "created_at" => "stub",
1130
+ "context" => {}
1131
+ }
1132
+ model = WorkOS::PipesAccountConnectionDisconnected.new(fixture.to_json)
1133
+ json = model.to_h
1134
+ assert_kind_of Hash, json
1135
+ assert_equal fixture["id"], json[:id]
1136
+ assert_equal fixture["created_at"], json[:created_at]
1137
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1138
+ end
1139
+
1140
+ def test_pipes_account_connection_reauthorization_needed_round_trip
1141
+ fixture = {
1142
+ "object" => "event",
1143
+ "id" => "stub",
1144
+ "event" => "pipes.account_connection.reauthorization_needed",
1145
+ "data" => {},
1146
+ "created_at" => "stub",
1147
+ "context" => {}
1148
+ }
1149
+ model = WorkOS::PipesAccountConnectionReauthorizationNeeded.new(fixture.to_json)
1150
+ json = model.to_h
1151
+ assert_kind_of Hash, json
1152
+ assert_equal fixture["id"], json[:id]
1153
+ assert_equal fixture["created_at"], json[:created_at]
1154
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1155
+ end
1156
+
1009
1157
  def test_pipes_connected_account_connected_round_trip
1010
1158
  fixture = {
1011
1159
  "object" => "event",
@@ -1047,6 +1195,7 @@ class SharedModelRoundTripTest < Minitest::Test
1047
1195
  "provider_slug" => "stub",
1048
1196
  "user_id" => nil,
1049
1197
  "organization_id" => nil,
1198
+ "account_identifier" => nil,
1050
1199
  "error_code" => "stub",
1051
1200
  "error_reason" => nil,
1052
1201
  "provider_error" => nil,
@@ -1302,6 +1451,18 @@ class SharedModelRoundTripTest < Minitest::Test
1302
1451
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1303
1452
  end
1304
1453
 
1454
+ def test_account_selection_required_error_round_trip
1455
+ fixture = {
1456
+ "code" => "account_selection_required",
1457
+ "message" => "stub"
1458
+ }
1459
+ model = WorkOS::AccountSelectionRequiredError.new(fixture.to_json)
1460
+ json = model.to_h
1461
+ assert_kind_of Hash, json
1462
+ assert_equal fixture["message"], json[:message]
1463
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1464
+ end
1465
+
1305
1466
  def test_auth_method_mismatch_error_round_trip
1306
1467
  fixture = {
1307
1468
  "code" => "auth_method_mismatch",
@@ -203,6 +203,27 @@ class UserManagementTest < Minitest::Test
203
203
  assert_nil result
204
204
  end
205
205
 
206
+ def test_list_authkit_oauth_resources_returns_expected_result
207
+ stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)})
208
+ .to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
209
+ result = @client.user_management.list_authkit_oauth_resources
210
+ assert_kind_of WorkOS::Types::ListStruct, result
211
+ end
212
+
213
+ def test_create_authkit_oauth_resource_returns_expected_result
214
+ stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)})
215
+ .to_return(body: "{}", status: 200)
216
+ result = @client.user_management.create_authkit_oauth_resource(uri: "stub")
217
+ refute_nil result
218
+ end
219
+
220
+ def test_delete_authkit_oauth_resource_returns_expected_result
221
+ stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources/stub(\?|\z)})
222
+ .to_return(body: "{}", status: 200)
223
+ result = @client.user_management.delete_authkit_oauth_resource(id: "stub")
224
+ assert_nil result
225
+ end
226
+
206
227
  def test_list_cors_origins_returns_expected_result
207
228
  stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)})
208
229
  .to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
@@ -530,6 +551,9 @@ class UserManagementTest < Minitest::Test
530
551
  {name: :create_radar_challenge, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges(\?|\z)}, args: {user_id: "stub", pending_authentication_token: "stub", phone_number: "stub"}},
531
552
  {name: :get_radar_challenge, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)}, args: {id: "stub"}},
532
553
  {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
554
+ {name: :list_authkit_oauth_resources, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)}},
555
+ {name: :create_authkit_oauth_resource, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources(\?|\z)}, args: {uri: "stub"}},
556
+ {name: :delete_authkit_oauth_resource, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/authkit_oauth_resources/stub(\?|\z)}, args: {id: "stub"}},
533
557
  {name: :list_cors_origins, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}},
534
558
  {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},
535
559
  {name: :get_email_verification, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/email_verification/stub(\?|\z)}, args: {id: "stub"}},
@@ -44,6 +44,18 @@ class UserManagementModelRoundTripTest < Minitest::Test
44
44
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
45
45
  end
46
46
 
47
+ def test_create_authkit_oauth_resource_round_trip
48
+ fixture = {
49
+ "uri" => "stub",
50
+ "default" => true
51
+ }
52
+ model = WorkOS::CreateAuthkitOAuthResource.new(fixture.to_json)
53
+ json = model.to_h
54
+ assert_kind_of Hash, json
55
+ assert_equal fixture["uri"], json[:uri]
56
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
57
+ end
58
+
47
59
  def test_create_redirect_uri_round_trip
48
60
  fixture = {
49
61
  "uri" => "stub"
@@ -1805,6 +1817,26 @@ class UserManagementModelRoundTripTest < Minitest::Test
1805
1817
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1806
1818
  end
1807
1819
 
1820
+ def test_authkit_oauth_resource_round_trip
1821
+ fixture = {
1822
+ "object" => "authkit_oauth_resource",
1823
+ "id" => "stub",
1824
+ "uri" => "stub",
1825
+ "default" => true,
1826
+ "created_at" => "stub",
1827
+ "updated_at" => "stub"
1828
+ }
1829
+ model = WorkOS::AuthkitOAuthResource.new(fixture.to_json)
1830
+ json = model.to_h
1831
+ assert_kind_of Hash, json
1832
+ assert_equal fixture["id"], json[:id]
1833
+ assert_equal fixture["uri"], json[:uri]
1834
+ assert_equal fixture["default"], json[:default]
1835
+ assert_equal fixture["created_at"], json[:created_at]
1836
+ assert_equal fixture["updated_at"], json[:updated_at]
1837
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1838
+ end
1839
+
1808
1840
  def test_redirect_uri_round_trip
1809
1841
  fixture = {
1810
1842
  "object" => "redirect_uri",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.3.0
4
+ version: 10.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
@@ -485,6 +485,7 @@ files:
485
485
  - lib/workos/session.rb
486
486
  - lib/workos/session_manager.rb
487
487
  - lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb
488
+ - lib/workos/shared/account_selection_required_error.rb
488
489
  - lib/workos/shared/agent_blueprint_created.rb
489
490
  - lib/workos/shared/agent_blueprint_created_data.rb
490
491
  - lib/workos/shared/agent_blueprint_created_data_invocable_by.rb
@@ -540,6 +541,13 @@ files:
540
541
  - lib/workos/shared/group_member_removed_data.rb
541
542
  - lib/workos/shared/group_updated.rb
542
543
  - lib/workos/shared/pipe_connected_account.rb
544
+ - lib/workos/shared/pipes_account_connection_add_failed.rb
545
+ - lib/workos/shared/pipes_account_connection_add_failed_data.rb
546
+ - lib/workos/shared/pipes_account_connection_connected.rb
547
+ - lib/workos/shared/pipes_account_connection_connection_failed.rb
548
+ - lib/workos/shared/pipes_account_connection_connection_failed_data.rb
549
+ - lib/workos/shared/pipes_account_connection_disconnected.rb
550
+ - lib/workos/shared/pipes_account_connection_reauthorization_needed.rb
543
551
  - lib/workos/shared/pipes_connected_account_connected.rb
544
552
  - lib/workos/shared/pipes_connected_account_connection_failed.rb
545
553
  - lib/workos/shared/pipes_connected_account_connection_failed_data.rb
@@ -628,6 +636,7 @@ files:
628
636
  - lib/workos/types/base_model.rb
629
637
  - lib/workos/types/claim_view_response_status.rb
630
638
  - lib/workos/types/connected_account_auth_method.rb
639
+ - lib/workos/types/connected_account_connection_role.rb
631
640
  - lib/workos/types/connected_account_input_state.rb
632
641
  - lib/workos/types/connected_account_state.rb
633
642
  - lib/workos/types/connection_activated_data_connection_type.rb
@@ -647,6 +656,7 @@ files:
647
656
  - lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb
648
657
  - lib/workos/types/create_connection_oidc_options_token_authentication_method.rb
649
658
  - lib/workos/types/create_data_integration_auth_methods.rb
659
+ - lib/workos/types/create_data_integration_ownership.rb
650
660
  - lib/workos/types/create_user_invite_options_locale.rb
651
661
  - lib/workos/types/create_user_password_hash_type.rb
652
662
  - lib/workos/types/create_user_password_salt_position.rb
@@ -659,11 +669,20 @@ files:
659
669
  - lib/workos/types/data_integration_credentials_input_type.rb
660
670
  - lib/workos/types/data_integration_credentials_response_error.rb
661
671
  - lib/workos/types/data_integration_custom_provider_authenticate_via.rb
672
+ - lib/workos/types/data_integration_installation_connection_role.rb
673
+ - lib/workos/types/data_integration_ownership.rb
662
674
  - lib/workos/types/data_integration_state.rb
675
+ - lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb
676
+ - lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb
663
677
  - lib/workos/types/data_integrations_list_response_data_auth_methods.rb
664
678
  - lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb
679
+ - lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb
665
680
  - lib/workos/types/data_integrations_list_response_data_connected_account_state.rb
681
+ - lib/workos/types/data_integrations_list_response_data_connection_owner.rb
666
682
  - lib/workos/types/data_integrations_list_response_data_ownership.rb
683
+ - lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb
684
+ - lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb
685
+ - lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb
667
686
  - lib/workos/types/directory_state.rb
668
687
  - lib/workos/types/directory_type.rb
669
688
  - lib/workos/types/directory_user_state.rb
@@ -715,7 +734,10 @@ files:
715
734
  - lib/workos/types/pagination_order.rb
716
735
  - lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb
717
736
  - lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb
737
+ - lib/workos/types/pipe_connected_account_auth_method.rb
738
+ - lib/workos/types/pipe_connected_account_connection_role.rb
718
739
  - lib/workos/types/pipe_connected_account_state.rb
740
+ - lib/workos/types/pipes_ownership.rb
719
741
  - lib/workos/types/profile_connection_type.rb
720
742
  - lib/workos/types/radar_list_action.rb
721
743
  - lib/workos/types/radar_list_type.rb
@@ -828,10 +850,12 @@ files:
828
850
  - lib/workos/user_management/authentication_sso_timed_out_data.rb
829
851
  - lib/workos/user_management/authentication_sso_timed_out_data_error.rb
830
852
  - lib/workos/user_management/authentication_sso_timed_out_data_sso.rb
853
+ - lib/workos/user_management/authkit_oauth_resource.rb
831
854
  - lib/workos/user_management/authorization_code_session_authenticate_request.rb
832
855
  - lib/workos/user_management/authorized_connect_application_list_data.rb
833
856
  - lib/workos/user_management/confirm_email_change.rb
834
857
  - lib/workos/user_management/cors_origin_response.rb
858
+ - lib/workos/user_management/create_authkit_oauth_resource.rb
835
859
  - lib/workos/user_management/create_cors_origin.rb
836
860
  - lib/workos/user_management/create_magic_code_and_return.rb
837
861
  - lib/workos/user_management/create_password_reset.rb
@@ -969,6 +993,7 @@ files:
969
993
  - lib/workos/widgets/widget_session_token.rb
970
994
  - lib/workos/widgets/widget_session_token_response.rb
971
995
  - rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi
996
+ - rbi/workos/account_selection_required_error.rbi
972
997
  - rbi/workos/action_authentication_denied.rbi
973
998
  - rbi/workos/action_authentication_denied_data.rbi
974
999
  - rbi/workos/action_user_registration_denied.rbi
@@ -1137,6 +1162,7 @@ files:
1137
1162
  - rbi/workos/authentication_sso_timed_out_data.rbi
1138
1163
  - rbi/workos/authentication_sso_timed_out_data_error.rbi
1139
1164
  - rbi/workos/authentication_sso_timed_out_data_sso.rbi
1165
+ - rbi/workos/authkit_oauth_resource.rbi
1140
1166
  - rbi/workos/authorization.rbi
1141
1167
  - rbi/workos/authorization_check.rbi
1142
1168
  - rbi/workos/authorization_code_session_authenticate_request.rbi
@@ -1180,6 +1206,7 @@ files:
1180
1206
  - rbi/workos/connection_saml_certificate_renewed_data_connection.rbi
1181
1207
  - rbi/workos/cors_origin_response.rbi
1182
1208
  - rbi/workos/create_application_secret.rbi
1209
+ - rbi/workos/create_authkit_oauth_resource.rbi
1183
1210
  - rbi/workos/create_authorization_permission.rbi
1184
1211
  - rbi/workos/create_authorization_resource.rbi
1185
1212
  - rbi/workos/create_connection.rbi
@@ -1432,6 +1459,13 @@ files:
1432
1459
  - rbi/workos/permission_updated_data.rbi
1433
1460
  - rbi/workos/pipe_connected_account.rbi
1434
1461
  - rbi/workos/pipes.rbi
1462
+ - rbi/workos/pipes_account_connection_add_failed.rbi
1463
+ - rbi/workos/pipes_account_connection_add_failed_data.rbi
1464
+ - rbi/workos/pipes_account_connection_connected.rbi
1465
+ - rbi/workos/pipes_account_connection_connection_failed.rbi
1466
+ - rbi/workos/pipes_account_connection_connection_failed_data.rbi
1467
+ - rbi/workos/pipes_account_connection_disconnected.rbi
1468
+ - rbi/workos/pipes_account_connection_reauthorization_needed.rbi
1435
1469
  - rbi/workos/pipes_connected_account_connected.rbi
1436
1470
  - rbi/workos/pipes_connected_account_connection_failed.rbi
1437
1471
  - rbi/workos/pipes_connected_account_connection_failed_data.rbi