workos 9.1.0 → 9.3.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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release-please.yml +42 -83
  3. data/.last-synced-sha +1 -1
  4. data/.oagen-manifest.json +74 -3
  5. data/.release-please-manifest.json +1 -1
  6. data/CHANGELOG.md +64 -0
  7. data/Gemfile.lock +2 -2
  8. data/lib/workos/authorization/create_group_role_assignment.rb +7 -0
  9. data/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb +7 -0
  10. data/lib/workos/authorization/group_role_assignment.rb +37 -0
  11. data/lib/workos/authorization/group_role_assignment_list.rb +25 -0
  12. data/lib/workos/authorization/group_role_assignment_resource.rb +25 -0
  13. data/lib/workos/authorization/replace_group_role_assignment_entry.rb +7 -0
  14. data/lib/workos/authorization/replace_group_role_assignments.rb +18 -0
  15. data/lib/workos/authorization/user_role_assignment_resource.rb +1 -19
  16. data/lib/workos/authorization.rb +180 -0
  17. data/lib/workos/client.rb +8 -0
  18. data/lib/workos/client_api/client_api_token.rb +22 -0
  19. data/lib/workos/client_api/client_api_token_response.rb +18 -0
  20. data/lib/workos/client_api.rb +39 -0
  21. data/lib/workos/organization_membership/organization_membership.rb +3 -0
  22. data/lib/workos/organization_membership/user_organization_membership.rb +3 -0
  23. data/lib/workos/pipes/connected_account.rb +6 -0
  24. data/lib/workos/pipes/data_integrations_list_response_data.rb +3 -0
  25. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
  26. data/lib/workos/pipes.rb +5 -5
  27. data/lib/workos/pipes_provider/configure_data_integration_body.rb +28 -0
  28. data/lib/workos/pipes_provider/data_integration_configuration_list_response.rb +22 -0
  29. data/lib/workos/pipes_provider/data_integration_configuration_response.rb +46 -0
  30. data/lib/workos/pipes_provider/data_integration_credentials.rb +31 -0
  31. data/lib/workos/pipes_provider.rb +68 -0
  32. data/lib/workos/types/connected_account_auth_method.rb +13 -0
  33. data/lib/workos/types/data_integration_access_token_response_error.rb +2 -2
  34. data/lib/workos/types/data_integration_credentials_credentials_type.rb +14 -0
  35. data/lib/workos/types/data_integrations_list_response_data_auth_methods.rb +9 -0
  36. data/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb +9 -0
  37. data/lib/workos/types/widget_session_token_scopes.rb +2 -1
  38. data/lib/workos/user_management.rb +1 -1
  39. data/lib/workos/version.rb +1 -1
  40. data/lib/workos/widgets/widget_session_token_response.rb +1 -12
  41. data/lib/workos.rb +2 -0
  42. data/rbi/workos/authorization.rbi +63 -0
  43. data/rbi/workos/authorization_code_session_authenticate_request.rbi +2 -2
  44. data/rbi/workos/client.rbi +6 -0
  45. data/rbi/workos/client_api.rbi +22 -0
  46. data/rbi/workos/client_api_token.rbi +30 -0
  47. data/rbi/workos/client_api_token_response.rbi +24 -0
  48. data/rbi/workos/configure_data_integration_body.rbi +42 -0
  49. data/rbi/workos/connected_account.rbi +12 -0
  50. data/rbi/workos/create_group_role_assignment.rbi +42 -0
  51. data/rbi/workos/data_integration_configuration_list_response.rbi +30 -0
  52. data/rbi/workos/data_integration_configuration_response.rbi +78 -0
  53. data/rbi/workos/data_integration_credentials.rbi +48 -0
  54. data/rbi/workos/data_integrations_list_response_data.rbi +6 -0
  55. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
  56. data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +42 -0
  57. data/rbi/workos/group_role_assignment.rbi +60 -0
  58. data/rbi/workos/group_role_assignment_resource.rbi +36 -0
  59. data/rbi/workos/organization_membership.rbi +6 -0
  60. data/rbi/workos/organization_membership_service.rbi +1 -1
  61. data/rbi/workos/pipes.rbi +2 -2
  62. data/rbi/workos/pipes_provider.rbi +34 -0
  63. data/rbi/workos/refresh_token_session_authenticate_request.rbi +2 -2
  64. data/rbi/workos/replace_group_role_assignment_entry.rbi +42 -0
  65. data/rbi/workos/replace_group_role_assignments.rbi +24 -0
  66. data/rbi/workos/user_management.rbi +3 -3
  67. data/rbi/workos/user_organization_membership.rbi +6 -0
  68. data/test/workos/test_authorization.rb +48 -0
  69. data/test/workos/test_client_api.rb +33 -0
  70. data/test/workos/test_model_round_trip.rb +222 -177
  71. data/test/workos/test_pipes.rb +3 -3
  72. data/test/workos/test_pipes_provider.rb +41 -0
  73. data/test/workos/test_user_management.rb +2 -2
  74. metadata +36 -1
