workos 10.3.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.github/workflows/docs.yml +4 -4
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +3 -3
- data/.github/workflows/release.yml +2 -2
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +326 -158
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +388 -0
- data/Gemfile.lock +14 -14
- data/README.md +23 -0
- data/lib/workos/admin_portal/generate_link.rb +3 -0
- data/lib/workos/admin_portal/revoke_link.rb +22 -0
- data/lib/workos/admin_portal.rb +29 -2
- data/lib/workos/agents/agent_blueprint.rb +3 -0
- data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
- data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
- data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
- data/lib/workos/agents/agent_registration.rb +3 -0
- data/lib/workos/agents.rb +30 -1
- data/lib/workos/api_keys/validate_api_key.rb +12 -1
- data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
- data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
- data/lib/workos/base_client.rb +6 -2
- data/lib/workos/configuration.rb +3 -2
- data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
- data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
- data/lib/workos/directory_sync.rb +19 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +3 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
- data/lib/workos/inflections.rb +2 -0
- data/lib/workos/multi_factor_auth.rb +1 -1
- data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +37 -0
- data/lib/workos/pipes/connected_account.rb +15 -0
- data/lib/workos/pipes/connected_account_input.rb +6 -0
- data/lib/workos/pipes/connected_account_write_response.rb +73 -0
- data/lib/workos/pipes/connected_account_write_response_warning.rb +22 -0
- data/lib/workos/pipes/create_connected_account.rb +40 -0
- data/lib/workos/pipes/create_data_integration.rb +3 -0
- data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
- data/lib/workos/pipes/data_integration.rb +3 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
- data/lib/workos/pipes/data_integration_installation.rb +9 -0
- data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
- data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
- data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +6 -0
- data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
- data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +15 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +28 -1
- data/lib/workos/pipes/data_integrations_upsert_api_key_request_2.rb +37 -0
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +9 -0
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +43 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
- data/lib/workos/pipes/organization_connected_account.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_get_data_integration_authorize_url_request.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_upsert_api_key_request.rb +40 -0
- data/lib/workos/pipes/reauthorize_data_integrations_upsert_client_credentials_request.rb +46 -0
- data/lib/workos/pipes.rb +498 -30
- data/lib/workos/session_manager.rb +11 -6
- data/lib/workos/shared/account_selection_required_error.rb +22 -0
- data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
- data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
- data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
- data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
- data/lib/workos/shared/pipe_connected_account.rb +21 -0
- data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
- data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
- data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
- data/lib/workos/sso/token_query.rb +3 -0
- data/lib/workos/sso.rb +3 -0
- data/lib/workos/types/add_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +13 -0
- data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
- data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
- data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
- data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
- data/lib/workos/types/agent_instance_type.rb +1 -1
- data/lib/workos/types/connected_account_connection_role.rb +13 -0
- data/lib/workos/types/connected_account_write_response_auth_method.rb +9 -0
- data/lib/workos/types/connected_account_write_response_connection_role.rb +9 -0
- data/lib/workos/types/connected_account_write_response_state.rb +9 -0
- data/lib/workos/types/create_connected_account_state.rb +9 -0
- data/lib/workos/types/create_data_integration_ownership.rb +9 -0
- data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +6 -1
- data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
- data/lib/workos/types/data_integration_ownership.rb +9 -0
- data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_api_key_request_2_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_client_credentials_request_2_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/organization_connected_account_state.rb +9 -0
- data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
- data/lib/workos/types/pipes_ownership.rb +9 -0
- data/lib/workos/types/reauthorize_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
- data/lib/workos/types/reauthorize_data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
- data/lib/workos/types/reauthorize_data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
- data/lib/workos/types/resource_export_completed_data_resource_type.rb +4 -1
- data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
- data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
- data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
- data/lib/workos/user_management.rb +88 -1
- data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
- data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/account_selection_required_error.rbi +30 -0
- data/rbi/workos/add_data_integrations_get_data_integration_authorize_url_request.rbi +60 -0
- data/rbi/workos/admin_portal.rbi +11 -1
- data/rbi/workos/agent_blueprint.rbi +6 -0
- data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
- data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
- data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
- data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
- data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
- data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
- data/rbi/workos/agent_registration.rbi +6 -0
- data/rbi/workos/agents.rbi +14 -3
- data/rbi/workos/authkit_oauth_resource.rbi +54 -0
- data/rbi/workos/connected_account.rbi +30 -0
- data/rbi/workos/connected_account_input.rbi +12 -0
- data/rbi/workos/connected_account_write_response.rbi +132 -0
- data/rbi/workos/connected_account_write_response_warning.rbi +30 -0
- data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
- data/rbi/workos/create_connected_account.rbi +66 -0
- data/rbi/workos/create_data_integration.rbi +6 -0
- data/rbi/workos/create_organization_connected_account.rbi +72 -0
- data/rbi/workos/data_integration.rbi +6 -0
- data/rbi/workos/data_integration_credentials_response.rbi +2 -2
- data/rbi/workos/data_integration_installation.rbi +19 -1
- data/rbi/workos/data_integration_vended_credential.rbi +66 -0
- data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
- data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +12 -0
- data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +30 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +60 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +72 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
- data/rbi/workos/directory_sync.rbi +8 -0
- data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
- data/rbi/workos/directory_sync_response.rbi +24 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
- data/rbi/workos/generate_link.rbi +6 -0
- data/rbi/workos/organization_connected_account.rbi +66 -0
- data/rbi/workos/pipe_connected_account.rbi +42 -0
- data/rbi/workos/pipes.rbi +176 -16
- data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
- data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
- data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
- data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
- data/rbi/workos/reauthorize_data_integrations_get_data_integration_authorize_url_request.rbi +66 -0
- data/rbi/workos/reauthorize_data_integrations_upsert_api_key_request.rbi +66 -0
- data/rbi/workos/reauthorize_data_integrations_upsert_client_credentials_request.rbi +78 -0
- data/rbi/workos/revoke_link.rbi +30 -0
- data/rbi/workos/sso.rbi +2 -1
- data/rbi/workos/token_query.rbi +6 -0
- data/rbi/workos/user_management.rbi +28 -0
- data/rbi/workos/user_role_assignment_source.rbi +6 -0
- data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
- data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
- data/rbi/workos/{data_integration_credentials_response_credential.rbi → vault_dek_rekeyed_data.rbi} +13 -19
- data/test/workos/test_admin_portal.rb +9 -1
- data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
- data/test/workos/test_agents.rb +8 -0
- data/test/workos/test_agents_model_round_trip.rb +35 -0
- data/test/workos/test_authorization_model_round_trip.rb +15 -1
- data/test/workos/test_directory_sync.rb +8 -0
- data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
- data/test/workos/test_feature_flags_model_round_trip.rb +16 -0
- data/test/workos/test_pipes.rb +80 -0
- data/test/workos/test_pipes_model_round_trip.rb +317 -18
- data/test/workos/test_session.rb +63 -0
- data/test/workos/test_shared_model_round_trip.rb +185 -0
- data/test/workos/test_sso_model_round_trip.rb +1 -0
- data/test/workos/test_user_management.rb +24 -0
- data/test/workos/test_user_management_model_round_trip.rb +32 -0
- data/test/workos/test_vault_model_round_trip.rb +33 -0
- metadata +107 -3
|
@@ -55,6 +55,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
55
55
|
def test_create_data_integration_round_trip
|
|
56
56
|
fixture = {
|
|
57
57
|
"provider" => "stub",
|
|
58
|
+
"ownership" => "stub",
|
|
58
59
|
"description" => nil,
|
|
59
60
|
"enabled" => true,
|
|
60
61
|
"scopes" => nil,
|
|
@@ -106,8 +107,64 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
106
107
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
107
108
|
end
|
|
108
109
|
|
|
110
|
+
def test_create_organization_connected_account_round_trip
|
|
111
|
+
fixture = {
|
|
112
|
+
"account_display_name" => nil,
|
|
113
|
+
"account_identifier" => nil,
|
|
114
|
+
"access_token" => "stub",
|
|
115
|
+
"refresh_token" => "stub",
|
|
116
|
+
"expires_at" => "stub",
|
|
117
|
+
"scopes" => [],
|
|
118
|
+
"state" => "stub",
|
|
119
|
+
"user_id" => "stub",
|
|
120
|
+
"connection_intent" => "add"
|
|
121
|
+
}
|
|
122
|
+
model = WorkOS::CreateOrganizationConnectedAccount.new(fixture.to_json)
|
|
123
|
+
json = model.to_h
|
|
124
|
+
assert_kind_of Hash, json
|
|
125
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
126
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def test_organization_connected_account_round_trip
|
|
130
|
+
fixture = {
|
|
131
|
+
"account_display_name" => nil,
|
|
132
|
+
"account_identifier" => nil,
|
|
133
|
+
"access_token" => "stub",
|
|
134
|
+
"refresh_token" => "stub",
|
|
135
|
+
"expires_at" => "stub",
|
|
136
|
+
"scopes" => [],
|
|
137
|
+
"state" => "stub",
|
|
138
|
+
"user_id" => "stub"
|
|
139
|
+
}
|
|
140
|
+
model = WorkOS::OrganizationConnectedAccount.new(fixture.to_json)
|
|
141
|
+
json = model.to_h
|
|
142
|
+
assert_kind_of Hash, json
|
|
143
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
144
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def test_create_connected_account_round_trip
|
|
148
|
+
fixture = {
|
|
149
|
+
"account_display_name" => nil,
|
|
150
|
+
"account_identifier" => nil,
|
|
151
|
+
"access_token" => "stub",
|
|
152
|
+
"refresh_token" => "stub",
|
|
153
|
+
"expires_at" => "stub",
|
|
154
|
+
"scopes" => [],
|
|
155
|
+
"state" => "stub",
|
|
156
|
+
"connection_intent" => "add"
|
|
157
|
+
}
|
|
158
|
+
model = WorkOS::CreateConnectedAccount.new(fixture.to_json)
|
|
159
|
+
json = model.to_h
|
|
160
|
+
assert_kind_of Hash, json
|
|
161
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
162
|
+
end
|
|
163
|
+
|
|
109
164
|
def test_connected_account_input_round_trip
|
|
110
165
|
fixture = {
|
|
166
|
+
"account_display_name" => nil,
|
|
167
|
+
"account_identifier" => nil,
|
|
111
168
|
"access_token" => "stub",
|
|
112
169
|
"refresh_token" => "stub",
|
|
113
170
|
"expires_at" => "stub",
|
|
@@ -126,6 +183,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
126
183
|
"id" => "stub",
|
|
127
184
|
"slug" => "stub",
|
|
128
185
|
"integration_type" => "stub",
|
|
186
|
+
"ownership" => "stub",
|
|
129
187
|
"description" => nil,
|
|
130
188
|
"enabled" => true,
|
|
131
189
|
"state" => "stub",
|
|
@@ -176,6 +234,23 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
176
234
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
177
235
|
end
|
|
178
236
|
|
|
237
|
+
def test_data_integration_vended_credential_round_trip
|
|
238
|
+
fixture = {
|
|
239
|
+
"object" => "credential",
|
|
240
|
+
"auth_method" => "oauth",
|
|
241
|
+
"value" => "stub",
|
|
242
|
+
"expires_at" => nil,
|
|
243
|
+
"scopes" => [],
|
|
244
|
+
"missing_scopes" => [],
|
|
245
|
+
"config" => {},
|
|
246
|
+
"metadata" => {}
|
|
247
|
+
}
|
|
248
|
+
model = WorkOS::DataIntegrationVendedCredential.new(fixture.to_json)
|
|
249
|
+
json = model.to_h
|
|
250
|
+
assert_kind_of Hash, json
|
|
251
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
252
|
+
end
|
|
253
|
+
|
|
179
254
|
def test_data_integration_credentials_response_round_trip
|
|
180
255
|
fixture = {
|
|
181
256
|
"active" => true,
|
|
@@ -188,10 +263,13 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
188
263
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
189
264
|
end
|
|
190
265
|
|
|
191
|
-
def
|
|
266
|
+
def test_connected_account_write_response_round_trip
|
|
192
267
|
fixture = {
|
|
193
268
|
"object" => "connected_account",
|
|
194
269
|
"id" => "stub",
|
|
270
|
+
"connection_role" => "stub",
|
|
271
|
+
"account_identifier" => nil,
|
|
272
|
+
"account_display_name" => nil,
|
|
195
273
|
"user_id" => nil,
|
|
196
274
|
"organization_id" => nil,
|
|
197
275
|
"scopes" => [],
|
|
@@ -201,13 +279,18 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
201
279
|
"client_secret_last_4" => nil,
|
|
202
280
|
"config" => {},
|
|
203
281
|
"state" => "stub",
|
|
282
|
+
"established_by_user_id" => nil,
|
|
283
|
+
"state_reason" => nil,
|
|
204
284
|
"created_at" => "stub",
|
|
205
|
-
"updated_at" => "stub"
|
|
285
|
+
"updated_at" => "stub",
|
|
286
|
+
"warnings" => []
|
|
206
287
|
}
|
|
207
|
-
model = WorkOS::
|
|
288
|
+
model = WorkOS::ConnectedAccountWriteResponse.new(fixture.to_json)
|
|
208
289
|
json = model.to_h
|
|
209
290
|
assert_kind_of Hash, json
|
|
210
291
|
assert_equal fixture["id"], json[:id]
|
|
292
|
+
assert_nil json[:account_identifier]
|
|
293
|
+
assert_nil json[:account_display_name]
|
|
211
294
|
assert_nil json[:user_id]
|
|
212
295
|
assert_nil json[:organization_id]
|
|
213
296
|
assert_equal fixture["created_at"], json[:created_at]
|
|
@@ -226,6 +309,40 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
226
309
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
227
310
|
end
|
|
228
311
|
|
|
312
|
+
def test_connected_account_round_trip
|
|
313
|
+
fixture = {
|
|
314
|
+
"object" => "connected_account",
|
|
315
|
+
"id" => "stub",
|
|
316
|
+
"connection_role" => "stub",
|
|
317
|
+
"account_identifier" => nil,
|
|
318
|
+
"account_display_name" => nil,
|
|
319
|
+
"user_id" => nil,
|
|
320
|
+
"organization_id" => nil,
|
|
321
|
+
"scopes" => [],
|
|
322
|
+
"auth_method" => "stub",
|
|
323
|
+
"api_key_last_4" => nil,
|
|
324
|
+
"client_id" => nil,
|
|
325
|
+
"client_secret_last_4" => nil,
|
|
326
|
+
"config" => {},
|
|
327
|
+
"state" => "stub",
|
|
328
|
+
"established_by_user_id" => nil,
|
|
329
|
+
"state_reason" => nil,
|
|
330
|
+
"created_at" => "stub",
|
|
331
|
+
"updated_at" => "stub"
|
|
332
|
+
}
|
|
333
|
+
model = WorkOS::ConnectedAccount.new(fixture.to_json)
|
|
334
|
+
json = model.to_h
|
|
335
|
+
assert_kind_of Hash, json
|
|
336
|
+
assert_equal fixture["id"], json[:id]
|
|
337
|
+
assert_nil json[:account_identifier]
|
|
338
|
+
assert_nil json[:account_display_name]
|
|
339
|
+
assert_nil json[:user_id]
|
|
340
|
+
assert_nil json[:organization_id]
|
|
341
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
342
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
343
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
344
|
+
end
|
|
345
|
+
|
|
229
346
|
def test_data_integrations_list_response_data_round_trip
|
|
230
347
|
fixture = {
|
|
231
348
|
"object" => "data_provider",
|
|
@@ -237,10 +354,12 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
237
354
|
"credentials_type" => "stub",
|
|
238
355
|
"scopes" => nil,
|
|
239
356
|
"auth_methods" => [],
|
|
357
|
+
"connection_owner" => "stub",
|
|
240
358
|
"ownership" => "stub",
|
|
241
359
|
"created_at" => "stub",
|
|
242
360
|
"updated_at" => "stub",
|
|
243
|
-
"connected_account" => nil
|
|
361
|
+
"connected_account" => nil,
|
|
362
|
+
"connected_accounts" => []
|
|
244
363
|
}
|
|
245
364
|
model = WorkOS::DataIntegrationsListResponseData.new(fixture.to_json)
|
|
246
365
|
json = model.to_h
|
|
@@ -256,20 +375,15 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
256
375
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
257
376
|
end
|
|
258
377
|
|
|
259
|
-
def
|
|
378
|
+
def test_connected_account_write_response_warning_round_trip
|
|
260
379
|
fixture = {
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"value" => "stub",
|
|
264
|
-
"expires_at" => nil,
|
|
265
|
-
"scopes" => [],
|
|
266
|
-
"missing_scopes" => []
|
|
380
|
+
"code" => "duplicate_account_display_name",
|
|
381
|
+
"message" => "stub"
|
|
267
382
|
}
|
|
268
|
-
model = WorkOS::
|
|
383
|
+
model = WorkOS::ConnectedAccountWriteResponseWarning.new(fixture.to_json)
|
|
269
384
|
json = model.to_h
|
|
270
385
|
assert_kind_of Hash, json
|
|
271
|
-
assert_equal fixture["
|
|
272
|
-
assert_nil json[:expires_at]
|
|
386
|
+
assert_equal fixture["message"], json[:message]
|
|
273
387
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
274
388
|
end
|
|
275
389
|
|
|
@@ -306,7 +420,10 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
306
420
|
def test_data_integration_installation_round_trip
|
|
307
421
|
fixture = {
|
|
308
422
|
"id" => "stub",
|
|
309
|
-
"
|
|
423
|
+
"connection_role" => "stub",
|
|
424
|
+
"account_identifier" => nil,
|
|
425
|
+
"account_display_name" => nil,
|
|
426
|
+
"user_id" => nil,
|
|
310
427
|
"organization_id" => nil,
|
|
311
428
|
"api_key_last_4" => nil
|
|
312
429
|
}
|
|
@@ -314,7 +431,9 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
314
431
|
json = model.to_h
|
|
315
432
|
assert_kind_of Hash, json
|
|
316
433
|
assert_equal fixture["id"], json[:id]
|
|
317
|
-
|
|
434
|
+
assert_nil json[:account_identifier]
|
|
435
|
+
assert_nil json[:account_display_name]
|
|
436
|
+
assert_nil json[:user_id]
|
|
318
437
|
assert_nil json[:organization_id]
|
|
319
438
|
assert_nil json[:api_key_last_4]
|
|
320
439
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
@@ -349,10 +468,31 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
349
468
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
350
469
|
end
|
|
351
470
|
|
|
471
|
+
def test_data_integrations_create_api_key_connection_request_round_trip
|
|
472
|
+
fixture = {
|
|
473
|
+
"account_display_name" => nil,
|
|
474
|
+
"account_identifier" => nil,
|
|
475
|
+
"user_id" => "stub",
|
|
476
|
+
"organization_id" => "stub",
|
|
477
|
+
"connection_owner" => "stub",
|
|
478
|
+
"secret" => "stub",
|
|
479
|
+
"connection_intent" => "add"
|
|
480
|
+
}
|
|
481
|
+
model = WorkOS::DataIntegrationsCreateApiKeyConnectionRequest.new(fixture.to_json)
|
|
482
|
+
json = model.to_h
|
|
483
|
+
assert_kind_of Hash, json
|
|
484
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
485
|
+
assert_equal fixture["secret"], json[:secret]
|
|
486
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
487
|
+
end
|
|
488
|
+
|
|
352
489
|
def test_data_integrations_upsert_api_key_request_round_trip
|
|
353
490
|
fixture = {
|
|
491
|
+
"account_display_name" => nil,
|
|
492
|
+
"account_identifier" => nil,
|
|
354
493
|
"user_id" => "stub",
|
|
355
494
|
"organization_id" => "stub",
|
|
495
|
+
"connection_owner" => "stub",
|
|
356
496
|
"secret" => "stub"
|
|
357
497
|
}
|
|
358
498
|
model = WorkOS::DataIntegrationsUpsertApiKeyRequest.new(fixture.to_json)
|
|
@@ -363,10 +503,51 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
363
503
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
364
504
|
end
|
|
365
505
|
|
|
506
|
+
def test_reauthorize_data_integrations_upsert_api_key_request_round_trip
|
|
507
|
+
fixture = {
|
|
508
|
+
"account_display_name" => nil,
|
|
509
|
+
"account_identifier" => nil,
|
|
510
|
+
"user_id" => "stub",
|
|
511
|
+
"organization_id" => "stub",
|
|
512
|
+
"connection_owner" => "stub",
|
|
513
|
+
"secret" => "stub",
|
|
514
|
+
"connection_intent" => "reauthorize",
|
|
515
|
+
"connected_account_id" => "stub"
|
|
516
|
+
}
|
|
517
|
+
model = WorkOS::ReauthorizeDataIntegrationsUpsertApiKeyRequest.new(fixture.to_json)
|
|
518
|
+
json = model.to_h
|
|
519
|
+
assert_kind_of Hash, json
|
|
520
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
521
|
+
assert_equal fixture["secret"], json[:secret]
|
|
522
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
523
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
524
|
+
end
|
|
525
|
+
|
|
526
|
+
def test_data_integrations_upsert_api_key_request_2_round_trip
|
|
527
|
+
fixture = {
|
|
528
|
+
"account_display_name" => nil,
|
|
529
|
+
"account_identifier" => nil,
|
|
530
|
+
"user_id" => "stub",
|
|
531
|
+
"organization_id" => "stub",
|
|
532
|
+
"connection_owner" => "stub",
|
|
533
|
+
"secret" => "stub",
|
|
534
|
+
"connected_account_id" => "stub"
|
|
535
|
+
}
|
|
536
|
+
model = WorkOS::DataIntegrationsUpsertApiKeyRequest2.new(fixture.to_json)
|
|
537
|
+
json = model.to_h
|
|
538
|
+
assert_kind_of Hash, json
|
|
539
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
540
|
+
assert_equal fixture["secret"], json[:secret]
|
|
541
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
542
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
543
|
+
end
|
|
544
|
+
|
|
366
545
|
def test_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
367
546
|
fixture = {
|
|
547
|
+
"account_display_name" => nil,
|
|
368
548
|
"user_id" => "stub",
|
|
369
549
|
"organization_id" => "stub",
|
|
550
|
+
"connection_owner" => "stub",
|
|
370
551
|
"return_to" => "stub",
|
|
371
552
|
"config" => {}
|
|
372
553
|
}
|
|
@@ -377,10 +558,70 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
377
558
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
378
559
|
end
|
|
379
560
|
|
|
561
|
+
def test_add_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
562
|
+
fixture = {
|
|
563
|
+
"account_display_name" => nil,
|
|
564
|
+
"user_id" => "stub",
|
|
565
|
+
"organization_id" => "stub",
|
|
566
|
+
"connection_owner" => "stub",
|
|
567
|
+
"return_to" => "stub",
|
|
568
|
+
"config" => {},
|
|
569
|
+
"connection_intent" => "add"
|
|
570
|
+
}
|
|
571
|
+
model = WorkOS::AddDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
|
|
572
|
+
json = model.to_h
|
|
573
|
+
assert_kind_of Hash, json
|
|
574
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
575
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
def test_reauthorize_data_integrations_get_data_integration_authorize_url_request_round_trip
|
|
579
|
+
fixture = {
|
|
580
|
+
"account_display_name" => nil,
|
|
581
|
+
"user_id" => "stub",
|
|
582
|
+
"organization_id" => "stub",
|
|
583
|
+
"connection_owner" => "stub",
|
|
584
|
+
"return_to" => "stub",
|
|
585
|
+
"config" => {},
|
|
586
|
+
"connection_intent" => "reauthorize",
|
|
587
|
+
"connected_account_id" => "stub"
|
|
588
|
+
}
|
|
589
|
+
model = WorkOS::ReauthorizeDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
|
|
590
|
+
json = model.to_h
|
|
591
|
+
assert_kind_of Hash, json
|
|
592
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
593
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
594
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
def test_data_integrations_create_client_credentials_connection_request_round_trip
|
|
598
|
+
fixture = {
|
|
599
|
+
"account_display_name" => nil,
|
|
600
|
+
"account_identifier" => nil,
|
|
601
|
+
"user_id" => "stub",
|
|
602
|
+
"organization_id" => "stub",
|
|
603
|
+
"connection_owner" => "stub",
|
|
604
|
+
"client_id" => "stub",
|
|
605
|
+
"client_secret" => "stub",
|
|
606
|
+
"config" => {},
|
|
607
|
+
"connection_intent" => "add"
|
|
608
|
+
}
|
|
609
|
+
model = WorkOS::DataIntegrationsCreateClientCredentialsConnectionRequest.new(fixture.to_json)
|
|
610
|
+
json = model.to_h
|
|
611
|
+
assert_kind_of Hash, json
|
|
612
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
613
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
614
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
615
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
616
|
+
end
|
|
617
|
+
|
|
380
618
|
def test_data_integrations_upsert_client_credentials_request_round_trip
|
|
381
619
|
fixture = {
|
|
620
|
+
"account_display_name" => nil,
|
|
621
|
+
"account_identifier" => nil,
|
|
382
622
|
"user_id" => "stub",
|
|
383
623
|
"organization_id" => "stub",
|
|
624
|
+
"connection_owner" => "stub",
|
|
384
625
|
"client_id" => "stub",
|
|
385
626
|
"client_secret" => "stub",
|
|
386
627
|
"config" => {}
|
|
@@ -394,10 +635,58 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
394
635
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
395
636
|
end
|
|
396
637
|
|
|
638
|
+
def test_reauthorize_data_integrations_upsert_client_credentials_request_round_trip
|
|
639
|
+
fixture = {
|
|
640
|
+
"account_display_name" => nil,
|
|
641
|
+
"account_identifier" => nil,
|
|
642
|
+
"user_id" => "stub",
|
|
643
|
+
"organization_id" => "stub",
|
|
644
|
+
"connection_owner" => "stub",
|
|
645
|
+
"client_id" => "stub",
|
|
646
|
+
"client_secret" => "stub",
|
|
647
|
+
"config" => {},
|
|
648
|
+
"connection_intent" => "reauthorize",
|
|
649
|
+
"connected_account_id" => "stub"
|
|
650
|
+
}
|
|
651
|
+
model = WorkOS::ReauthorizeDataIntegrationsUpsertClientCredentialsRequest.new(fixture.to_json)
|
|
652
|
+
json = model.to_h
|
|
653
|
+
assert_kind_of Hash, json
|
|
654
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
655
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
656
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
657
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
658
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
def test_data_integrations_upsert_client_credentials_request_2_round_trip
|
|
662
|
+
fixture = {
|
|
663
|
+
"account_display_name" => nil,
|
|
664
|
+
"account_identifier" => nil,
|
|
665
|
+
"user_id" => "stub",
|
|
666
|
+
"organization_id" => "stub",
|
|
667
|
+
"connection_owner" => "stub",
|
|
668
|
+
"client_id" => "stub",
|
|
669
|
+
"client_secret" => "stub",
|
|
670
|
+
"config" => {},
|
|
671
|
+
"connected_account_id" => "stub"
|
|
672
|
+
}
|
|
673
|
+
model = WorkOS::DataIntegrationsUpsertClientCredentialsRequest2.new(fixture.to_json)
|
|
674
|
+
json = model.to_h
|
|
675
|
+
assert_kind_of Hash, json
|
|
676
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
677
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
678
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
679
|
+
assert_equal fixture["connected_account_id"], json[:connected_account_id]
|
|
680
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
681
|
+
end
|
|
682
|
+
|
|
397
683
|
def test_data_integrations_vend_credentials_request_round_trip
|
|
398
684
|
fixture = {
|
|
399
685
|
"user_id" => "stub",
|
|
400
|
-
"organization_id" => "stub"
|
|
686
|
+
"organization_id" => "stub",
|
|
687
|
+
"connected_account_id" => "stub",
|
|
688
|
+
"connection_owner" => "stub",
|
|
689
|
+
"supports_multiple_connections" => true
|
|
401
690
|
}
|
|
402
691
|
model = WorkOS::DataIntegrationsVendCredentialsRequest.new(fixture.to_json)
|
|
403
692
|
json = model.to_h
|
|
@@ -409,7 +698,10 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
409
698
|
def test_data_integrations_get_user_token_request_round_trip
|
|
410
699
|
fixture = {
|
|
411
700
|
"user_id" => "stub",
|
|
412
|
-
"organization_id" => nil
|
|
701
|
+
"organization_id" => nil,
|
|
702
|
+
"connected_account_id" => "stub",
|
|
703
|
+
"connection_owner" => "stub",
|
|
704
|
+
"supports_multiple_connections" => true
|
|
413
705
|
}
|
|
414
706
|
model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json)
|
|
415
707
|
json = model.to_h
|
|
@@ -422,6 +714,9 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
422
714
|
fixture = {
|
|
423
715
|
"object" => "connected_account",
|
|
424
716
|
"id" => "stub",
|
|
717
|
+
"connection_role" => "stub",
|
|
718
|
+
"account_identifier" => nil,
|
|
719
|
+
"account_display_name" => nil,
|
|
425
720
|
"user_id" => nil,
|
|
426
721
|
"organization_id" => nil,
|
|
427
722
|
"scopes" => [],
|
|
@@ -431,6 +726,8 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
431
726
|
"client_secret_last_4" => nil,
|
|
432
727
|
"config" => {},
|
|
433
728
|
"state" => "stub",
|
|
729
|
+
"established_by_user_id" => nil,
|
|
730
|
+
"state_reason" => nil,
|
|
434
731
|
"created_at" => "stub",
|
|
435
732
|
"updated_at" => "stub",
|
|
436
733
|
"userlandUserId" => nil
|
|
@@ -439,6 +736,8 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
439
736
|
json = model.to_h
|
|
440
737
|
assert_kind_of Hash, json
|
|
441
738
|
assert_equal fixture["id"], json[:id]
|
|
739
|
+
assert_nil json[:account_identifier]
|
|
740
|
+
assert_nil json[:account_display_name]
|
|
442
741
|
assert_nil json[:user_id]
|
|
443
742
|
assert_nil json[:organization_id]
|
|
444
743
|
assert_equal fixture["created_at"], json[:created_at]
|
data/test/workos/test_session.rb
CHANGED
|
@@ -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
|