workos 9.5.1 → 10.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.
- checksums.yaml +4 -4
- data/.claude/CLAUDE.md +38 -0
- data/.github/workflows/block-generated-edits.yml +13 -0
- data/.github/workflows/ci.yml +2 -2
- data/.github/workflows/docs.yml +2 -2
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +11 -6
- data/.github/workflows/release.yml +2 -2
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +502 -57
- data/.release-please-manifest.json +1 -1
- data/AGENTS.md +1 -0
- data/CHANGELOG.md +330 -2
- data/Gemfile.lock +2 -2
- data/README.md +15 -14
- data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
- data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
- data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
- data/lib/workos/agents/agent_blueprint.rb +43 -0
- data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
- data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
- data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
- data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
- data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
- data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
- data/lib/workos/agents/agent_credential_validation.rb +25 -0
- data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → agents/agent_instance.rb} +10 -16
- data/lib/workos/agents/agent_instance_session.rb +40 -0
- data/lib/workos/agents/agent_registration.rb +40 -0
- data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
- data/lib/workos/agents/agent_registration_claim.rb +31 -0
- data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
- data/lib/workos/agents/agent_token.rb +40 -0
- data/lib/workos/agents/agent_token_validation.rb +40 -0
- data/lib/workos/agents/claim_view_response.rb +28 -0
- data/lib/workos/agents/claim_view_response_organization.rb +7 -0
- data/lib/workos/agents.rb +488 -0
- data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
- data/lib/workos/api_keys/validate_api_key.rb +1 -12
- data/lib/workos/api_keys.rb +3 -4
- data/lib/workos/audit_logs.rb +23 -5
- data/lib/workos/authorization/permission_created_data.rb +1 -34
- data/lib/workos/authorization/permission_deleted_data.rb +1 -1
- data/lib/workos/authorization/permission_updated_data.rb +1 -1
- data/lib/workos/authorization.rb +27 -27
- data/lib/workos/base_client.rb +4 -4
- data/lib/workos/client.rb +8 -0
- data/lib/workos/connect.rb +25 -21
- data/lib/workos/directory_sync.rb +10 -2
- data/lib/workos/events.rb +2 -2
- data/lib/workos/groups.rb +13 -9
- data/lib/workos/inflections.rb +15 -1
- data/lib/workos/organization_domains.rb +4 -4
- data/lib/workos/{sso/connection_option.rb → organizations/create_it_contact.rb} +4 -4
- data/lib/workos/organizations/invite_it_contact.rb +18 -0
- data/lib/workos/organizations/it_contact.rb +31 -0
- data/lib/workos/organizations/it_contact_list.rb +25 -0
- data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
- data/lib/workos/organizations/organization_input.rb +10 -1
- data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
- data/lib/workos/organizations.rb +167 -11
- data/lib/workos/pipes/api_key_installation.rb +25 -0
- data/lib/workos/pipes/connected_account.rb +9 -0
- data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
- data/lib/workos/pipes/create_data_integration.rb +10 -1
- data/lib/workos/pipes/data_integration.rb +9 -0
- data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
- data/lib/workos/pipes/data_integration_installation.rb +28 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
- data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +31 -0
- data/lib/workos/pipes/update_data_integration.rb +4 -1
- data/lib/workos/pipes.rb +69 -17
- data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
- data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
- data/lib/workos/pipes_provider.rb +6 -3
- data/lib/workos/platform_teams/create_team.rb +22 -0
- data/lib/workos/platform_teams/team.rb +37 -0
- data/lib/workos/platform_teams.rb +58 -0
- data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
- data/lib/workos/shared/agent_blueprint_created.rb +34 -0
- data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
- data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
- data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
- data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
- data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
- data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
- data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
- data/lib/workos/shared/agent_instance_created.rb +34 -0
- data/lib/workos/shared/agent_instance_created_data.rb +40 -0
- data/lib/workos/shared/agent_instance_deleted.rb +34 -0
- data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
- data/lib/workos/shared/agent_instance_session_created.rb +34 -0
- data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
- data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
- data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
- data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
- data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
- data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
- data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
- data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
- data/lib/workos/shared/agent_registration_created.rb +34 -0
- data/lib/workos/shared/agent_registration_created_data.rb +43 -0
- data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
- data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
- data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
- data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
- data/lib/workos/shared/agent_registration_deleted.rb +34 -0
- data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
- data/lib/workos/shared/agent_registration_expired.rb +34 -0
- data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
- data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
- data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
- data/lib/workos/shared/agent_registration_refreshed.rb +34 -0
- data/lib/workos/shared/agent_registration_refreshed_data.rb +7 -0
- data/lib/workos/shared/agent_registration_revoked.rb +34 -0
- data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
- data/lib/workos/shared/radar_challenge_created.rb +34 -0
- data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
- data/lib/workos/shared/resource_export_completed.rb +34 -0
- data/lib/workos/shared/resource_export_completed_data.rb +22 -0
- data/lib/workos/shared/resource_export_created.rb +34 -0
- data/lib/workos/shared/resource_export_created_data.rb +22 -0
- data/lib/workos/shared/resource_export_downloaded.rb +34 -0
- data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
- data/lib/workos/shared/resource_export_failed.rb +34 -0
- data/lib/workos/shared/resource_export_failed_data.rb +22 -0
- data/lib/workos/shared/waitlist_user.rb +11 -5
- data/lib/workos/sso/connection.rb +0 -3
- data/lib/workos/sso/create_connection.rb +37 -0
- data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/create_connection_key_pair.rb +22 -0
- data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
- data/lib/workos/sso/create_connection_saml_options.rb +40 -0
- data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
- data/lib/workos/{admin_portal/domain_verification_intent_options.rb → sso/create_saml_idp_signing_certificate.rb} +4 -4
- data/lib/workos/sso/patch_connection.rb +34 -0
- data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
- data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
- data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
- data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
- data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
- data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
- data/lib/workos/sso/token_query.rb +11 -2
- data/lib/workos/sso.rb +378 -30
- data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
- data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
- data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
- data/lib/workos/types/{data_integration_credentials_type.rb → agent_instance_deleted_data_type.rb} +1 -1
- data/lib/workos/types/agent_instance_session_status.rb +14 -0
- data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_instance_type.rb} +1 -1
- data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
- data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
- data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
- data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → agent_registration_kind.rb} +1 -1
- data/lib/workos/types/agent_registration_status.rb +9 -0
- data/lib/workos/types/applications_registration_types.rb +13 -0
- data/lib/workos/types/authenticate_response_authentication_method.rb +1 -2
- data/lib/workos/types/claim_view_response_status.rb +9 -0
- data/lib/workos/types/connected_account_auth_method.rb +2 -1
- data/lib/workos/types/connected_account_input_state.rb +13 -0
- data/lib/workos/types/connected_account_state.rb +2 -1
- data/lib/workos/types/connection_activated_data_connection_type.rb +1 -2
- data/lib/workos/types/connection_type.rb +1 -2
- data/lib/workos/types/connections_connection_type.rb +1 -2
- data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
- data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
- data/lib/workos/types/create_data_integration_auth_methods.rb +9 -0
- data/lib/workos/types/create_user_password_hash_type.rb +2 -1
- data/lib/workos/types/create_user_password_salt_position.rb +13 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
- data/lib/workos/types/data_integration_auth_methods.rb +9 -0
- data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
- data/lib/workos/types/invite_it_contact_intents.rb +16 -0
- data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
- data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
- data/lib/workos/types/pipe_connected_account_state.rb +1 -5
- data/lib/workos/types/resource_export_completed_data_resource_type.rb +16 -0
- data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
- data/lib/workos/types/session_created_data_status.rb +1 -6
- data/lib/workos/types/session_revoked_data_status.rb +1 -1
- data/lib/workos/types/sso_grant_type.rb +13 -0
- data/lib/workos/types/team_production_state.rb +15 -0
- data/lib/workos/types/token_query_grant_type.rb +9 -0
- data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
- data/lib/workos/types/update_user_password_salt_position.rb +9 -0
- data/lib/workos/types/user_identities_get_item_provider.rb +1 -2
- data/lib/workos/types/user_management_waitlists_state.rb +14 -0
- data/lib/workos/types/user_sessions_status.rb +1 -1
- data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
- data/lib/workos/types/waitlist_entry_state.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +1 -6
- data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
- data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
- data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
- data/lib/workos/user_management/create_password_reset_token.rb +1 -12
- data/lib/workos/user_management/create_user.rb +5 -2
- data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
- data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_challenge.rb +43 -0
- data/lib/workos/user_management/update_user.rb +5 -2
- data/lib/workos/user_management/waitlist.rb +28 -0
- data/lib/workos/user_management/waitlist_entry.rb +43 -0
- data/lib/workos/user_management.rb +340 -74
- data/lib/workos/vault/vault_kek_deleted.rb +34 -0
- data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
- data/lib/workos/vault.rb +4 -4
- data/lib/workos/version.rb +1 -1
- data/lib/workos/widgets.rb +2 -2
- data/lib/workos.rb +12 -0
- data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
- data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
- data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
- data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
- data/rbi/workos/agent_blueprint.rbi +72 -0
- data/rbi/workos/agent_blueprint_created.rbi +54 -0
- data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
- data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
- data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_updated.rbi +54 -0
- data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
- data/rbi/workos/{domain_verification_intent_options.rbi → agent_blueprints_token_validate_token_request.rbi} +5 -5
- data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
- data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
- data/rbi/workos/agent_instance.rbi +66 -0
- data/rbi/workos/agent_instance_created.rbi +54 -0
- data/rbi/workos/agent_instance_created_data.rbi +66 -0
- data/rbi/workos/agent_instance_deleted.rbi +54 -0
- data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
- data/rbi/workos/agent_instance_session.rbi +66 -0
- data/rbi/workos/agent_instance_session_created.rbi +54 -0
- data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
- data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
- data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
- data/rbi/workos/agent_registration.rbi +66 -0
- data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
- data/rbi/workos/agent_registration_claim.rbi +48 -0
- data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
- data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
- data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
- data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
- data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
- data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
- data/rbi/workos/agent_registration_created.rbi +54 -0
- data/rbi/workos/agent_registration_created_data.rbi +72 -0
- data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
- data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
- data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
- data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
- data/rbi/workos/agent_registration_deleted.rbi +54 -0
- data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
- data/rbi/workos/agent_registration_expired.rbi +54 -0
- data/rbi/workos/agent_registration_expired_data.rbi +24 -0
- data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
- data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
- data/rbi/workos/agent_registration_refreshed.rbi +54 -0
- data/rbi/workos/agent_registration_refreshed_data.rbi +24 -0
- data/rbi/workos/agent_registration_revoked.rbi +54 -0
- data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
- data/rbi/workos/agent_token.rbi +66 -0
- data/rbi/workos/agent_token_validation.rbi +66 -0
- data/rbi/workos/agents.rbi +175 -0
- data/rbi/workos/api_key_installation.rbi +36 -0
- data/rbi/workos/api_key_validation_response.rbi +6 -0
- data/rbi/workos/audit_logs.rbi +26 -2
- data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
- data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
- data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
- data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
- data/rbi/workos/claim_view_response.rbi +42 -0
- data/rbi/workos/claim_view_response_organization.rbi +30 -0
- data/rbi/workos/client.rbi +6 -0
- data/rbi/workos/configure_data_integration_body.rbi +6 -0
- data/rbi/workos/connect.rbi +2 -1
- data/rbi/workos/connected_account.rbi +18 -0
- data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
- data/rbi/workos/connection.rbi +0 -6
- data/rbi/workos/create_connection.rbi +60 -0
- data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/create_connection_key_pair.rbi +30 -0
- data/rbi/workos/create_connection_oidc_options.rbi +72 -0
- data/rbi/workos/create_connection_saml_options.rbi +66 -0
- data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/create_data_integration.rbi +20 -2
- data/rbi/workos/create_it_contact.rbi +24 -0
- data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
- data/rbi/workos/create_team.rbi +30 -0
- data/rbi/workos/create_user.rbi +6 -0
- data/rbi/workos/create_waitlist_entry.rbi +36 -0
- data/rbi/workos/custom_provider_definition.rbi +4 -4
- data/rbi/workos/data_integration.rbi +20 -2
- data/rbi/workos/data_integration_configuration_response.rbi +6 -0
- data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
- data/rbi/workos/data_integration_installation.rbi +42 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
- data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +48 -0
- data/rbi/workos/directory_sync.rbi +3 -1
- data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
- data/rbi/workos/events.rbi +2 -2
- data/rbi/workos/groups.rbi +2 -1
- data/rbi/workos/invite_it_contact.rbi +24 -0
- data/rbi/workos/it_contact.rbi +48 -0
- data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
- data/rbi/workos/organization_domains.rbi +2 -2
- data/rbi/workos/organizations.rbi +57 -0
- data/rbi/workos/patch_connection.rbi +54 -0
- data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
- data/rbi/workos/patch_connection_saml_options.rbi +48 -0
- data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/permission_created_data.rbi +6 -0
- data/rbi/workos/permission_deleted_data.rbi +6 -0
- data/rbi/workos/permission_updated_data.rbi +6 -0
- data/rbi/workos/pipes.rbi +23 -5
- data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
- data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
- data/rbi/workos/pipes_provider.rbi +2 -1
- data/rbi/workos/platform_teams.rbi +30 -0
- data/rbi/workos/radar_challenge.rbi +72 -0
- data/rbi/workos/radar_challenge_created.rbi +54 -0
- data/rbi/workos/radar_challenge_created_data.rbi +42 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +4 -4
- data/rbi/workos/resource_export_completed.rbi +54 -0
- data/rbi/workos/resource_export_completed_data.rbi +30 -0
- data/rbi/workos/resource_export_created.rbi +54 -0
- data/rbi/workos/resource_export_created_data.rbi +30 -0
- data/rbi/workos/resource_export_downloaded.rbi +54 -0
- data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
- data/rbi/workos/resource_export_failed.rbi +54 -0
- data/rbi/workos/resource_export_failed_data.rbi +30 -0
- data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
- data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
- data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
- data/rbi/workos/sso.rbi +181 -2
- data/rbi/workos/team.rbi +60 -0
- data/rbi/workos/token_query.rbi +20 -2
- data/rbi/workos/update_audit_logs_retention.rbi +8 -2
- data/rbi/workos/update_data_integration.rbi +8 -2
- data/rbi/workos/update_user.rbi +6 -0
- data/rbi/workos/user_management.rbi +116 -2
- data/rbi/workos/vault_kek_deleted.rbi +54 -0
- data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
- data/rbi/workos/waitlist.rbi +42 -0
- data/rbi/workos/waitlist_entry.rbi +72 -0
- data/rbi/workos/waitlist_user.rbi +18 -6
- data/rbi/workos/widget_session_token.rbi +2 -2
- data/rbi/workos/widgets.rbi +1 -1
- data/test/workos/test_agents.rb +153 -0
- data/test/workos/test_agents_model_round_trip.rb +410 -0
- data/test/workos/test_api_keys_model_round_trip.rb +307 -0
- data/test/workos/test_audit_logs.rb +11 -2
- data/test/workos/test_authkit_helpers.rb +22 -10
- data/test/workos/test_authorization.rb +6 -6
- data/test/workos/test_authorization_model_round_trip.rb +237 -0
- data/test/workos/test_base_client.rb +27 -0
- data/test/workos/test_client_api_model_round_trip.rb +31 -0
- data/test/workos/test_connect_model_round_trip.rb +175 -0
- data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
- data/test/workos/test_events.rb +2 -2
- data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
- data/test/workos/test_groups_model_round_trip.rb +56 -0
- data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
- data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
- data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
- data/test/workos/test_organizations.rb +49 -1
- data/test/workos/test_organizations_model_round_trip.rb +642 -1
- data/test/workos/test_pipes.rb +8 -0
- data/test/workos/test_pipes_model_round_trip.rb +68 -8
- data/test/workos/test_pipes_provider_model_round_trip.rb +77 -0
- data/test/workos/test_platform_teams.rb +41 -0
- data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
- data/test/workos/test_shared_model_round_trip.rb +1263 -0
- data/test/workos/test_sso.rb +108 -2
- data/test/workos/test_sso_model_round_trip.rb +681 -0
- data/test/workos/test_user_management.rb +78 -6
- data/test/workos/test_user_management_model_round_trip.rb +1604 -27
- data/test/workos/test_vault_model_round_trip.rb +571 -0
- data/test/workos/test_widgets.rb +2 -2
- data/test/workos/test_widgets_model_round_trip.rb +30 -0
- metadata +287 -19
- data/lib/workos/admin_portal/intent_options.rb +0 -22
- data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
- data/rbi/workos/intent_options.rbi +0 -30
- data/test/workos/test_model_round_trip.rb +0 -6
|
@@ -0,0 +1,307 @@
|
|
|
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 ApiKeysModelRoundTripTest < Minitest::Test
|
|
8
|
+
def test_validate_api_key_round_trip
|
|
9
|
+
fixture = {
|
|
10
|
+
"value" => "stub"
|
|
11
|
+
}
|
|
12
|
+
model = WorkOS::ValidateApiKey.new(fixture.to_json)
|
|
13
|
+
json = model.to_h
|
|
14
|
+
assert_kind_of Hash, json
|
|
15
|
+
assert_equal fixture["value"], json[:value]
|
|
16
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_expire_api_key_round_trip
|
|
20
|
+
fixture = {
|
|
21
|
+
"expires_at" => nil
|
|
22
|
+
}
|
|
23
|
+
model = WorkOS::ExpireApiKey.new(fixture.to_json)
|
|
24
|
+
json = model.to_h
|
|
25
|
+
assert_kind_of Hash, json
|
|
26
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def test_create_organization_api_key_round_trip
|
|
30
|
+
fixture = {
|
|
31
|
+
"name" => "stub",
|
|
32
|
+
"permissions" => [],
|
|
33
|
+
"expires_at" => "stub"
|
|
34
|
+
}
|
|
35
|
+
model = WorkOS::CreateOrganizationApiKey.new(fixture.to_json)
|
|
36
|
+
json = model.to_h
|
|
37
|
+
assert_kind_of Hash, json
|
|
38
|
+
assert_equal fixture["name"], json[:name]
|
|
39
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def test_api_key_round_trip
|
|
43
|
+
fixture = {
|
|
44
|
+
"object" => "api_key",
|
|
45
|
+
"id" => "stub",
|
|
46
|
+
"owner" => {},
|
|
47
|
+
"name" => "stub",
|
|
48
|
+
"obfuscated_value" => "stub",
|
|
49
|
+
"last_used_at" => nil,
|
|
50
|
+
"expires_at" => nil,
|
|
51
|
+
"permissions" => [],
|
|
52
|
+
"created_at" => "stub",
|
|
53
|
+
"updated_at" => "stub"
|
|
54
|
+
}
|
|
55
|
+
model = WorkOS::ApiKey.new(fixture.to_json)
|
|
56
|
+
json = model.to_h
|
|
57
|
+
assert_kind_of Hash, json
|
|
58
|
+
assert_equal fixture["id"], json[:id]
|
|
59
|
+
assert_equal fixture["name"], json[:name]
|
|
60
|
+
assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
|
|
61
|
+
assert_nil json[:last_used_at]
|
|
62
|
+
assert_nil json[:expires_at]
|
|
63
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
64
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
65
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def test_api_key_validation_response_round_trip
|
|
69
|
+
fixture = {
|
|
70
|
+
"api_key" => nil,
|
|
71
|
+
"agent_registration_id" => "stub"
|
|
72
|
+
}
|
|
73
|
+
model = WorkOS::ApiKeyValidationResponse.new(fixture.to_json)
|
|
74
|
+
json = model.to_h
|
|
75
|
+
assert_kind_of Hash, json
|
|
76
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def test_api_key_created_round_trip
|
|
80
|
+
fixture = {
|
|
81
|
+
"object" => "event",
|
|
82
|
+
"id" => "stub",
|
|
83
|
+
"event" => "api_key.created",
|
|
84
|
+
"data" => {},
|
|
85
|
+
"created_at" => "stub",
|
|
86
|
+
"context" => {}
|
|
87
|
+
}
|
|
88
|
+
model = WorkOS::ApiKeyCreated.new(fixture.to_json)
|
|
89
|
+
json = model.to_h
|
|
90
|
+
assert_kind_of Hash, json
|
|
91
|
+
assert_equal fixture["id"], json[:id]
|
|
92
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
93
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def test_api_key_created_data_round_trip
|
|
97
|
+
fixture = {
|
|
98
|
+
"object" => "api_key",
|
|
99
|
+
"id" => "stub",
|
|
100
|
+
"owner" => {},
|
|
101
|
+
"name" => "stub",
|
|
102
|
+
"obfuscated_value" => "stub",
|
|
103
|
+
"last_used_at" => nil,
|
|
104
|
+
"expires_at" => nil,
|
|
105
|
+
"permissions" => [],
|
|
106
|
+
"created_at" => "stub",
|
|
107
|
+
"updated_at" => "stub"
|
|
108
|
+
}
|
|
109
|
+
model = WorkOS::ApiKeyCreatedData.new(fixture.to_json)
|
|
110
|
+
json = model.to_h
|
|
111
|
+
assert_kind_of Hash, json
|
|
112
|
+
assert_equal fixture["id"], json[:id]
|
|
113
|
+
assert_equal fixture["name"], json[:name]
|
|
114
|
+
assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
|
|
115
|
+
assert_nil json[:last_used_at]
|
|
116
|
+
assert_nil json[:expires_at]
|
|
117
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
118
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
119
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def test_api_key_created_data_owner_round_trip
|
|
123
|
+
fixture = {
|
|
124
|
+
"type" => "organization",
|
|
125
|
+
"id" => "stub"
|
|
126
|
+
}
|
|
127
|
+
model = WorkOS::ApiKeyCreatedDataOwner.new(fixture.to_json)
|
|
128
|
+
json = model.to_h
|
|
129
|
+
assert_kind_of Hash, json
|
|
130
|
+
assert_equal fixture["id"], json[:id]
|
|
131
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def test_api_key_revoked_round_trip
|
|
135
|
+
fixture = {
|
|
136
|
+
"object" => "event",
|
|
137
|
+
"id" => "stub",
|
|
138
|
+
"event" => "api_key.revoked",
|
|
139
|
+
"data" => {},
|
|
140
|
+
"created_at" => "stub",
|
|
141
|
+
"context" => {}
|
|
142
|
+
}
|
|
143
|
+
model = WorkOS::ApiKeyRevoked.new(fixture.to_json)
|
|
144
|
+
json = model.to_h
|
|
145
|
+
assert_kind_of Hash, json
|
|
146
|
+
assert_equal fixture["id"], json[:id]
|
|
147
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
148
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def test_api_key_revoked_data_round_trip
|
|
152
|
+
fixture = {
|
|
153
|
+
"object" => "api_key",
|
|
154
|
+
"id" => "stub",
|
|
155
|
+
"owner" => {},
|
|
156
|
+
"name" => "stub",
|
|
157
|
+
"obfuscated_value" => "stub",
|
|
158
|
+
"last_used_at" => nil,
|
|
159
|
+
"expires_at" => nil,
|
|
160
|
+
"permissions" => [],
|
|
161
|
+
"created_at" => "stub",
|
|
162
|
+
"updated_at" => "stub"
|
|
163
|
+
}
|
|
164
|
+
model = WorkOS::ApiKeyRevokedData.new(fixture.to_json)
|
|
165
|
+
json = model.to_h
|
|
166
|
+
assert_kind_of Hash, json
|
|
167
|
+
assert_equal fixture["id"], json[:id]
|
|
168
|
+
assert_equal fixture["name"], json[:name]
|
|
169
|
+
assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
|
|
170
|
+
assert_nil json[:last_used_at]
|
|
171
|
+
assert_nil json[:expires_at]
|
|
172
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
173
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
174
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def test_api_key_revoked_data_owner_round_trip
|
|
178
|
+
fixture = {
|
|
179
|
+
"type" => "organization",
|
|
180
|
+
"id" => "stub"
|
|
181
|
+
}
|
|
182
|
+
model = WorkOS::ApiKeyRevokedDataOwner.new(fixture.to_json)
|
|
183
|
+
json = model.to_h
|
|
184
|
+
assert_kind_of Hash, json
|
|
185
|
+
assert_equal fixture["id"], json[:id]
|
|
186
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def test_api_key_updated_round_trip
|
|
190
|
+
fixture = {
|
|
191
|
+
"object" => "event",
|
|
192
|
+
"id" => "stub",
|
|
193
|
+
"event" => "api_key.updated",
|
|
194
|
+
"data" => {},
|
|
195
|
+
"created_at" => "stub",
|
|
196
|
+
"context" => {}
|
|
197
|
+
}
|
|
198
|
+
model = WorkOS::ApiKeyUpdated.new(fixture.to_json)
|
|
199
|
+
json = model.to_h
|
|
200
|
+
assert_kind_of Hash, json
|
|
201
|
+
assert_equal fixture["id"], json[:id]
|
|
202
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
203
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def test_api_key_updated_data_round_trip
|
|
207
|
+
fixture = {
|
|
208
|
+
"object" => "api_key",
|
|
209
|
+
"id" => "stub",
|
|
210
|
+
"owner" => {},
|
|
211
|
+
"name" => "stub",
|
|
212
|
+
"obfuscated_value" => "stub",
|
|
213
|
+
"last_used_at" => nil,
|
|
214
|
+
"expires_at" => nil,
|
|
215
|
+
"permissions" => [],
|
|
216
|
+
"created_at" => "stub",
|
|
217
|
+
"updated_at" => "stub",
|
|
218
|
+
"previous_attributes" => {}
|
|
219
|
+
}
|
|
220
|
+
model = WorkOS::ApiKeyUpdatedData.new(fixture.to_json)
|
|
221
|
+
json = model.to_h
|
|
222
|
+
assert_kind_of Hash, json
|
|
223
|
+
assert_equal fixture["id"], json[:id]
|
|
224
|
+
assert_equal fixture["name"], json[:name]
|
|
225
|
+
assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
|
|
226
|
+
assert_nil json[:last_used_at]
|
|
227
|
+
assert_nil json[:expires_at]
|
|
228
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
229
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
230
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def test_api_key_updated_data_owner_round_trip
|
|
234
|
+
fixture = {
|
|
235
|
+
"type" => "organization",
|
|
236
|
+
"id" => "stub"
|
|
237
|
+
}
|
|
238
|
+
model = WorkOS::ApiKeyUpdatedDataOwner.new(fixture.to_json)
|
|
239
|
+
json = model.to_h
|
|
240
|
+
assert_kind_of Hash, json
|
|
241
|
+
assert_equal fixture["id"], json[:id]
|
|
242
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
def test_api_key_updated_data_previous_attribute_round_trip
|
|
246
|
+
fixture = {
|
|
247
|
+
"expires_at" => nil
|
|
248
|
+
}
|
|
249
|
+
model = WorkOS::ApiKeyUpdatedDataPreviousAttribute.new(fixture.to_json)
|
|
250
|
+
json = model.to_h
|
|
251
|
+
assert_kind_of Hash, json
|
|
252
|
+
assert_nil json[:expires_at]
|
|
253
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def test_organization_api_key_with_value_round_trip
|
|
257
|
+
fixture = {
|
|
258
|
+
"object" => "api_key",
|
|
259
|
+
"id" => "stub",
|
|
260
|
+
"owner" => {},
|
|
261
|
+
"name" => "stub",
|
|
262
|
+
"obfuscated_value" => "stub",
|
|
263
|
+
"last_used_at" => nil,
|
|
264
|
+
"expires_at" => nil,
|
|
265
|
+
"permissions" => [],
|
|
266
|
+
"created_at" => "stub",
|
|
267
|
+
"updated_at" => "stub",
|
|
268
|
+
"value" => "stub"
|
|
269
|
+
}
|
|
270
|
+
model = WorkOS::OrganizationApiKeyWithValue.new(fixture.to_json)
|
|
271
|
+
json = model.to_h
|
|
272
|
+
assert_kind_of Hash, json
|
|
273
|
+
assert_equal fixture["id"], json[:id]
|
|
274
|
+
assert_equal fixture["name"], json[:name]
|
|
275
|
+
assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
|
|
276
|
+
assert_nil json[:last_used_at]
|
|
277
|
+
assert_nil json[:expires_at]
|
|
278
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
279
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
280
|
+
assert_equal fixture["value"], json[:value]
|
|
281
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
def test_organization_api_key_with_value_owner_round_trip
|
|
285
|
+
fixture = {
|
|
286
|
+
"type" => "organization",
|
|
287
|
+
"id" => "stub"
|
|
288
|
+
}
|
|
289
|
+
model = WorkOS::OrganizationApiKeyWithValueOwner.new(fixture.to_json)
|
|
290
|
+
json = model.to_h
|
|
291
|
+
assert_kind_of Hash, json
|
|
292
|
+
assert_equal fixture["id"], json[:id]
|
|
293
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def test_api_key_owner_round_trip
|
|
297
|
+
fixture = {
|
|
298
|
+
"type" => "organization",
|
|
299
|
+
"id" => "stub"
|
|
300
|
+
}
|
|
301
|
+
model = WorkOS::ApiKeyOwner.new(fixture.to_json)
|
|
302
|
+
json = model.to_h
|
|
303
|
+
assert_kind_of Hash, json
|
|
304
|
+
assert_equal fixture["id"], json[:id]
|
|
305
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
306
|
+
end
|
|
307
|
+
end
|
|
@@ -20,8 +20,17 @@ class AuditLogsTest < Minitest::Test
|
|
|
20
20
|
|
|
21
21
|
def test_update_organization_audit_logs_retention_returns_expected_result
|
|
22
22
|
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)})
|
|
23
|
+
.with(body: hash_including("retention_period" => "stub"))
|
|
23
24
|
.to_return(body: "{}", status: 200)
|
|
24
|
-
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub",
|
|
25
|
+
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub", retention: WorkOS::AuditLogs::RetentionPeriod.new(retention_period: "stub"))
|
|
26
|
+
refute_nil result
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def test_update_organization_audit_logs_retention_with_retention_period_in_days_returns_expected_result
|
|
30
|
+
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)})
|
|
31
|
+
.with(body: hash_including("retention_period_in_days" => 1))
|
|
32
|
+
.to_return(body: "{}", status: 200)
|
|
33
|
+
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub", retention: WorkOS::AuditLogs::RetentionPeriodInDays.new(retention_period_in_days: 1))
|
|
25
34
|
refute_nil result
|
|
26
35
|
end
|
|
27
36
|
|
|
@@ -70,7 +79,7 @@ class AuditLogsTest < Minitest::Test
|
|
|
70
79
|
# Parameterized authentication error tests (one per endpoint).
|
|
71
80
|
[
|
|
72
81
|
{name: :get_organization_audit_logs_retention, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub"}},
|
|
73
|
-
{name: :update_organization_audit_logs_retention, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub",
|
|
82
|
+
{name: :update_organization_audit_logs_retention, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub", retention: WorkOS::AuditLogs::RetentionPeriod.new(retention_period: "stub")}},
|
|
74
83
|
{name: :list_actions, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions(\?|\z)}},
|
|
75
84
|
{name: :list_action_schemas, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub"}},
|
|
76
85
|
{name: :create_schema, verb: :post, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub", targets: [{}]}},
|
|
@@ -26,19 +26,21 @@ class AuthKitHelpersTest < Minitest::Test
|
|
|
26
26
|
assert_equal "/user_management/authorize", parsed.path
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def
|
|
29
|
+
def test_get_authorization_url_omits_client_id_when_unconfigured
|
|
30
30
|
client = WorkOS::Client.new(api_key: "k", client_id: nil)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
assert_match(/client_id is required/, err.message)
|
|
31
|
+
url = client.user_management.get_authorization_url(redirect_uri: "x", provider: "GoogleOAuth")
|
|
32
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
33
|
+
refute params.key?("client_id")
|
|
35
34
|
end
|
|
36
35
|
|
|
37
|
-
def
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
def test_get_authorization_url_explicit_client_id_overrides_configured
|
|
37
|
+
url = @um.get_authorization_url(
|
|
38
|
+
redirect_uri: "https://app.example.com/cb",
|
|
39
|
+
provider: "GoogleOAuth",
|
|
40
|
+
client_id: "client_override"
|
|
41
|
+
)
|
|
42
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
43
|
+
assert_equal "client_override", params["client_id"]
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
# H10
|
|
@@ -57,6 +59,16 @@ class AuthKitHelpersTest < Minitest::Test
|
|
|
57
59
|
assert_equal expected_challenge, params["code_challenge"]
|
|
58
60
|
end
|
|
59
61
|
|
|
62
|
+
def test_get_authorization_url_with_pkce_forwards_client_id_override
|
|
63
|
+
url, _verifier, _state = @um.get_authorization_url_with_pkce(
|
|
64
|
+
redirect_uri: "https://app.example.com/cb",
|
|
65
|
+
provider: "GoogleOAuth",
|
|
66
|
+
client_id: "client_override"
|
|
67
|
+
)
|
|
68
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
69
|
+
assert_equal "client_override", params["client_id"]
|
|
70
|
+
end
|
|
71
|
+
|
|
60
72
|
# H11
|
|
61
73
|
def test_authenticate_with_code_pkce_posts_correct_body
|
|
62
74
|
stub = stub_request(:post, "https://api.workos.com/user_management/authenticate")
|
|
@@ -214,9 +214,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
214
214
|
|
|
215
215
|
def test_update_resource_by_external_id_with_parent_resource_by_external_id_returns_expected_result
|
|
216
216
|
stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)})
|
|
217
|
-
.with(body: hash_including("
|
|
217
|
+
.with(body: hash_including("parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
218
218
|
.to_return(body: "{}", status: 200)
|
|
219
|
-
result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
219
|
+
result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
220
220
|
refute_nil result
|
|
221
221
|
end
|
|
222
222
|
|
|
@@ -265,9 +265,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
265
265
|
|
|
266
266
|
def test_create_resource_with_parent_resource_by_external_id_returns_expected_result
|
|
267
267
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)})
|
|
268
|
-
.with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "
|
|
268
|
+
.with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
269
269
|
.to_return(body: "{}", status: 200)
|
|
270
|
-
result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
270
|
+
result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
271
271
|
refute_nil result
|
|
272
272
|
end
|
|
273
273
|
|
|
@@ -288,9 +288,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
288
288
|
|
|
289
289
|
def test_update_resource_with_parent_resource_by_external_id_returns_expected_result
|
|
290
290
|
stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)})
|
|
291
|
-
.with(body: hash_including("
|
|
291
|
+
.with(body: hash_including("parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
292
292
|
.to_return(body: "{}", status: 200)
|
|
293
|
-
result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
293
|
+
result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
294
294
|
refute_nil result
|
|
295
295
|
end
|
|
296
296
|
|
|
@@ -386,6 +386,243 @@ class AuthorizationModelRoundTripTest < Minitest::Test
|
|
|
386
386
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
387
387
|
end
|
|
388
388
|
|
|
389
|
+
def test_permission_created_round_trip
|
|
390
|
+
fixture = {
|
|
391
|
+
"object" => "event",
|
|
392
|
+
"id" => "stub",
|
|
393
|
+
"event" => "permission.created",
|
|
394
|
+
"data" => {},
|
|
395
|
+
"created_at" => "stub",
|
|
396
|
+
"context" => {}
|
|
397
|
+
}
|
|
398
|
+
model = WorkOS::PermissionCreated.new(fixture.to_json)
|
|
399
|
+
json = model.to_h
|
|
400
|
+
assert_kind_of Hash, json
|
|
401
|
+
assert_equal fixture["id"], json[:id]
|
|
402
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
403
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def test_permission_created_data_round_trip
|
|
407
|
+
fixture = {
|
|
408
|
+
"object" => "permission",
|
|
409
|
+
"id" => "stub",
|
|
410
|
+
"slug" => "stub",
|
|
411
|
+
"name" => "stub",
|
|
412
|
+
"description" => nil,
|
|
413
|
+
"system" => true,
|
|
414
|
+
"resource_type_slug" => "stub",
|
|
415
|
+
"created_at" => "stub",
|
|
416
|
+
"updated_at" => "stub"
|
|
417
|
+
}
|
|
418
|
+
model = WorkOS::PermissionCreatedData.new(fixture.to_json)
|
|
419
|
+
json = model.to_h
|
|
420
|
+
assert_kind_of Hash, json
|
|
421
|
+
assert_equal fixture["id"], json[:id]
|
|
422
|
+
assert_equal fixture["slug"], json[:slug]
|
|
423
|
+
assert_equal fixture["name"], json[:name]
|
|
424
|
+
assert_nil json[:description]
|
|
425
|
+
assert_equal fixture["system"], json[:system]
|
|
426
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
427
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
428
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
429
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
def test_permission_deleted_round_trip
|
|
433
|
+
fixture = {
|
|
434
|
+
"object" => "event",
|
|
435
|
+
"id" => "stub",
|
|
436
|
+
"event" => "permission.deleted",
|
|
437
|
+
"data" => {},
|
|
438
|
+
"created_at" => "stub",
|
|
439
|
+
"context" => {}
|
|
440
|
+
}
|
|
441
|
+
model = WorkOS::PermissionDeleted.new(fixture.to_json)
|
|
442
|
+
json = model.to_h
|
|
443
|
+
assert_kind_of Hash, json
|
|
444
|
+
assert_equal fixture["id"], json[:id]
|
|
445
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
446
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
def test_permission_deleted_data_round_trip
|
|
450
|
+
fixture = {
|
|
451
|
+
"object" => "permission",
|
|
452
|
+
"id" => "stub",
|
|
453
|
+
"slug" => "stub",
|
|
454
|
+
"name" => "stub",
|
|
455
|
+
"description" => nil,
|
|
456
|
+
"system" => true,
|
|
457
|
+
"resource_type_slug" => "stub",
|
|
458
|
+
"created_at" => "stub",
|
|
459
|
+
"updated_at" => "stub"
|
|
460
|
+
}
|
|
461
|
+
model = WorkOS::PermissionDeletedData.new(fixture.to_json)
|
|
462
|
+
json = model.to_h
|
|
463
|
+
assert_kind_of Hash, json
|
|
464
|
+
assert_equal fixture["id"], json[:id]
|
|
465
|
+
assert_equal fixture["slug"], json[:slug]
|
|
466
|
+
assert_equal fixture["name"], json[:name]
|
|
467
|
+
assert_nil json[:description]
|
|
468
|
+
assert_equal fixture["system"], json[:system]
|
|
469
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
470
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
471
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
472
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
def test_permission_updated_round_trip
|
|
476
|
+
fixture = {
|
|
477
|
+
"object" => "event",
|
|
478
|
+
"id" => "stub",
|
|
479
|
+
"event" => "permission.updated",
|
|
480
|
+
"data" => {},
|
|
481
|
+
"created_at" => "stub",
|
|
482
|
+
"context" => {}
|
|
483
|
+
}
|
|
484
|
+
model = WorkOS::PermissionUpdated.new(fixture.to_json)
|
|
485
|
+
json = model.to_h
|
|
486
|
+
assert_kind_of Hash, json
|
|
487
|
+
assert_equal fixture["id"], json[:id]
|
|
488
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
489
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
def test_permission_updated_data_round_trip
|
|
493
|
+
fixture = {
|
|
494
|
+
"object" => "permission",
|
|
495
|
+
"id" => "stub",
|
|
496
|
+
"slug" => "stub",
|
|
497
|
+
"name" => "stub",
|
|
498
|
+
"description" => nil,
|
|
499
|
+
"system" => true,
|
|
500
|
+
"resource_type_slug" => "stub",
|
|
501
|
+
"created_at" => "stub",
|
|
502
|
+
"updated_at" => "stub"
|
|
503
|
+
}
|
|
504
|
+
model = WorkOS::PermissionUpdatedData.new(fixture.to_json)
|
|
505
|
+
json = model.to_h
|
|
506
|
+
assert_kind_of Hash, json
|
|
507
|
+
assert_equal fixture["id"], json[:id]
|
|
508
|
+
assert_equal fixture["slug"], json[:slug]
|
|
509
|
+
assert_equal fixture["name"], json[:name]
|
|
510
|
+
assert_nil json[:description]
|
|
511
|
+
assert_equal fixture["system"], json[:system]
|
|
512
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
513
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
514
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
515
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
def test_role_created_round_trip
|
|
519
|
+
fixture = {
|
|
520
|
+
"object" => "event",
|
|
521
|
+
"id" => "stub",
|
|
522
|
+
"event" => "role.created",
|
|
523
|
+
"data" => {},
|
|
524
|
+
"created_at" => "stub",
|
|
525
|
+
"context" => {}
|
|
526
|
+
}
|
|
527
|
+
model = WorkOS::RoleCreated.new(fixture.to_json)
|
|
528
|
+
json = model.to_h
|
|
529
|
+
assert_kind_of Hash, json
|
|
530
|
+
assert_equal fixture["id"], json[:id]
|
|
531
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
532
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
def test_role_created_data_round_trip
|
|
536
|
+
fixture = {
|
|
537
|
+
"object" => "role",
|
|
538
|
+
"slug" => "stub",
|
|
539
|
+
"resource_type_slug" => "stub",
|
|
540
|
+
"permissions" => [],
|
|
541
|
+
"created_at" => "stub",
|
|
542
|
+
"updated_at" => "stub"
|
|
543
|
+
}
|
|
544
|
+
model = WorkOS::RoleCreatedData.new(fixture.to_json)
|
|
545
|
+
json = model.to_h
|
|
546
|
+
assert_kind_of Hash, json
|
|
547
|
+
assert_equal fixture["slug"], json[:slug]
|
|
548
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
549
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
550
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
551
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
def test_role_deleted_round_trip
|
|
555
|
+
fixture = {
|
|
556
|
+
"object" => "event",
|
|
557
|
+
"id" => "stub",
|
|
558
|
+
"event" => "role.deleted",
|
|
559
|
+
"data" => {},
|
|
560
|
+
"created_at" => "stub",
|
|
561
|
+
"context" => {}
|
|
562
|
+
}
|
|
563
|
+
model = WorkOS::RoleDeleted.new(fixture.to_json)
|
|
564
|
+
json = model.to_h
|
|
565
|
+
assert_kind_of Hash, json
|
|
566
|
+
assert_equal fixture["id"], json[:id]
|
|
567
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
568
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
def test_role_deleted_data_round_trip
|
|
572
|
+
fixture = {
|
|
573
|
+
"object" => "role",
|
|
574
|
+
"slug" => "stub",
|
|
575
|
+
"resource_type_slug" => "stub",
|
|
576
|
+
"permissions" => [],
|
|
577
|
+
"created_at" => "stub",
|
|
578
|
+
"updated_at" => "stub"
|
|
579
|
+
}
|
|
580
|
+
model = WorkOS::RoleDeletedData.new(fixture.to_json)
|
|
581
|
+
json = model.to_h
|
|
582
|
+
assert_kind_of Hash, json
|
|
583
|
+
assert_equal fixture["slug"], json[:slug]
|
|
584
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
585
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
586
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
587
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
def test_role_updated_round_trip
|
|
591
|
+
fixture = {
|
|
592
|
+
"object" => "event",
|
|
593
|
+
"id" => "stub",
|
|
594
|
+
"event" => "role.updated",
|
|
595
|
+
"data" => {},
|
|
596
|
+
"created_at" => "stub",
|
|
597
|
+
"context" => {}
|
|
598
|
+
}
|
|
599
|
+
model = WorkOS::RoleUpdated.new(fixture.to_json)
|
|
600
|
+
json = model.to_h
|
|
601
|
+
assert_kind_of Hash, json
|
|
602
|
+
assert_equal fixture["id"], json[:id]
|
|
603
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
604
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
def test_role_updated_data_round_trip
|
|
608
|
+
fixture = {
|
|
609
|
+
"object" => "role",
|
|
610
|
+
"slug" => "stub",
|
|
611
|
+
"resource_type_slug" => "stub",
|
|
612
|
+
"permissions" => [],
|
|
613
|
+
"created_at" => "stub",
|
|
614
|
+
"updated_at" => "stub"
|
|
615
|
+
}
|
|
616
|
+
model = WorkOS::RoleUpdatedData.new(fixture.to_json)
|
|
617
|
+
json = model.to_h
|
|
618
|
+
assert_kind_of Hash, json
|
|
619
|
+
assert_equal fixture["slug"], json[:slug]
|
|
620
|
+
assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
|
|
621
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
622
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
623
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
624
|
+
end
|
|
625
|
+
|
|
389
626
|
def test_user_role_assignment_resource_round_trip
|
|
390
627
|
fixture = {
|
|
391
628
|
"id" => "stub",
|