@@ -298,6 +298,58 @@ class ModelRoundTripTest < Minitest::Test
298
298
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
299
299
  end
300
300
 
301
+ def test_create_group_role_assignment_round_trip
302
+ fixture = {
303
+ "role_slug" => "stub",
304
+ "resource_id" => "stub",
305
+ "resource_external_id" => "stub",
306
+ "resource_type_slug" => "stub"
307
+ }
308
+ model = WorkOS::CreateGroupRoleAssignment.new(fixture.to_json)
309
+ json = model.to_h
310
+ assert_kind_of Hash, json
311
+ assert_equal fixture["role_slug"], json[:role_slug]
312
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
313
+ end
314
+
315
+ def test_replace_group_role_assignment_entry_round_trip
316
+ fixture = {
317
+ "role_slug" => "stub",
318
+ "resource_id" => "stub",
319
+ "resource_external_id" => "stub",
320
+ "resource_type_slug" => "stub"
321
+ }
322
+ model = WorkOS::ReplaceGroupRoleAssignmentEntry.new(fixture.to_json)
323
+ json = model.to_h
324
+ assert_kind_of Hash, json
325
+ assert_equal fixture["role_slug"], json[:role_slug]
326
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
327
+ end
328
+
329
+ def test_replace_group_role_assignments_round_trip
330
+ fixture = {
331
+ "role_assignments" => []
332
+ }
333
+ model = WorkOS::ReplaceGroupRoleAssignments.new(fixture.to_json)
334
+ json = model.to_h
335
+ assert_kind_of Hash, json
336
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
337
+ end
338
+
339
+ def test_delete_group_role_assignments_by_criteria_round_trip
340
+ fixture = {
341
+ "role_slug" => "stub",
342
+ "resource_id" => "stub",
343
+ "resource_external_id" => "stub",
344
+ "resource_type_slug" => "stub"
345
+ }
346
+ model = WorkOS::DeleteGroupRoleAssignmentsByCriteria.new(fixture.to_json)
347
+ json = model.to_h
348
+ assert_kind_of Hash, json
349
+ assert_equal fixture["role_slug"], json[:role_slug]
350
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
351
+ end
352
+
301
353
  def test_assign_role_round_trip
302
354
  fixture = {
303
355
  "role_slug" => "stub",
@@ -881,6 +933,19 @@ class ModelRoundTripTest < Minitest::Test
881
933
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
882
934
  end
883
935
 
936
+ def test_client_api_token_round_trip
937
+ fixture = {
938
+ "organization_id" => "stub",
939
+ "user_id" => "stub"
940
+ }
941
+ model = WorkOS::ClientApiToken.new(fixture.to_json)
942
+ json = model.to_h
943
+ assert_kind_of Hash, json
944
+ assert_equal fixture["organization_id"], json[:organization_id]
945
+ assert_equal fixture["user_id"], json[:user_id]
946
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
947
+ end
948
+
884
949
  def test_token_query_round_trip
885
950
  fixture = {
886
951
  "client_id" => "stub",
@@ -1034,39 +1099,6 @@ class ModelRoundTripTest < Minitest::Test
1034
1099
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1035
1100
  end
1036
1101
 
1037
- def test_object_summary_round_trip
1038
- fixture = {
1039
- "id" => "stub",
1040
- "name" => "stub",
1041
- "updated_at" => nil
1042
- }
1043
- model = WorkOS::ObjectSummary.new(fixture.to_json)
1044
- json = model.to_h
1045
- assert_kind_of Hash, json
1046
- assert_equal fixture["id"], json[:id]
1047
- assert_equal fixture["name"], json[:name]
1048
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1049
- end
1050
-
1051
- def test_object_version_round_trip
1052
- fixture = {
1053
- "created_at" => "stub",
1054
- "current_version" => true,
1055
- "etag" => "stub",
1056
- "id" => "stub",
1057
- "size" => 1
1058
- }
1059
- model = WorkOS::ObjectVersion.new(fixture.to_json)
1060
- json = model.to_h
1061
- assert_kind_of Hash, json
1062
- assert_equal fixture["created_at"], json[:created_at]
1063
- assert_equal fixture["current_version"], json[:current_version]
1064
- assert_equal fixture["etag"], json[:etag]
1065
- assert_equal fixture["id"], json[:id]
1066
- assert_equal fixture["size"], json[:size]
1067
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1068
- end
1069
-
1070
1102
  def test_object_without_value_round_trip
1071
1103
  fixture = {
1072
1104
  "id" => "stub",
@@ -1489,6 +1521,26 @@ class ModelRoundTripTest < Minitest::Test
1489
1521
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1490
1522
  end
1491
1523
 
1524
+ def test_group_role_assignment_round_trip
1525
+ fixture = {
1526
+ "object" => "group_role_assignment",
1527
+ "id" => "stub",
1528
+ "group_id" => "stub",
1529
+ "role" => {},
1530
+ "resource" => {},
1531
+ "created_at" => "stub",
1532
+ "updated_at" => "stub"
1533
+ }
1534
+ model = WorkOS::GroupRoleAssignment.new(fixture.to_json)
1535
+ json = model.to_h
1536
+ assert_kind_of Hash, json
1537
+ assert_equal fixture["id"], json[:id]
1538
+ assert_equal fixture["group_id"], json[:group_id]
1539
+ assert_equal fixture["created_at"], json[:created_at]
1540
+ assert_equal fixture["updated_at"], json[:updated_at]
1541
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1542
+ end
1543
+
1492
1544
  def test_user_role_assignment_round_trip
1493
1545
  fixture = {
1494
1546
  "object" => "role_assignment",
@@ -1841,24 +1893,6 @@ class ModelRoundTripTest < Minitest::Test
1841
1893
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1842
1894
  end
1843
1895
 
1844
- def test_event_schema_round_trip
1845
- fixture = {
1846
- "object" => "event",
1847
- "id" => "stub",
1848
- "event" => "stub",
1849
- "data" => {},
1850
- "created_at" => "stub",
1851
- "context" => {}
1852
- }
1853
- model = WorkOS::EventSchema.new(fixture.to_json)
1854
- json = model.to_h
1855
- assert_kind_of Hash, json
1856
- assert_equal fixture["id"], json[:id]
1857
- assert_equal fixture["event"], json[:event]
1858
- assert_equal fixture["created_at"], json[:created_at]
1859
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1860
- end
1861
-
1862
1896
  def test_action_authentication_denied_round_trip
1863
1897
  fixture = {
1864
1898
  "object" => "event",
@@ -6096,30 +6130,6 @@ class ModelRoundTripTest < Minitest::Test
6096
6130
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6097
6131
  end
6098
6132
 
6099
- def test_organization_domain_stand_alone_round_trip
6100
- fixture = {
6101
- "object" => "organization_domain",
6102
- "id" => "stub",
6103
- "organization_id" => "stub",
6104
- "domain" => "stub",
6105
- "state" => "stub",
6106
- "verification_prefix" => "stub",
6107
- "verification_token" => "stub",
6108
- "verification_strategy" => "stub",
6109
- "created_at" => "stub",
6110
- "updated_at" => "stub"
6111
- }
6112
- model = WorkOS::OrganizationDomainStandAlone.new(fixture.to_json)
6113
- json = model.to_h
6114
- assert_kind_of Hash, json
6115
- assert_equal fixture["id"], json[:id]
6116
- assert_equal fixture["organization_id"], json[:organization_id]
6117
- assert_equal fixture["domain"], json[:domain]
6118
- assert_equal fixture["created_at"], json[:created_at]
6119
- assert_equal fixture["updated_at"], json[:updated_at]
6120
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6121
- end
6122
-
6123
6133
  def test_flag_round_trip
6124
6134
  fixture = {
6125
6135
  "object" => "feature_flag",
@@ -6148,32 +6158,6 @@ class ModelRoundTripTest < Minitest::Test
6148
6158
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6149
6159
  end
6150
6160
 
6151
- def test_organization_api_key_round_trip
6152
- fixture = {
6153
- "object" => "api_key",
6154
- "id" => "stub",
6155
- "owner" => {},
6156
- "name" => "stub",
6157
- "obfuscated_value" => "stub",
6158
- "last_used_at" => nil,
6159
- "expires_at" => nil,
6160
- "permissions" => [],
6161
- "created_at" => "stub",
6162
- "updated_at" => "stub"
6163
- }
6164
- model = WorkOS::OrganizationApiKey.new(fixture.to_json)
6165
- json = model.to_h
6166
- assert_kind_of Hash, json
6167
- assert_equal fixture["id"], json[:id]
6168
- assert_equal fixture["name"], json[:name]
6169
- assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
6170
- assert_nil json[:last_used_at]
6171
- assert_nil json[:expires_at]
6172
- assert_equal fixture["created_at"], json[:created_at]
6173
- assert_equal fixture["updated_at"], json[:updated_at]
6174
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6175
- end
6176
-
6177
6161
  def test_organization_api_key_with_value_round_trip
6178
6162
  fixture = {
6179
6163
  "object" => "api_key",
@@ -6241,6 +6225,74 @@ class ModelRoundTripTest < Minitest::Test
6241
6225
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6242
6226
  end
6243
6227
 
6228
+ def test_data_integration_credentials_round_trip
6229
+ fixture = {
6230
+ "credentials_type" => "stub",
6231
+ "has_credentials" => true,
6232
+ "client_id" => nil,
6233
+ "client_secret_last_four" => nil,
6234
+ "redirect_uri" => "stub"
6235
+ }
6236
+ model = WorkOS::DataIntegrationCredentials.new(fixture.to_json)
6237
+ json = model.to_h
6238
+ assert_kind_of Hash, json
6239
+ assert_equal fixture["has_credentials"], json[:has_credentials]
6240
+ assert_nil json[:client_id]
6241
+ assert_nil json[:client_secret_last_four]
6242
+ assert_equal fixture["redirect_uri"], json[:redirect_uri]
6243
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6244
+ end
6245
+
6246
+ def test_data_integration_configuration_response_round_trip
6247
+ fixture = {
6248
+ "object" => "data_integration_configuration",
6249
+ "id" => "stub",
6250
+ "organization_id" => "stub",
6251
+ "slug" => "stub",
6252
+ "name" => "stub",
6253
+ "enabled" => true,
6254
+ "scopes" => nil,
6255
+ "created_at" => "stub",
6256
+ "updated_at" => "stub",
6257
+ "credentials" => {}
6258
+ }
6259
+ model = WorkOS::DataIntegrationConfigurationResponse.new(fixture.to_json)
6260
+ json = model.to_h
6261
+ assert_kind_of Hash, json
6262
+ assert_equal fixture["id"], json[:id]
6263
+ assert_equal fixture["organization_id"], json[:organization_id]
6264
+ assert_equal fixture["slug"], json[:slug]
6265
+ assert_equal fixture["name"], json[:name]
6266
+ assert_equal fixture["enabled"], json[:enabled]
6267
+ assert_equal fixture["created_at"], json[:created_at]
6268
+ assert_equal fixture["updated_at"], json[:updated_at]
6269
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6270
+ end
6271
+
6272
+ def test_data_integration_configuration_list_response_round_trip
6273
+ fixture = {
6274
+ "object" => "list",
6275
+ "data" => []
6276
+ }
6277
+ model = WorkOS::DataIntegrationConfigurationListResponse.new(fixture.to_json)
6278
+ json = model.to_h
6279
+ assert_kind_of Hash, json
6280
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6281
+ end
6282
+
6283
+ def test_configure_data_integration_body_round_trip
6284
+ fixture = {
6285
+ "enabled" => true,
6286
+ "scopes" => nil,
6287
+ "client_id" => "stub",
6288
+ "client_secret" => "stub"
6289
+ }
6290
+ model = WorkOS::ConfigureDataIntegrationBody.new(fixture.to_json)
6291
+ json = model.to_h
6292
+ assert_kind_of Hash, json
6293
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6294
+ end
6295
+
6244
6296
  def test_data_integration_authorize_url_response_round_trip
6245
6297
  fixture = {
6246
6298
  "url" => "stub"
@@ -6271,6 +6323,8 @@ class ModelRoundTripTest < Minitest::Test
6271
6323
  "user_id" => nil,
6272
6324
  "organization_id" => nil,
6273
6325
  "scopes" => [],
6326
+ "auth_method" => "stub",
6327
+ "api_key_last_4" => nil,
6274
6328
  "state" => "stub",
6275
6329
  "created_at" => "stub",
6276
6330
  "updated_at" => "stub"
@@ -6440,6 +6494,7 @@ class ModelRoundTripTest < Minitest::Test
6440
6494
  "created_at" => "stub",
6441
6495
  "updated_at" => "stub",
6442
6496
  "role" => {},
6497
+ "roles" => [],
6443
6498
  "user" => {}
6444
6499
  }
6445
6500
  model = WorkOS::UserOrganizationMembership.new(fixture.to_json)
@@ -6674,6 +6729,17 @@ class ModelRoundTripTest < Minitest::Test
6674
6729
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6675
6730
  end
6676
6731
 
6732
+ def test_client_api_token_response_round_trip
6733
+ fixture = {
6734
+ "token" => "stub"
6735
+ }
6736
+ model = WorkOS::ClientApiTokenResponse.new(fixture.to_json)
6737
+ json = model.to_h
6738
+ assert_kind_of Hash, json
6739
+ assert_equal fixture["token"], json[:token]
6740
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6741
+ end
6742
+
6677
6743
  def test_sso_authorize_url_response_round_trip
6678
6744
  fixture = {
6679
6745
  "url" => "stub"
@@ -6772,6 +6838,30 @@ class ModelRoundTripTest < Minitest::Test
6772
6838
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6773
6839
  end
6774
6840
 
6841
+ def test_organization_domain_round_trip
6842
+ fixture = {
6843
+ "object" => "organization_domain",
6844
+ "id" => "stub",
6845
+ "organization_id" => "stub",
6846
+ "domain" => "stub",
6847
+ "state" => "stub",
6848
+ "verification_prefix" => "stub",
6849
+ "verification_token" => "stub",
6850
+ "verification_strategy" => "stub",
6851
+ "created_at" => "stub",
6852
+ "updated_at" => "stub"
6853
+ }
6854
+ model = WorkOS::OrganizationDomain.new(fixture.to_json)
6855
+ json = model.to_h
6856
+ assert_kind_of Hash, json
6857
+ assert_equal fixture["id"], json[:id]
6858
+ assert_equal fixture["organization_id"], json[:organization_id]
6859
+ assert_equal fixture["domain"], json[:domain]
6860
+ assert_equal fixture["created_at"], json[:created_at]
6861
+ assert_equal fixture["updated_at"], json[:updated_at]
6862
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6863
+ end
6864
+
6775
6865
  def test_jwks_response_keys_round_trip
6776
6866
  fixture = {
6777
6867
  "alg" => "RS256",
@@ -6880,6 +6970,7 @@ class ModelRoundTripTest < Minitest::Test
6880
6970
  "integration_type" => "stub",
6881
6971
  "credentials_type" => "stub",
6882
6972
  "scopes" => nil,
6973
+ "auth_methods" => [],
6883
6974
  "ownership" => "stub",
6884
6975
  "created_at" => "stub",
6885
6976
  "updated_at" => "stub",
@@ -6932,30 +7023,6 @@ class ModelRoundTripTest < Minitest::Test
6932
7023
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6933
7024
  end
6934
7025
 
6935
- def test_organization_domain_round_trip
6936
- fixture = {
6937
- "object" => "organization_domain",
6938
- "id" => "stub",
6939
- "organization_id" => "stub",
6940
- "domain" => "stub",
6941
- "state" => "stub",
6942
- "verification_prefix" => "stub",
6943
- "verification_token" => "stub",
6944
- "verification_strategy" => "stub",
6945
- "created_at" => "stub",
6946
- "updated_at" => "stub"
6947
- }
6948
- model = WorkOS::OrganizationDomain.new(fixture.to_json)
6949
- json = model.to_h
6950
- assert_kind_of Hash, json
6951
- assert_equal fixture["id"], json[:id]
6952
- assert_equal fixture["organization_id"], json[:organization_id]
6953
- assert_equal fixture["domain"], json[:domain]
6954
- assert_equal fixture["created_at"], json[:created_at]
6955
- assert_equal fixture["updated_at"], json[:updated_at]
6956
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6957
- end
6958
-
6959
7026
  def test_organization_api_key_with_value_owner_round_trip
6960
7027
  fixture = {
6961
7028
  "type" => "organization",
@@ -6968,18 +7035,6 @@ class ModelRoundTripTest < Minitest::Test
6968
7035
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6969
7036
  end
6970
7037
 
6971
- def test_organization_api_key_owner_round_trip
6972
- fixture = {
6973
- "type" => "organization",
6974
- "id" => "stub"
6975
- }
6976
- model = WorkOS::OrganizationApiKeyOwner.new(fixture.to_json)
6977
- json = model.to_h
6978
- assert_kind_of Hash, json
6979
- assert_equal fixture["id"], json[:id]
6980
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6981
- end
6982
-
6983
7038
  def test_flag_owner_round_trip
6984
7039
  fixture = {
6985
7040
  "email" => "stub",
@@ -6995,17 +7050,6 @@ class ModelRoundTripTest < Minitest::Test
6995
7050
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
6996
7051
  end
6997
7052
 
6998
- def test_event_list_list_metadata_round_trip
6999
- fixture = {
7000
- "after" => nil
7001
- }
7002
- model = WorkOS::EventListListMetadata.new(fixture.to_json)
7003
- json = model.to_h
7004
- assert_kind_of Hash, json
7005
- assert_nil json[:after]
7006
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7007
- end
7008
-
7009
7053
  def test_directory_user_email_round_trip
7010
7054
  fixture = {
7011
7055
  "primary" => true,
@@ -7121,6 +7165,21 @@ class ModelRoundTripTest < Minitest::Test
7121
7165
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7122
7166
  end
7123
7167
 
7168
+ def test_group_role_assignment_resource_round_trip
7169
+ fixture = {
7170
+ "id" => "stub",
7171
+ "external_id" => "stub",
7172
+ "resource_type_slug" => "stub"
7173
+ }
7174
+ model = WorkOS::GroupRoleAssignmentResource.new(fixture.to_json)
7175
+ json = model.to_h
7176
+ assert_kind_of Hash, json
7177
+ assert_equal fixture["id"], json[:id]
7178
+ assert_equal fixture["external_id"], json[:external_id]
7179
+ assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
7180
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7181
+ end
7182
+
7124
7183
  def test_authentication_factor_sms_round_trip
7125
7184
  fixture = {
7126
7185
  "phone_number" => "stub"
@@ -7197,21 +7256,6 @@ class ModelRoundTripTest < Minitest::Test
7197
7256
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7198
7257
  end
7199
7258
 
7200
- def test_authorized_connect_application_list_data_round_trip
7201
- fixture = {
7202
- "object" => "authorized_connect_application",
7203
- "id" => "stub",
7204
- "granted_scopes" => [],
7205
- "oauth_resource" => "stub",
7206
- "application" => {}
7207
- }
7208
- model = WorkOS::AuthorizedConnectApplicationListData.new(fixture.to_json)
7209
- json = model.to_h
7210
- assert_kind_of Hash, json
7211
- assert_equal fixture["id"], json[:id]
7212
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7213
- end
7214
-
7215
7259
  def test_api_key_owner_round_trip
7216
7260
  fixture = {
7217
7261
  "type" => "organization",
@@ -7319,18 +7363,6 @@ class ModelRoundTripTest < Minitest::Test
7319
7363
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7320
7364
  end
7321
7365
 
7322
- def test_data_integrations_get_user_token_request_round_trip
7323
- fixture = {
7324
- "user_id" => "stub",
7325
- "organization_id" => "stub"
7326
- }
7327
- model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json)
7328
- json = model.to_h
7329
- assert_kind_of Hash, json
7330
- assert_equal fixture["user_id"], json[:user_id]
7331
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7332
- end
7333
-
7334
7366
  def test_feature_flag_round_trip
7335
7367
  fixture = {
7336
7368
  "object" => "feature_flag",
@@ -7451,7 +7483,6 @@ class ModelRoundTripTest < Minitest::Test
7451
7483
  json = model.to_h
7452
7484
  assert_kind_of Hash, json
7453
7485
  assert_equal fixture["client_id"], json[:client_id]
7454
- assert_equal fixture["client_secret"], json[:client_secret]
7455
7486
  assert_equal fixture["code"], json[:code]
7456
7487
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7457
7488
  end
@@ -7493,7 +7524,6 @@ class ModelRoundTripTest < Minitest::Test
7493
7524
  json = model.to_h
7494
7525
  assert_kind_of Hash, json
7495
7526
  assert_equal fixture["client_id"], json[:client_id]
7496
- assert_equal fixture["client_secret"], json[:client_secret]
7497
7527
  assert_equal fixture["refresh_token"], json[:refresh_token]
7498
7528
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7499
7529
  end
@@ -7663,6 +7693,7 @@ class ModelRoundTripTest < Minitest::Test
7663
7693
  "created_at" => "stub",
7664
7694
  "updated_at" => "stub",
7665
7695
  "role" => {},
7696
+ "roles" => [],
7666
7697
  "user" => {}
7667
7698
  }
7668
7699
  model = WorkOS::OrganizationMembership.new(fixture.to_json)
@@ -7777,6 +7808,18 @@ class ModelRoundTripTest < Minitest::Test
7777
7808
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7778
7809
  end
7779
7810
 
7811
+ def test_data_integrations_get_user_token_request_round_trip
7812
+ fixture = {
7813
+ "user_id" => "stub",
7814
+ "organization_id" => nil
7815
+ }
7816
+ model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json)
7817
+ json = model.to_h
7818
+ assert_kind_of Hash, json
7819
+ assert_equal fixture["user_id"], json[:user_id]
7820
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
7821
+ end
7822
+
7780
7823
  def test_directory_metadata_user_round_trip
7781
7824
  fixture = {
7782
7825
  "active" => 1,
@@ -7797,6 +7840,8 @@ class ModelRoundTripTest < Minitest::Test
7797
7840
  "user_id" => nil,
7798
7841
  "organization_id" => nil,
7799
7842
  "scopes" => [],
7843
+ "auth_method" => "stub",
7844
+ "api_key_last_4" => nil,
7800
7845
  "state" => "stub",
7801
7846
  "created_at" => "stub",
7802
7847
  "updated_at" => "stub",
@@ -18,10 +18,10 @@ class PipesTest < Minitest::Test
18
18
  refute_nil result
19
19
  end
20
20
 
21
- def test_create_data_integration_token_returns_expected_result
21
+ def test_get_access_token_returns_expected_result
22
22
  stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)})
23
23
  .to_return(body: "{}", status: 200)
24
- result = @client.pipes.create_data_integration_token(slug: "stub", user_id: "stub")
24
+ result = @client.pipes.get_access_token(provider: "stub", user_id: "stub")
25
25
  refute_nil result
26
26
  end
27
27
 
@@ -49,7 +49,7 @@ class PipesTest < Minitest::Test
49
49
  # Parameterized authentication error tests (one per endpoint).
50
50
  [
51
51
  {name: :authorize_data_integration, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/authorize(\?|\z)}, args: {slug: "stub", user_id: "stub"}},
52
- {name: :create_data_integration_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {slug: "stub", user_id: "stub"}},
52
+ {name: :get_access_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {provider: "stub", user_id: "stub"}},
53
53
  {name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}},
54
54
  {name: :delete_user_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}},
55
55
  {name: :list_user_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/data_providers(\?|\z)}, args: {user_id: "stub"}}
@@ -0,0 +1,41 @@
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 PipesProviderTest < Minitest::Test
8
+ include FixtureHelper
9
+
10
+ def setup
11
+ @client = WorkOS::Client.new(api_key: "sk_test_123")
12
+ end
13
+
14
+ def test_list_organization_data_integration_configurations_returns_expected_result
15
+ stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations(\?|\z)})
16
+ .to_return(body: "{}", status: 200)
17
+ result = @client.pipes_provider.list_organization_data_integration_configurations(organization_id: "stub")
18
+ refute_nil result
19
+ end
20
+
21
+ def test_update_organization_data_integration_configuration_returns_expected_result
22
+ stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations/stub(\?|\z)})
23
+ .to_return(body: "{}", status: 200)
24
+ result = @client.pipes_provider.update_organization_data_integration_configuration(organization_id: "stub", slug: "stub")
25
+ refute_nil result
26
+ end
27
+
28
+ # Parameterized authentication error tests (one per endpoint).
29
+ [
30
+ {name: :list_organization_data_integration_configurations, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations(\?|\z)}, args: {organization_id: "stub"}},
31
+ {name: :update_organization_data_integration_configuration, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}
32
+ ].each do |spec|
33
+ define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
34
+ stub_request(spec[:verb], spec[:url])
35
+ .to_return(body: '{"message": "Unauthorized"}', status: 401)
36
+ assert_raises(WorkOS::AuthenticationError) do
37
+ @client.pipes_provider.send(spec[:name], **(spec[:args] || {}))
38
+ end
39
+ end
40
+ end
41
+ end
@@ -21,7 +21,7 @@ class UserManagementTest < Minitest::Test
21
21
  def test_create_authenticate_returns_expected_result
22
22
  stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)})
23
23
  .to_return(body: "{}", status: 200)
24
- result = @client.user_management.create_authenticate(client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub")
24
+ result = @client.user_management.create_authenticate(client_id: "stub", grant_type: "authorization_code", code: "stub")
25
25
  refute_nil result
26
26
  end
27
27
 
@@ -411,7 +411,7 @@ class UserManagementTest < Minitest::Test
411
411
  # Parameterized authentication error tests (one per endpoint).
412
412
  [
413
413
  {name: :get_jwks, verb: :get, url: %r{\Ahttps://api\.workos\.com/sso/jwks/stub(\?|\z)}, args: {client_id: "stub"}},
414
- {name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub"}},
414
+ {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"}},
415
415
  {name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}},
416
416
  {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
417
417
  {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},