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
|
@@ -126,7 +126,8 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
126
126
|
"signals_id" => "stub",
|
|
127
127
|
"password" => nil,
|
|
128
128
|
"password_hash" => "stub",
|
|
129
|
-
"password_hash_type" => "stub"
|
|
129
|
+
"password_hash_type" => "stub",
|
|
130
|
+
"password_salt_position" => "stub"
|
|
130
131
|
}
|
|
131
132
|
model = WorkOS::CreateUser.new(fixture.to_json)
|
|
132
133
|
json = model.to_h
|
|
@@ -147,7 +148,8 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
147
148
|
"locale" => nil,
|
|
148
149
|
"password" => "stub",
|
|
149
150
|
"password_hash" => "stub",
|
|
150
|
-
"password_hash_type" => "stub"
|
|
151
|
+
"password_hash_type" => "stub",
|
|
152
|
+
"password_salt_position" => "stub"
|
|
151
153
|
}
|
|
152
154
|
model = WorkOS::UpdateUser.new(fixture.to_json)
|
|
153
155
|
json = model.to_h
|
|
@@ -223,54 +225,1570 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
223
225
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
224
226
|
end
|
|
225
227
|
|
|
228
|
+
def test_create_waitlist_entry_round_trip
|
|
229
|
+
fixture = {
|
|
230
|
+
"email" => "stub",
|
|
231
|
+
"additional_fields" => {},
|
|
232
|
+
"send_confirmation_email" => true
|
|
233
|
+
}
|
|
234
|
+
model = WorkOS::CreateWaitlistEntry.new(fixture.to_json)
|
|
235
|
+
json = model.to_h
|
|
236
|
+
assert_kind_of Hash, json
|
|
237
|
+
assert_equal fixture["email"], json[:email]
|
|
238
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
239
|
+
end
|
|
240
|
+
|
|
226
241
|
def test_user_round_trip
|
|
227
242
|
fixture = {
|
|
228
|
-
"object" => "user",
|
|
243
|
+
"object" => "user",
|
|
244
|
+
"id" => "stub",
|
|
245
|
+
"first_name" => nil,
|
|
246
|
+
"last_name" => nil,
|
|
247
|
+
"name" => nil,
|
|
248
|
+
"profile_picture_url" => nil,
|
|
249
|
+
"email" => "stub",
|
|
250
|
+
"email_verified" => true,
|
|
251
|
+
"external_id" => nil,
|
|
252
|
+
"metadata" => {},
|
|
253
|
+
"last_sign_in_at" => nil,
|
|
254
|
+
"locale" => nil,
|
|
255
|
+
"created_at" => "stub",
|
|
256
|
+
"updated_at" => "stub"
|
|
257
|
+
}
|
|
258
|
+
model = WorkOS::User.new(fixture.to_json)
|
|
259
|
+
json = model.to_h
|
|
260
|
+
assert_kind_of Hash, json
|
|
261
|
+
assert_equal fixture["id"], json[:id]
|
|
262
|
+
assert_nil json[:first_name]
|
|
263
|
+
assert_nil json[:last_name]
|
|
264
|
+
assert_nil json[:profile_picture_url]
|
|
265
|
+
assert_equal fixture["email"], json[:email]
|
|
266
|
+
assert_equal fixture["email_verified"], json[:email_verified]
|
|
267
|
+
assert_nil json[:external_id]
|
|
268
|
+
assert_nil json[:last_sign_in_at]
|
|
269
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
270
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
271
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
def test_cors_origin_response_round_trip
|
|
275
|
+
fixture = {
|
|
276
|
+
"object" => "cors_origin",
|
|
277
|
+
"id" => "stub",
|
|
278
|
+
"origin" => "stub",
|
|
279
|
+
"created_at" => "stub",
|
|
280
|
+
"updated_at" => "stub"
|
|
281
|
+
}
|
|
282
|
+
model = WorkOS::CORSOriginResponse.new(fixture.to_json)
|
|
283
|
+
json = model.to_h
|
|
284
|
+
assert_kind_of Hash, json
|
|
285
|
+
assert_equal fixture["id"], json[:id]
|
|
286
|
+
assert_equal fixture["origin"], json[:origin]
|
|
287
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
288
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
289
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
def test_action_authentication_denied_round_trip
|
|
293
|
+
fixture = {
|
|
294
|
+
"object" => "event",
|
|
295
|
+
"id" => "stub",
|
|
296
|
+
"event" => "action.authentication.denied",
|
|
297
|
+
"data" => {},
|
|
298
|
+
"created_at" => "stub",
|
|
299
|
+
"context" => {}
|
|
300
|
+
}
|
|
301
|
+
model = WorkOS::ActionAuthenticationDenied.new(fixture.to_json)
|
|
302
|
+
json = model.to_h
|
|
303
|
+
assert_kind_of Hash, json
|
|
304
|
+
assert_equal fixture["id"], json[:id]
|
|
305
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
306
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
def test_action_authentication_denied_data_round_trip
|
|
310
|
+
fixture = {
|
|
311
|
+
"action_endpoint_id" => "stub",
|
|
312
|
+
"action_execution_id" => "stub",
|
|
313
|
+
"type" => "authentication",
|
|
314
|
+
"verdict" => "Deny",
|
|
315
|
+
"user_id" => "stub",
|
|
316
|
+
"organization_id" => nil,
|
|
317
|
+
"email" => "stub",
|
|
318
|
+
"ip_address" => nil,
|
|
319
|
+
"user_agent" => nil
|
|
320
|
+
}
|
|
321
|
+
model = WorkOS::ActionAuthenticationDeniedData.new(fixture.to_json)
|
|
322
|
+
json = model.to_h
|
|
323
|
+
assert_kind_of Hash, json
|
|
324
|
+
assert_equal fixture["action_endpoint_id"], json[:action_endpoint_id]
|
|
325
|
+
assert_equal fixture["action_execution_id"], json[:action_execution_id]
|
|
326
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
327
|
+
assert_nil json[:organization_id]
|
|
328
|
+
assert_equal fixture["email"], json[:email]
|
|
329
|
+
assert_nil json[:ip_address]
|
|
330
|
+
assert_nil json[:user_agent]
|
|
331
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
def test_action_user_registration_denied_round_trip
|
|
335
|
+
fixture = {
|
|
336
|
+
"object" => "event",
|
|
337
|
+
"id" => "stub",
|
|
338
|
+
"event" => "action.user_registration.denied",
|
|
339
|
+
"data" => {},
|
|
340
|
+
"created_at" => "stub",
|
|
341
|
+
"context" => {}
|
|
342
|
+
}
|
|
343
|
+
model = WorkOS::ActionUserRegistrationDenied.new(fixture.to_json)
|
|
344
|
+
json = model.to_h
|
|
345
|
+
assert_kind_of Hash, json
|
|
346
|
+
assert_equal fixture["id"], json[:id]
|
|
347
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
348
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def test_action_user_registration_denied_data_round_trip
|
|
352
|
+
fixture = {
|
|
353
|
+
"action_endpoint_id" => "stub",
|
|
354
|
+
"action_execution_id" => "stub",
|
|
355
|
+
"type" => "user_registration",
|
|
356
|
+
"verdict" => "Deny",
|
|
357
|
+
"organization_id" => nil,
|
|
358
|
+
"email" => "stub",
|
|
359
|
+
"ip_address" => nil,
|
|
360
|
+
"user_agent" => nil
|
|
361
|
+
}
|
|
362
|
+
model = WorkOS::ActionUserRegistrationDeniedData.new(fixture.to_json)
|
|
363
|
+
json = model.to_h
|
|
364
|
+
assert_kind_of Hash, json
|
|
365
|
+
assert_equal fixture["action_endpoint_id"], json[:action_endpoint_id]
|
|
366
|
+
assert_equal fixture["action_execution_id"], json[:action_execution_id]
|
|
367
|
+
assert_nil json[:organization_id]
|
|
368
|
+
assert_equal fixture["email"], json[:email]
|
|
369
|
+
assert_nil json[:ip_address]
|
|
370
|
+
assert_nil json[:user_agent]
|
|
371
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def test_user_api_key_created_data_owner_round_trip
|
|
375
|
+
fixture = {
|
|
376
|
+
"type" => "user",
|
|
377
|
+
"id" => "stub",
|
|
378
|
+
"organization_id" => "stub"
|
|
379
|
+
}
|
|
380
|
+
model = WorkOS::UserApiKeyCreatedDataOwner.new(fixture.to_json)
|
|
381
|
+
json = model.to_h
|
|
382
|
+
assert_kind_of Hash, json
|
|
383
|
+
assert_equal fixture["id"], json[:id]
|
|
384
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
385
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
def test_user_api_key_revoked_data_owner_round_trip
|
|
389
|
+
fixture = {
|
|
390
|
+
"type" => "user",
|
|
391
|
+
"id" => "stub",
|
|
392
|
+
"organization_id" => "stub"
|
|
393
|
+
}
|
|
394
|
+
model = WorkOS::UserApiKeyRevokedDataOwner.new(fixture.to_json)
|
|
395
|
+
json = model.to_h
|
|
396
|
+
assert_kind_of Hash, json
|
|
397
|
+
assert_equal fixture["id"], json[:id]
|
|
398
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
399
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
def test_user_api_key_updated_data_owner_round_trip
|
|
403
|
+
fixture = {
|
|
404
|
+
"type" => "user",
|
|
405
|
+
"id" => "stub",
|
|
406
|
+
"organization_id" => "stub"
|
|
407
|
+
}
|
|
408
|
+
model = WorkOS::UserApiKeyUpdatedDataOwner.new(fixture.to_json)
|
|
409
|
+
json = model.to_h
|
|
410
|
+
assert_kind_of Hash, json
|
|
411
|
+
assert_equal fixture["id"], json[:id]
|
|
412
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
413
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
def test_authentication_email_verification_failed_round_trip
|
|
417
|
+
fixture = {
|
|
418
|
+
"object" => "event",
|
|
419
|
+
"id" => "stub",
|
|
420
|
+
"event" => "authentication.email_verification_failed",
|
|
421
|
+
"data" => {},
|
|
422
|
+
"created_at" => "stub",
|
|
423
|
+
"context" => {}
|
|
424
|
+
}
|
|
425
|
+
model = WorkOS::AuthenticationEmailVerificationFailed.new(fixture.to_json)
|
|
426
|
+
json = model.to_h
|
|
427
|
+
assert_kind_of Hash, json
|
|
428
|
+
assert_equal fixture["id"], json[:id]
|
|
429
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
430
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
def test_authentication_email_verification_failed_data_round_trip
|
|
434
|
+
fixture = {
|
|
435
|
+
"type" => "email_verification",
|
|
436
|
+
"status" => "failed",
|
|
437
|
+
"ip_address" => nil,
|
|
438
|
+
"user_agent" => nil,
|
|
439
|
+
"user_id" => nil,
|
|
440
|
+
"email" => nil,
|
|
441
|
+
"error" => {}
|
|
442
|
+
}
|
|
443
|
+
model = WorkOS::AuthenticationEmailVerificationFailedData.new(fixture.to_json)
|
|
444
|
+
json = model.to_h
|
|
445
|
+
assert_kind_of Hash, json
|
|
446
|
+
assert_nil json[:ip_address]
|
|
447
|
+
assert_nil json[:user_agent]
|
|
448
|
+
assert_nil json[:user_id]
|
|
449
|
+
assert_nil json[:email]
|
|
450
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
def test_authentication_email_verification_failed_data_error_round_trip
|
|
454
|
+
fixture = {
|
|
455
|
+
"code" => "stub",
|
|
456
|
+
"message" => "stub"
|
|
457
|
+
}
|
|
458
|
+
model = WorkOS::AuthenticationEmailVerificationFailedDataError.new(fixture.to_json)
|
|
459
|
+
json = model.to_h
|
|
460
|
+
assert_kind_of Hash, json
|
|
461
|
+
assert_equal fixture["code"], json[:code]
|
|
462
|
+
assert_equal fixture["message"], json[:message]
|
|
463
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def test_authentication_email_verification_succeeded_round_trip
|
|
467
|
+
fixture = {
|
|
468
|
+
"object" => "event",
|
|
469
|
+
"id" => "stub",
|
|
470
|
+
"event" => "authentication.email_verification_succeeded",
|
|
471
|
+
"data" => {},
|
|
472
|
+
"created_at" => "stub",
|
|
473
|
+
"context" => {}
|
|
474
|
+
}
|
|
475
|
+
model = WorkOS::AuthenticationEmailVerificationSucceeded.new(fixture.to_json)
|
|
476
|
+
json = model.to_h
|
|
477
|
+
assert_kind_of Hash, json
|
|
478
|
+
assert_equal fixture["id"], json[:id]
|
|
479
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
480
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
def test_authentication_email_verification_succeeded_data_round_trip
|
|
484
|
+
fixture = {
|
|
485
|
+
"type" => "email_verification",
|
|
486
|
+
"status" => "succeeded",
|
|
487
|
+
"ip_address" => nil,
|
|
488
|
+
"user_agent" => nil,
|
|
489
|
+
"user_id" => "stub",
|
|
490
|
+
"email" => "stub"
|
|
491
|
+
}
|
|
492
|
+
model = WorkOS::AuthenticationEmailVerificationSucceededData.new(fixture.to_json)
|
|
493
|
+
json = model.to_h
|
|
494
|
+
assert_kind_of Hash, json
|
|
495
|
+
assert_nil json[:ip_address]
|
|
496
|
+
assert_nil json[:user_agent]
|
|
497
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
498
|
+
assert_equal fixture["email"], json[:email]
|
|
499
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
def test_authentication_magic_auth_failed_round_trip
|
|
503
|
+
fixture = {
|
|
504
|
+
"object" => "event",
|
|
505
|
+
"id" => "stub",
|
|
506
|
+
"event" => "authentication.magic_auth_failed",
|
|
507
|
+
"data" => {},
|
|
508
|
+
"created_at" => "stub",
|
|
509
|
+
"context" => {}
|
|
510
|
+
}
|
|
511
|
+
model = WorkOS::AuthenticationMagicAuthFailed.new(fixture.to_json)
|
|
512
|
+
json = model.to_h
|
|
513
|
+
assert_kind_of Hash, json
|
|
514
|
+
assert_equal fixture["id"], json[:id]
|
|
515
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
516
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
def test_authentication_magic_auth_failed_data_round_trip
|
|
520
|
+
fixture = {
|
|
521
|
+
"type" => "magic_auth",
|
|
522
|
+
"status" => "failed",
|
|
523
|
+
"ip_address" => nil,
|
|
524
|
+
"user_agent" => nil,
|
|
525
|
+
"user_id" => nil,
|
|
526
|
+
"email" => nil,
|
|
527
|
+
"error" => {}
|
|
528
|
+
}
|
|
529
|
+
model = WorkOS::AuthenticationMagicAuthFailedData.new(fixture.to_json)
|
|
530
|
+
json = model.to_h
|
|
531
|
+
assert_kind_of Hash, json
|
|
532
|
+
assert_nil json[:ip_address]
|
|
533
|
+
assert_nil json[:user_agent]
|
|
534
|
+
assert_nil json[:user_id]
|
|
535
|
+
assert_nil json[:email]
|
|
536
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
537
|
+
end
|
|
538
|
+
|
|
539
|
+
def test_authentication_magic_auth_failed_data_error_round_trip
|
|
540
|
+
fixture = {
|
|
541
|
+
"code" => "stub",
|
|
542
|
+
"message" => "stub"
|
|
543
|
+
}
|
|
544
|
+
model = WorkOS::AuthenticationMagicAuthFailedDataError.new(fixture.to_json)
|
|
545
|
+
json = model.to_h
|
|
546
|
+
assert_kind_of Hash, json
|
|
547
|
+
assert_equal fixture["code"], json[:code]
|
|
548
|
+
assert_equal fixture["message"], json[:message]
|
|
549
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
def test_authentication_magic_auth_succeeded_round_trip
|
|
553
|
+
fixture = {
|
|
554
|
+
"object" => "event",
|
|
555
|
+
"id" => "stub",
|
|
556
|
+
"event" => "authentication.magic_auth_succeeded",
|
|
557
|
+
"data" => {},
|
|
558
|
+
"created_at" => "stub",
|
|
559
|
+
"context" => {}
|
|
560
|
+
}
|
|
561
|
+
model = WorkOS::AuthenticationMagicAuthSucceeded.new(fixture.to_json)
|
|
562
|
+
json = model.to_h
|
|
563
|
+
assert_kind_of Hash, json
|
|
564
|
+
assert_equal fixture["id"], json[:id]
|
|
565
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
566
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
def test_authentication_magic_auth_succeeded_data_round_trip
|
|
570
|
+
fixture = {
|
|
571
|
+
"type" => "magic_auth",
|
|
572
|
+
"status" => "succeeded",
|
|
573
|
+
"ip_address" => nil,
|
|
574
|
+
"user_agent" => nil,
|
|
575
|
+
"user_id" => "stub",
|
|
576
|
+
"email" => "stub"
|
|
577
|
+
}
|
|
578
|
+
model = WorkOS::AuthenticationMagicAuthSucceededData.new(fixture.to_json)
|
|
579
|
+
json = model.to_h
|
|
580
|
+
assert_kind_of Hash, json
|
|
581
|
+
assert_nil json[:ip_address]
|
|
582
|
+
assert_nil json[:user_agent]
|
|
583
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
584
|
+
assert_equal fixture["email"], json[:email]
|
|
585
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
586
|
+
end
|
|
587
|
+
|
|
588
|
+
def test_authentication_mfa_failed_round_trip
|
|
589
|
+
fixture = {
|
|
590
|
+
"object" => "event",
|
|
591
|
+
"id" => "stub",
|
|
592
|
+
"event" => "authentication.mfa_failed",
|
|
593
|
+
"data" => {},
|
|
594
|
+
"created_at" => "stub",
|
|
595
|
+
"context" => {}
|
|
596
|
+
}
|
|
597
|
+
model = WorkOS::AuthenticationMFAFailed.new(fixture.to_json)
|
|
598
|
+
json = model.to_h
|
|
599
|
+
assert_kind_of Hash, json
|
|
600
|
+
assert_equal fixture["id"], json[:id]
|
|
601
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
602
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
603
|
+
end
|
|
604
|
+
|
|
605
|
+
def test_authentication_mfa_failed_data_round_trip
|
|
606
|
+
fixture = {
|
|
607
|
+
"type" => "mfa",
|
|
608
|
+
"status" => "failed",
|
|
609
|
+
"ip_address" => nil,
|
|
610
|
+
"user_agent" => nil,
|
|
611
|
+
"user_id" => nil,
|
|
612
|
+
"email" => nil,
|
|
613
|
+
"error" => {}
|
|
614
|
+
}
|
|
615
|
+
model = WorkOS::AuthenticationMFAFailedData.new(fixture.to_json)
|
|
616
|
+
json = model.to_h
|
|
617
|
+
assert_kind_of Hash, json
|
|
618
|
+
assert_nil json[:ip_address]
|
|
619
|
+
assert_nil json[:user_agent]
|
|
620
|
+
assert_nil json[:user_id]
|
|
621
|
+
assert_nil json[:email]
|
|
622
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
def test_authentication_mfa_failed_data_error_round_trip
|
|
626
|
+
fixture = {
|
|
627
|
+
"code" => "stub",
|
|
628
|
+
"message" => "stub"
|
|
629
|
+
}
|
|
630
|
+
model = WorkOS::AuthenticationMFAFailedDataError.new(fixture.to_json)
|
|
631
|
+
json = model.to_h
|
|
632
|
+
assert_kind_of Hash, json
|
|
633
|
+
assert_equal fixture["code"], json[:code]
|
|
634
|
+
assert_equal fixture["message"], json[:message]
|
|
635
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
def test_authentication_mfa_succeeded_round_trip
|
|
639
|
+
fixture = {
|
|
640
|
+
"object" => "event",
|
|
641
|
+
"id" => "stub",
|
|
642
|
+
"event" => "authentication.mfa_succeeded",
|
|
643
|
+
"data" => {},
|
|
644
|
+
"created_at" => "stub",
|
|
645
|
+
"context" => {}
|
|
646
|
+
}
|
|
647
|
+
model = WorkOS::AuthenticationMFASucceeded.new(fixture.to_json)
|
|
648
|
+
json = model.to_h
|
|
649
|
+
assert_kind_of Hash, json
|
|
650
|
+
assert_equal fixture["id"], json[:id]
|
|
651
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
652
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
653
|
+
end
|
|
654
|
+
|
|
655
|
+
def test_authentication_mfa_succeeded_data_round_trip
|
|
656
|
+
fixture = {
|
|
657
|
+
"type" => "mfa",
|
|
658
|
+
"status" => "succeeded",
|
|
659
|
+
"ip_address" => nil,
|
|
660
|
+
"user_agent" => nil,
|
|
661
|
+
"user_id" => "stub",
|
|
662
|
+
"email" => "stub"
|
|
663
|
+
}
|
|
664
|
+
model = WorkOS::AuthenticationMFASucceededData.new(fixture.to_json)
|
|
665
|
+
json = model.to_h
|
|
666
|
+
assert_kind_of Hash, json
|
|
667
|
+
assert_nil json[:ip_address]
|
|
668
|
+
assert_nil json[:user_agent]
|
|
669
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
670
|
+
assert_equal fixture["email"], json[:email]
|
|
671
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
def test_authentication_oauth_failed_round_trip
|
|
675
|
+
fixture = {
|
|
676
|
+
"object" => "event",
|
|
677
|
+
"id" => "stub",
|
|
678
|
+
"event" => "authentication.oauth_failed",
|
|
679
|
+
"data" => {},
|
|
680
|
+
"created_at" => "stub",
|
|
681
|
+
"context" => {}
|
|
682
|
+
}
|
|
683
|
+
model = WorkOS::AuthenticationOAuthFailed.new(fixture.to_json)
|
|
684
|
+
json = model.to_h
|
|
685
|
+
assert_kind_of Hash, json
|
|
686
|
+
assert_equal fixture["id"], json[:id]
|
|
687
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
688
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
def test_authentication_oauth_failed_data_round_trip
|
|
692
|
+
fixture = {
|
|
693
|
+
"type" => "oauth",
|
|
694
|
+
"status" => "failed",
|
|
695
|
+
"ip_address" => nil,
|
|
696
|
+
"user_agent" => nil,
|
|
697
|
+
"user_id" => nil,
|
|
698
|
+
"email" => nil,
|
|
699
|
+
"error" => {},
|
|
700
|
+
"provider" => "stub"
|
|
701
|
+
}
|
|
702
|
+
model = WorkOS::AuthenticationOAuthFailedData.new(fixture.to_json)
|
|
703
|
+
json = model.to_h
|
|
704
|
+
assert_kind_of Hash, json
|
|
705
|
+
assert_nil json[:ip_address]
|
|
706
|
+
assert_nil json[:user_agent]
|
|
707
|
+
assert_nil json[:user_id]
|
|
708
|
+
assert_nil json[:email]
|
|
709
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
710
|
+
end
|
|
711
|
+
|
|
712
|
+
def test_authentication_oauth_failed_data_error_round_trip
|
|
713
|
+
fixture = {
|
|
714
|
+
"code" => "stub",
|
|
715
|
+
"message" => "stub"
|
|
716
|
+
}
|
|
717
|
+
model = WorkOS::AuthenticationOAuthFailedDataError.new(fixture.to_json)
|
|
718
|
+
json = model.to_h
|
|
719
|
+
assert_kind_of Hash, json
|
|
720
|
+
assert_equal fixture["code"], json[:code]
|
|
721
|
+
assert_equal fixture["message"], json[:message]
|
|
722
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
def test_authentication_oauth_succeeded_round_trip
|
|
726
|
+
fixture = {
|
|
727
|
+
"object" => "event",
|
|
728
|
+
"id" => "stub",
|
|
729
|
+
"event" => "authentication.oauth_succeeded",
|
|
730
|
+
"data" => {},
|
|
731
|
+
"created_at" => "stub",
|
|
732
|
+
"context" => {}
|
|
733
|
+
}
|
|
734
|
+
model = WorkOS::AuthenticationOAuthSucceeded.new(fixture.to_json)
|
|
735
|
+
json = model.to_h
|
|
736
|
+
assert_kind_of Hash, json
|
|
737
|
+
assert_equal fixture["id"], json[:id]
|
|
738
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
739
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
740
|
+
end
|
|
741
|
+
|
|
742
|
+
def test_authentication_oauth_succeeded_data_round_trip
|
|
743
|
+
fixture = {
|
|
744
|
+
"type" => "oauth",
|
|
745
|
+
"status" => "succeeded",
|
|
746
|
+
"ip_address" => nil,
|
|
747
|
+
"user_agent" => nil,
|
|
748
|
+
"user_id" => nil,
|
|
749
|
+
"email" => "stub",
|
|
750
|
+
"provider" => "stub"
|
|
751
|
+
}
|
|
752
|
+
model = WorkOS::AuthenticationOAuthSucceededData.new(fixture.to_json)
|
|
753
|
+
json = model.to_h
|
|
754
|
+
assert_kind_of Hash, json
|
|
755
|
+
assert_nil json[:ip_address]
|
|
756
|
+
assert_nil json[:user_agent]
|
|
757
|
+
assert_nil json[:user_id]
|
|
758
|
+
assert_equal fixture["email"], json[:email]
|
|
759
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
def test_authentication_passkey_failed_round_trip
|
|
763
|
+
fixture = {
|
|
764
|
+
"object" => "event",
|
|
765
|
+
"id" => "stub",
|
|
766
|
+
"event" => "authentication.passkey_failed",
|
|
767
|
+
"data" => {},
|
|
768
|
+
"created_at" => "stub",
|
|
769
|
+
"context" => {}
|
|
770
|
+
}
|
|
771
|
+
model = WorkOS::AuthenticationPasskeyFailed.new(fixture.to_json)
|
|
772
|
+
json = model.to_h
|
|
773
|
+
assert_kind_of Hash, json
|
|
774
|
+
assert_equal fixture["id"], json[:id]
|
|
775
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
776
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
777
|
+
end
|
|
778
|
+
|
|
779
|
+
def test_authentication_passkey_failed_data_round_trip
|
|
780
|
+
fixture = {
|
|
781
|
+
"type" => "passkey",
|
|
782
|
+
"status" => "failed",
|
|
783
|
+
"ip_address" => nil,
|
|
784
|
+
"user_agent" => nil,
|
|
785
|
+
"user_id" => nil,
|
|
786
|
+
"email" => nil,
|
|
787
|
+
"error" => {}
|
|
788
|
+
}
|
|
789
|
+
model = WorkOS::AuthenticationPasskeyFailedData.new(fixture.to_json)
|
|
790
|
+
json = model.to_h
|
|
791
|
+
assert_kind_of Hash, json
|
|
792
|
+
assert_nil json[:ip_address]
|
|
793
|
+
assert_nil json[:user_agent]
|
|
794
|
+
assert_nil json[:user_id]
|
|
795
|
+
assert_nil json[:email]
|
|
796
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
797
|
+
end
|
|
798
|
+
|
|
799
|
+
def test_authentication_passkey_failed_data_error_round_trip
|
|
800
|
+
fixture = {
|
|
801
|
+
"code" => "stub",
|
|
802
|
+
"message" => "stub"
|
|
803
|
+
}
|
|
804
|
+
model = WorkOS::AuthenticationPasskeyFailedDataError.new(fixture.to_json)
|
|
805
|
+
json = model.to_h
|
|
806
|
+
assert_kind_of Hash, json
|
|
807
|
+
assert_equal fixture["code"], json[:code]
|
|
808
|
+
assert_equal fixture["message"], json[:message]
|
|
809
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
810
|
+
end
|
|
811
|
+
|
|
812
|
+
def test_authentication_passkey_succeeded_round_trip
|
|
813
|
+
fixture = {
|
|
814
|
+
"object" => "event",
|
|
815
|
+
"id" => "stub",
|
|
816
|
+
"event" => "authentication.passkey_succeeded",
|
|
817
|
+
"data" => {},
|
|
818
|
+
"created_at" => "stub",
|
|
819
|
+
"context" => {}
|
|
820
|
+
}
|
|
821
|
+
model = WorkOS::AuthenticationPasskeySucceeded.new(fixture.to_json)
|
|
822
|
+
json = model.to_h
|
|
823
|
+
assert_kind_of Hash, json
|
|
824
|
+
assert_equal fixture["id"], json[:id]
|
|
825
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
826
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
def test_authentication_passkey_succeeded_data_round_trip
|
|
830
|
+
fixture = {
|
|
831
|
+
"type" => "passkey",
|
|
832
|
+
"status" => "succeeded",
|
|
833
|
+
"ip_address" => nil,
|
|
834
|
+
"user_agent" => nil,
|
|
835
|
+
"user_id" => "stub",
|
|
836
|
+
"email" => "stub"
|
|
837
|
+
}
|
|
838
|
+
model = WorkOS::AuthenticationPasskeySucceededData.new(fixture.to_json)
|
|
839
|
+
json = model.to_h
|
|
840
|
+
assert_kind_of Hash, json
|
|
841
|
+
assert_nil json[:ip_address]
|
|
842
|
+
assert_nil json[:user_agent]
|
|
843
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
844
|
+
assert_equal fixture["email"], json[:email]
|
|
845
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
846
|
+
end
|
|
847
|
+
|
|
848
|
+
def test_authentication_password_failed_round_trip
|
|
849
|
+
fixture = {
|
|
850
|
+
"object" => "event",
|
|
851
|
+
"id" => "stub",
|
|
852
|
+
"event" => "authentication.password_failed",
|
|
853
|
+
"data" => {},
|
|
854
|
+
"created_at" => "stub",
|
|
855
|
+
"context" => {}
|
|
856
|
+
}
|
|
857
|
+
model = WorkOS::AuthenticationPasswordFailed.new(fixture.to_json)
|
|
858
|
+
json = model.to_h
|
|
859
|
+
assert_kind_of Hash, json
|
|
860
|
+
assert_equal fixture["id"], json[:id]
|
|
861
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
862
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
def test_authentication_password_failed_data_round_trip
|
|
866
|
+
fixture = {
|
|
867
|
+
"type" => "password",
|
|
868
|
+
"status" => "failed",
|
|
869
|
+
"ip_address" => nil,
|
|
870
|
+
"user_agent" => nil,
|
|
871
|
+
"user_id" => nil,
|
|
872
|
+
"email" => nil,
|
|
873
|
+
"error" => {}
|
|
874
|
+
}
|
|
875
|
+
model = WorkOS::AuthenticationPasswordFailedData.new(fixture.to_json)
|
|
876
|
+
json = model.to_h
|
|
877
|
+
assert_kind_of Hash, json
|
|
878
|
+
assert_nil json[:ip_address]
|
|
879
|
+
assert_nil json[:user_agent]
|
|
880
|
+
assert_nil json[:user_id]
|
|
881
|
+
assert_nil json[:email]
|
|
882
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
883
|
+
end
|
|
884
|
+
|
|
885
|
+
def test_authentication_password_failed_data_error_round_trip
|
|
886
|
+
fixture = {
|
|
887
|
+
"code" => "stub",
|
|
888
|
+
"message" => "stub"
|
|
889
|
+
}
|
|
890
|
+
model = WorkOS::AuthenticationPasswordFailedDataError.new(fixture.to_json)
|
|
891
|
+
json = model.to_h
|
|
892
|
+
assert_kind_of Hash, json
|
|
893
|
+
assert_equal fixture["code"], json[:code]
|
|
894
|
+
assert_equal fixture["message"], json[:message]
|
|
895
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
def test_authentication_password_succeeded_round_trip
|
|
899
|
+
fixture = {
|
|
900
|
+
"object" => "event",
|
|
901
|
+
"id" => "stub",
|
|
902
|
+
"event" => "authentication.password_succeeded",
|
|
903
|
+
"data" => {},
|
|
904
|
+
"created_at" => "stub",
|
|
905
|
+
"context" => {}
|
|
906
|
+
}
|
|
907
|
+
model = WorkOS::AuthenticationPasswordSucceeded.new(fixture.to_json)
|
|
908
|
+
json = model.to_h
|
|
909
|
+
assert_kind_of Hash, json
|
|
910
|
+
assert_equal fixture["id"], json[:id]
|
|
911
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
912
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
913
|
+
end
|
|
914
|
+
|
|
915
|
+
def test_authentication_password_succeeded_data_round_trip
|
|
916
|
+
fixture = {
|
|
917
|
+
"type" => "password",
|
|
918
|
+
"status" => "succeeded",
|
|
919
|
+
"ip_address" => nil,
|
|
920
|
+
"user_agent" => nil,
|
|
921
|
+
"user_id" => "stub",
|
|
922
|
+
"email" => "stub"
|
|
923
|
+
}
|
|
924
|
+
model = WorkOS::AuthenticationPasswordSucceededData.new(fixture.to_json)
|
|
925
|
+
json = model.to_h
|
|
926
|
+
assert_kind_of Hash, json
|
|
927
|
+
assert_nil json[:ip_address]
|
|
928
|
+
assert_nil json[:user_agent]
|
|
929
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
930
|
+
assert_equal fixture["email"], json[:email]
|
|
931
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
932
|
+
end
|
|
933
|
+
|
|
934
|
+
def test_authentication_radar_risk_detected_round_trip
|
|
935
|
+
fixture = {
|
|
936
|
+
"object" => "event",
|
|
937
|
+
"id" => "stub",
|
|
938
|
+
"event" => "authentication.radar_risk_detected",
|
|
939
|
+
"data" => {},
|
|
940
|
+
"created_at" => "stub",
|
|
941
|
+
"context" => {}
|
|
942
|
+
}
|
|
943
|
+
model = WorkOS::AuthenticationRadarRiskDetected.new(fixture.to_json)
|
|
944
|
+
json = model.to_h
|
|
945
|
+
assert_kind_of Hash, json
|
|
946
|
+
assert_equal fixture["id"], json[:id]
|
|
947
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
948
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
949
|
+
end
|
|
950
|
+
|
|
951
|
+
def test_authentication_radar_risk_detected_data_round_trip
|
|
952
|
+
fixture = {
|
|
953
|
+
"auth_method" => "stub",
|
|
954
|
+
"action" => "stub",
|
|
955
|
+
"control" => nil,
|
|
956
|
+
"blocklist_type" => nil,
|
|
957
|
+
"ip_address" => nil,
|
|
958
|
+
"user_agent" => nil,
|
|
959
|
+
"user_id" => "stub",
|
|
960
|
+
"email" => "stub"
|
|
961
|
+
}
|
|
962
|
+
model = WorkOS::AuthenticationRadarRiskDetectedData.new(fixture.to_json)
|
|
963
|
+
json = model.to_h
|
|
964
|
+
assert_kind_of Hash, json
|
|
965
|
+
assert_equal fixture["auth_method"], json[:auth_method]
|
|
966
|
+
assert_nil json[:control]
|
|
967
|
+
assert_nil json[:blocklist_type]
|
|
968
|
+
assert_nil json[:ip_address]
|
|
969
|
+
assert_nil json[:user_agent]
|
|
970
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
971
|
+
assert_equal fixture["email"], json[:email]
|
|
972
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
973
|
+
end
|
|
974
|
+
|
|
975
|
+
def test_authentication_reauthentication_succeeded_round_trip
|
|
976
|
+
fixture = {
|
|
977
|
+
"object" => "event",
|
|
978
|
+
"id" => "stub",
|
|
979
|
+
"event" => "authentication.reauthentication_succeeded",
|
|
980
|
+
"data" => {},
|
|
981
|
+
"created_at" => "stub",
|
|
982
|
+
"context" => {}
|
|
983
|
+
}
|
|
984
|
+
model = WorkOS::AuthenticationReauthenticationSucceeded.new(fixture.to_json)
|
|
985
|
+
json = model.to_h
|
|
986
|
+
assert_kind_of Hash, json
|
|
987
|
+
assert_equal fixture["id"], json[:id]
|
|
988
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
989
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
990
|
+
end
|
|
991
|
+
|
|
992
|
+
def test_authentication_reauthentication_succeeded_data_round_trip
|
|
993
|
+
fixture = {
|
|
994
|
+
"type" => "reauthentication",
|
|
995
|
+
"status" => "succeeded",
|
|
996
|
+
"ip_address" => nil,
|
|
997
|
+
"user_agent" => nil,
|
|
998
|
+
"user_id" => "stub",
|
|
999
|
+
"email" => "stub"
|
|
1000
|
+
}
|
|
1001
|
+
model = WorkOS::AuthenticationReauthenticationSucceededData.new(fixture.to_json)
|
|
1002
|
+
json = model.to_h
|
|
1003
|
+
assert_kind_of Hash, json
|
|
1004
|
+
assert_nil json[:ip_address]
|
|
1005
|
+
assert_nil json[:user_agent]
|
|
1006
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1007
|
+
assert_equal fixture["email"], json[:email]
|
|
1008
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1009
|
+
end
|
|
1010
|
+
|
|
1011
|
+
def test_authentication_sso_failed_round_trip
|
|
1012
|
+
fixture = {
|
|
1013
|
+
"object" => "event",
|
|
1014
|
+
"id" => "stub",
|
|
1015
|
+
"event" => "authentication.sso_failed",
|
|
1016
|
+
"data" => {},
|
|
1017
|
+
"created_at" => "stub",
|
|
1018
|
+
"context" => {}
|
|
1019
|
+
}
|
|
1020
|
+
model = WorkOS::AuthenticationSSOFailed.new(fixture.to_json)
|
|
1021
|
+
json = model.to_h
|
|
1022
|
+
assert_kind_of Hash, json
|
|
1023
|
+
assert_equal fixture["id"], json[:id]
|
|
1024
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1025
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1026
|
+
end
|
|
1027
|
+
|
|
1028
|
+
def test_authentication_sso_failed_data_round_trip
|
|
1029
|
+
fixture = {
|
|
1030
|
+
"type" => "sso",
|
|
1031
|
+
"status" => "failed",
|
|
1032
|
+
"ip_address" => nil,
|
|
1033
|
+
"user_agent" => nil,
|
|
1034
|
+
"user_id" => nil,
|
|
1035
|
+
"email" => nil,
|
|
1036
|
+
"sso" => {},
|
|
1037
|
+
"error" => {}
|
|
1038
|
+
}
|
|
1039
|
+
model = WorkOS::AuthenticationSSOFailedData.new(fixture.to_json)
|
|
1040
|
+
json = model.to_h
|
|
1041
|
+
assert_kind_of Hash, json
|
|
1042
|
+
assert_nil json[:ip_address]
|
|
1043
|
+
assert_nil json[:user_agent]
|
|
1044
|
+
assert_nil json[:user_id]
|
|
1045
|
+
assert_nil json[:email]
|
|
1046
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1047
|
+
end
|
|
1048
|
+
|
|
1049
|
+
def test_authentication_sso_failed_data_sso_round_trip
|
|
1050
|
+
fixture = {
|
|
1051
|
+
"organization_id" => nil,
|
|
1052
|
+
"connection_id" => nil,
|
|
1053
|
+
"session_id" => nil
|
|
1054
|
+
}
|
|
1055
|
+
model = WorkOS::AuthenticationSSOFailedDataSSO.new(fixture.to_json)
|
|
1056
|
+
json = model.to_h
|
|
1057
|
+
assert_kind_of Hash, json
|
|
1058
|
+
assert_nil json[:organization_id]
|
|
1059
|
+
assert_nil json[:connection_id]
|
|
1060
|
+
assert_nil json[:session_id]
|
|
1061
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1062
|
+
end
|
|
1063
|
+
|
|
1064
|
+
def test_authentication_sso_failed_data_error_round_trip
|
|
1065
|
+
fixture = {
|
|
1066
|
+
"code" => "stub",
|
|
1067
|
+
"message" => "stub"
|
|
1068
|
+
}
|
|
1069
|
+
model = WorkOS::AuthenticationSSOFailedDataError.new(fixture.to_json)
|
|
1070
|
+
json = model.to_h
|
|
1071
|
+
assert_kind_of Hash, json
|
|
1072
|
+
assert_equal fixture["code"], json[:code]
|
|
1073
|
+
assert_equal fixture["message"], json[:message]
|
|
1074
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1075
|
+
end
|
|
1076
|
+
|
|
1077
|
+
def test_authentication_sso_started_round_trip
|
|
1078
|
+
fixture = {
|
|
1079
|
+
"object" => "event",
|
|
1080
|
+
"id" => "stub",
|
|
1081
|
+
"event" => "authentication.sso_started",
|
|
1082
|
+
"data" => {},
|
|
1083
|
+
"created_at" => "stub",
|
|
1084
|
+
"context" => {}
|
|
1085
|
+
}
|
|
1086
|
+
model = WorkOS::AuthenticationSSOStarted.new(fixture.to_json)
|
|
1087
|
+
json = model.to_h
|
|
1088
|
+
assert_kind_of Hash, json
|
|
1089
|
+
assert_equal fixture["id"], json[:id]
|
|
1090
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1091
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1092
|
+
end
|
|
1093
|
+
|
|
1094
|
+
def test_authentication_sso_started_data_round_trip
|
|
1095
|
+
fixture = {
|
|
1096
|
+
"type" => "sso",
|
|
1097
|
+
"status" => "started",
|
|
1098
|
+
"ip_address" => nil,
|
|
1099
|
+
"user_agent" => nil,
|
|
1100
|
+
"user_id" => nil,
|
|
1101
|
+
"email" => nil,
|
|
1102
|
+
"sso" => {}
|
|
1103
|
+
}
|
|
1104
|
+
model = WorkOS::AuthenticationSSOStartedData.new(fixture.to_json)
|
|
1105
|
+
json = model.to_h
|
|
1106
|
+
assert_kind_of Hash, json
|
|
1107
|
+
assert_nil json[:ip_address]
|
|
1108
|
+
assert_nil json[:user_agent]
|
|
1109
|
+
assert_nil json[:user_id]
|
|
1110
|
+
assert_nil json[:email]
|
|
1111
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1112
|
+
end
|
|
1113
|
+
|
|
1114
|
+
def test_authentication_sso_started_data_sso_round_trip
|
|
1115
|
+
fixture = {
|
|
1116
|
+
"organization_id" => nil,
|
|
1117
|
+
"connection_id" => nil,
|
|
1118
|
+
"session_id" => nil
|
|
1119
|
+
}
|
|
1120
|
+
model = WorkOS::AuthenticationSSOStartedDataSSO.new(fixture.to_json)
|
|
1121
|
+
json = model.to_h
|
|
1122
|
+
assert_kind_of Hash, json
|
|
1123
|
+
assert_nil json[:organization_id]
|
|
1124
|
+
assert_nil json[:connection_id]
|
|
1125
|
+
assert_nil json[:session_id]
|
|
1126
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1127
|
+
end
|
|
1128
|
+
|
|
1129
|
+
def test_authentication_sso_succeeded_round_trip
|
|
1130
|
+
fixture = {
|
|
1131
|
+
"object" => "event",
|
|
1132
|
+
"id" => "stub",
|
|
1133
|
+
"event" => "authentication.sso_succeeded",
|
|
1134
|
+
"data" => {},
|
|
1135
|
+
"created_at" => "stub",
|
|
1136
|
+
"context" => {}
|
|
1137
|
+
}
|
|
1138
|
+
model = WorkOS::AuthenticationSSOSucceeded.new(fixture.to_json)
|
|
1139
|
+
json = model.to_h
|
|
1140
|
+
assert_kind_of Hash, json
|
|
1141
|
+
assert_equal fixture["id"], json[:id]
|
|
1142
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1143
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1144
|
+
end
|
|
1145
|
+
|
|
1146
|
+
def test_authentication_sso_succeeded_data_round_trip
|
|
1147
|
+
fixture = {
|
|
1148
|
+
"type" => "sso",
|
|
1149
|
+
"status" => "succeeded",
|
|
1150
|
+
"ip_address" => nil,
|
|
1151
|
+
"user_agent" => nil,
|
|
1152
|
+
"user_id" => nil,
|
|
1153
|
+
"email" => "stub",
|
|
1154
|
+
"sso" => {}
|
|
1155
|
+
}
|
|
1156
|
+
model = WorkOS::AuthenticationSSOSucceededData.new(fixture.to_json)
|
|
1157
|
+
json = model.to_h
|
|
1158
|
+
assert_kind_of Hash, json
|
|
1159
|
+
assert_nil json[:ip_address]
|
|
1160
|
+
assert_nil json[:user_agent]
|
|
1161
|
+
assert_nil json[:user_id]
|
|
1162
|
+
assert_equal fixture["email"], json[:email]
|
|
1163
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1164
|
+
end
|
|
1165
|
+
|
|
1166
|
+
def test_authentication_sso_succeeded_data_sso_round_trip
|
|
1167
|
+
fixture = {
|
|
1168
|
+
"organization_id" => nil,
|
|
1169
|
+
"connection_id" => nil,
|
|
1170
|
+
"session_id" => nil
|
|
1171
|
+
}
|
|
1172
|
+
model = WorkOS::AuthenticationSSOSucceededDataSSO.new(fixture.to_json)
|
|
1173
|
+
json = model.to_h
|
|
1174
|
+
assert_kind_of Hash, json
|
|
1175
|
+
assert_nil json[:organization_id]
|
|
1176
|
+
assert_nil json[:connection_id]
|
|
1177
|
+
assert_nil json[:session_id]
|
|
1178
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1181
|
+
def test_authentication_sso_timed_out_round_trip
|
|
1182
|
+
fixture = {
|
|
1183
|
+
"object" => "event",
|
|
1184
|
+
"id" => "stub",
|
|
1185
|
+
"event" => "authentication.sso_timed_out",
|
|
1186
|
+
"data" => {},
|
|
1187
|
+
"created_at" => "stub",
|
|
1188
|
+
"context" => {}
|
|
1189
|
+
}
|
|
1190
|
+
model = WorkOS::AuthenticationSSOTimedOut.new(fixture.to_json)
|
|
1191
|
+
json = model.to_h
|
|
1192
|
+
assert_kind_of Hash, json
|
|
1193
|
+
assert_equal fixture["id"], json[:id]
|
|
1194
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1195
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
def test_authentication_sso_timed_out_data_round_trip
|
|
1199
|
+
fixture = {
|
|
1200
|
+
"type" => "sso",
|
|
1201
|
+
"status" => "timed_out",
|
|
1202
|
+
"ip_address" => nil,
|
|
1203
|
+
"user_agent" => nil,
|
|
1204
|
+
"user_id" => nil,
|
|
1205
|
+
"email" => nil,
|
|
1206
|
+
"sso" => {},
|
|
1207
|
+
"error" => {}
|
|
1208
|
+
}
|
|
1209
|
+
model = WorkOS::AuthenticationSSOTimedOutData.new(fixture.to_json)
|
|
1210
|
+
json = model.to_h
|
|
1211
|
+
assert_kind_of Hash, json
|
|
1212
|
+
assert_nil json[:ip_address]
|
|
1213
|
+
assert_nil json[:user_agent]
|
|
1214
|
+
assert_nil json[:user_id]
|
|
1215
|
+
assert_nil json[:email]
|
|
1216
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1217
|
+
end
|
|
1218
|
+
|
|
1219
|
+
def test_authentication_sso_timed_out_data_sso_round_trip
|
|
1220
|
+
fixture = {
|
|
1221
|
+
"organization_id" => nil,
|
|
1222
|
+
"connection_id" => nil,
|
|
1223
|
+
"session_id" => nil
|
|
1224
|
+
}
|
|
1225
|
+
model = WorkOS::AuthenticationSSOTimedOutDataSSO.new(fixture.to_json)
|
|
1226
|
+
json = model.to_h
|
|
1227
|
+
assert_kind_of Hash, json
|
|
1228
|
+
assert_nil json[:organization_id]
|
|
1229
|
+
assert_nil json[:connection_id]
|
|
1230
|
+
assert_nil json[:session_id]
|
|
1231
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
def test_authentication_sso_timed_out_data_error_round_trip
|
|
1235
|
+
fixture = {
|
|
1236
|
+
"code" => "stub",
|
|
1237
|
+
"message" => "stub"
|
|
1238
|
+
}
|
|
1239
|
+
model = WorkOS::AuthenticationSSOTimedOutDataError.new(fixture.to_json)
|
|
1240
|
+
json = model.to_h
|
|
1241
|
+
assert_kind_of Hash, json
|
|
1242
|
+
assert_equal fixture["code"], json[:code]
|
|
1243
|
+
assert_equal fixture["message"], json[:message]
|
|
1244
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1245
|
+
end
|
|
1246
|
+
|
|
1247
|
+
def test_email_verification_created_round_trip
|
|
1248
|
+
fixture = {
|
|
1249
|
+
"object" => "event",
|
|
1250
|
+
"id" => "stub",
|
|
1251
|
+
"event" => "email_verification.created",
|
|
1252
|
+
"data" => {},
|
|
1253
|
+
"created_at" => "stub",
|
|
1254
|
+
"context" => {}
|
|
1255
|
+
}
|
|
1256
|
+
model = WorkOS::EmailVerificationCreated.new(fixture.to_json)
|
|
1257
|
+
json = model.to_h
|
|
1258
|
+
assert_kind_of Hash, json
|
|
1259
|
+
assert_equal fixture["id"], json[:id]
|
|
1260
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1261
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1262
|
+
end
|
|
1263
|
+
|
|
1264
|
+
def test_email_verification_created_data_round_trip
|
|
1265
|
+
fixture = {
|
|
1266
|
+
"object" => "email_verification",
|
|
1267
|
+
"id" => "stub",
|
|
1268
|
+
"user_id" => "stub",
|
|
1269
|
+
"email" => "stub",
|
|
1270
|
+
"expires_at" => "stub",
|
|
1271
|
+
"created_at" => "stub",
|
|
1272
|
+
"updated_at" => "stub"
|
|
1273
|
+
}
|
|
1274
|
+
model = WorkOS::EmailVerificationCreatedData.new(fixture.to_json)
|
|
1275
|
+
json = model.to_h
|
|
1276
|
+
assert_kind_of Hash, json
|
|
1277
|
+
assert_equal fixture["id"], json[:id]
|
|
1278
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1279
|
+
assert_equal fixture["email"], json[:email]
|
|
1280
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1281
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1282
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1283
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1284
|
+
end
|
|
1285
|
+
|
|
1286
|
+
def test_invitation_accepted_round_trip
|
|
1287
|
+
fixture = {
|
|
1288
|
+
"object" => "event",
|
|
1289
|
+
"id" => "stub",
|
|
1290
|
+
"event" => "invitation.accepted",
|
|
1291
|
+
"data" => {},
|
|
1292
|
+
"created_at" => "stub",
|
|
1293
|
+
"context" => {}
|
|
1294
|
+
}
|
|
1295
|
+
model = WorkOS::InvitationAccepted.new(fixture.to_json)
|
|
1296
|
+
json = model.to_h
|
|
1297
|
+
assert_kind_of Hash, json
|
|
1298
|
+
assert_equal fixture["id"], json[:id]
|
|
1299
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1300
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1301
|
+
end
|
|
1302
|
+
|
|
1303
|
+
def test_invitation_accepted_data_round_trip
|
|
1304
|
+
fixture = {
|
|
1305
|
+
"object" => "invitation",
|
|
1306
|
+
"id" => "stub",
|
|
1307
|
+
"email" => "stub",
|
|
1308
|
+
"state" => "stub",
|
|
1309
|
+
"accepted_at" => nil,
|
|
1310
|
+
"revoked_at" => nil,
|
|
1311
|
+
"expires_at" => "stub",
|
|
1312
|
+
"organization_id" => nil,
|
|
1313
|
+
"inviter_user_id" => nil,
|
|
1314
|
+
"accepted_user_id" => nil,
|
|
1315
|
+
"role_slug" => nil,
|
|
1316
|
+
"created_at" => "stub",
|
|
1317
|
+
"updated_at" => "stub"
|
|
1318
|
+
}
|
|
1319
|
+
model = WorkOS::InvitationAcceptedData.new(fixture.to_json)
|
|
1320
|
+
json = model.to_h
|
|
1321
|
+
assert_kind_of Hash, json
|
|
1322
|
+
assert_equal fixture["id"], json[:id]
|
|
1323
|
+
assert_equal fixture["email"], json[:email]
|
|
1324
|
+
assert_nil json[:accepted_at]
|
|
1325
|
+
assert_nil json[:revoked_at]
|
|
1326
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1327
|
+
assert_nil json[:organization_id]
|
|
1328
|
+
assert_nil json[:inviter_user_id]
|
|
1329
|
+
assert_nil json[:accepted_user_id]
|
|
1330
|
+
assert_nil json[:role_slug]
|
|
1331
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1332
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1333
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1334
|
+
end
|
|
1335
|
+
|
|
1336
|
+
def test_invitation_created_round_trip
|
|
1337
|
+
fixture = {
|
|
1338
|
+
"object" => "event",
|
|
1339
|
+
"id" => "stub",
|
|
1340
|
+
"event" => "invitation.created",
|
|
1341
|
+
"data" => {},
|
|
1342
|
+
"created_at" => "stub",
|
|
1343
|
+
"context" => {}
|
|
1344
|
+
}
|
|
1345
|
+
model = WorkOS::InvitationCreated.new(fixture.to_json)
|
|
1346
|
+
json = model.to_h
|
|
1347
|
+
assert_kind_of Hash, json
|
|
1348
|
+
assert_equal fixture["id"], json[:id]
|
|
1349
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1350
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1351
|
+
end
|
|
1352
|
+
|
|
1353
|
+
def test_invitation_created_data_round_trip
|
|
1354
|
+
fixture = {
|
|
1355
|
+
"object" => "invitation",
|
|
1356
|
+
"id" => "stub",
|
|
1357
|
+
"email" => "stub",
|
|
1358
|
+
"state" => "stub",
|
|
1359
|
+
"accepted_at" => nil,
|
|
1360
|
+
"revoked_at" => nil,
|
|
1361
|
+
"expires_at" => "stub",
|
|
1362
|
+
"organization_id" => nil,
|
|
1363
|
+
"inviter_user_id" => nil,
|
|
1364
|
+
"accepted_user_id" => nil,
|
|
1365
|
+
"role_slug" => nil,
|
|
1366
|
+
"created_at" => "stub",
|
|
1367
|
+
"updated_at" => "stub"
|
|
1368
|
+
}
|
|
1369
|
+
model = WorkOS::InvitationCreatedData.new(fixture.to_json)
|
|
1370
|
+
json = model.to_h
|
|
1371
|
+
assert_kind_of Hash, json
|
|
1372
|
+
assert_equal fixture["id"], json[:id]
|
|
1373
|
+
assert_equal fixture["email"], json[:email]
|
|
1374
|
+
assert_nil json[:accepted_at]
|
|
1375
|
+
assert_nil json[:revoked_at]
|
|
1376
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1377
|
+
assert_nil json[:organization_id]
|
|
1378
|
+
assert_nil json[:inviter_user_id]
|
|
1379
|
+
assert_nil json[:accepted_user_id]
|
|
1380
|
+
assert_nil json[:role_slug]
|
|
1381
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1382
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1383
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1384
|
+
end
|
|
1385
|
+
|
|
1386
|
+
def test_invitation_resent_round_trip
|
|
1387
|
+
fixture = {
|
|
1388
|
+
"object" => "event",
|
|
1389
|
+
"id" => "stub",
|
|
1390
|
+
"event" => "invitation.resent",
|
|
1391
|
+
"data" => {},
|
|
1392
|
+
"created_at" => "stub",
|
|
1393
|
+
"context" => {}
|
|
1394
|
+
}
|
|
1395
|
+
model = WorkOS::InvitationResent.new(fixture.to_json)
|
|
1396
|
+
json = model.to_h
|
|
1397
|
+
assert_kind_of Hash, json
|
|
1398
|
+
assert_equal fixture["id"], json[:id]
|
|
1399
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1400
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1401
|
+
end
|
|
1402
|
+
|
|
1403
|
+
def test_invitation_resent_data_round_trip
|
|
1404
|
+
fixture = {
|
|
1405
|
+
"object" => "invitation",
|
|
1406
|
+
"id" => "stub",
|
|
1407
|
+
"email" => "stub",
|
|
1408
|
+
"state" => "stub",
|
|
1409
|
+
"accepted_at" => nil,
|
|
1410
|
+
"revoked_at" => nil,
|
|
1411
|
+
"expires_at" => "stub",
|
|
1412
|
+
"organization_id" => nil,
|
|
1413
|
+
"inviter_user_id" => nil,
|
|
1414
|
+
"accepted_user_id" => nil,
|
|
1415
|
+
"role_slug" => nil,
|
|
1416
|
+
"created_at" => "stub",
|
|
1417
|
+
"updated_at" => "stub"
|
|
1418
|
+
}
|
|
1419
|
+
model = WorkOS::InvitationResentData.new(fixture.to_json)
|
|
1420
|
+
json = model.to_h
|
|
1421
|
+
assert_kind_of Hash, json
|
|
1422
|
+
assert_equal fixture["id"], json[:id]
|
|
1423
|
+
assert_equal fixture["email"], json[:email]
|
|
1424
|
+
assert_nil json[:accepted_at]
|
|
1425
|
+
assert_nil json[:revoked_at]
|
|
1426
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1427
|
+
assert_nil json[:organization_id]
|
|
1428
|
+
assert_nil json[:inviter_user_id]
|
|
1429
|
+
assert_nil json[:accepted_user_id]
|
|
1430
|
+
assert_nil json[:role_slug]
|
|
1431
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1432
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1433
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1434
|
+
end
|
|
1435
|
+
|
|
1436
|
+
def test_invitation_revoked_round_trip
|
|
1437
|
+
fixture = {
|
|
1438
|
+
"object" => "event",
|
|
1439
|
+
"id" => "stub",
|
|
1440
|
+
"event" => "invitation.revoked",
|
|
1441
|
+
"data" => {},
|
|
1442
|
+
"created_at" => "stub",
|
|
1443
|
+
"context" => {}
|
|
1444
|
+
}
|
|
1445
|
+
model = WorkOS::InvitationRevoked.new(fixture.to_json)
|
|
1446
|
+
json = model.to_h
|
|
1447
|
+
assert_kind_of Hash, json
|
|
1448
|
+
assert_equal fixture["id"], json[:id]
|
|
1449
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1450
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
def test_invitation_revoked_data_round_trip
|
|
1454
|
+
fixture = {
|
|
1455
|
+
"object" => "invitation",
|
|
1456
|
+
"id" => "stub",
|
|
1457
|
+
"email" => "stub",
|
|
1458
|
+
"state" => "stub",
|
|
1459
|
+
"accepted_at" => nil,
|
|
1460
|
+
"revoked_at" => nil,
|
|
1461
|
+
"expires_at" => "stub",
|
|
1462
|
+
"organization_id" => nil,
|
|
1463
|
+
"inviter_user_id" => nil,
|
|
1464
|
+
"accepted_user_id" => nil,
|
|
1465
|
+
"role_slug" => nil,
|
|
1466
|
+
"created_at" => "stub",
|
|
1467
|
+
"updated_at" => "stub"
|
|
1468
|
+
}
|
|
1469
|
+
model = WorkOS::InvitationRevokedData.new(fixture.to_json)
|
|
1470
|
+
json = model.to_h
|
|
1471
|
+
assert_kind_of Hash, json
|
|
1472
|
+
assert_equal fixture["id"], json[:id]
|
|
1473
|
+
assert_equal fixture["email"], json[:email]
|
|
1474
|
+
assert_nil json[:accepted_at]
|
|
1475
|
+
assert_nil json[:revoked_at]
|
|
1476
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1477
|
+
assert_nil json[:organization_id]
|
|
1478
|
+
assert_nil json[:inviter_user_id]
|
|
1479
|
+
assert_nil json[:accepted_user_id]
|
|
1480
|
+
assert_nil json[:role_slug]
|
|
1481
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1482
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1483
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1484
|
+
end
|
|
1485
|
+
|
|
1486
|
+
def test_magic_auth_created_round_trip
|
|
1487
|
+
fixture = {
|
|
1488
|
+
"object" => "event",
|
|
1489
|
+
"id" => "stub",
|
|
1490
|
+
"event" => "magic_auth.created",
|
|
1491
|
+
"data" => {},
|
|
1492
|
+
"created_at" => "stub",
|
|
1493
|
+
"context" => {}
|
|
1494
|
+
}
|
|
1495
|
+
model = WorkOS::MagicAuthCreated.new(fixture.to_json)
|
|
1496
|
+
json = model.to_h
|
|
1497
|
+
assert_kind_of Hash, json
|
|
1498
|
+
assert_equal fixture["id"], json[:id]
|
|
1499
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1500
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1501
|
+
end
|
|
1502
|
+
|
|
1503
|
+
def test_magic_auth_created_data_round_trip
|
|
1504
|
+
fixture = {
|
|
1505
|
+
"object" => "magic_auth",
|
|
1506
|
+
"id" => "stub",
|
|
1507
|
+
"user_id" => "stub",
|
|
1508
|
+
"email" => "stub",
|
|
1509
|
+
"expires_at" => "stub",
|
|
1510
|
+
"created_at" => "stub",
|
|
1511
|
+
"updated_at" => "stub"
|
|
1512
|
+
}
|
|
1513
|
+
model = WorkOS::MagicAuthCreatedData.new(fixture.to_json)
|
|
1514
|
+
json = model.to_h
|
|
1515
|
+
assert_kind_of Hash, json
|
|
1516
|
+
assert_equal fixture["id"], json[:id]
|
|
1517
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1518
|
+
assert_equal fixture["email"], json[:email]
|
|
1519
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1520
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1521
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1522
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1523
|
+
end
|
|
1524
|
+
|
|
1525
|
+
def test_password_reset_created_round_trip
|
|
1526
|
+
fixture = {
|
|
1527
|
+
"object" => "event",
|
|
229
1528
|
"id" => "stub",
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
1529
|
+
"event" => "password_reset.created",
|
|
1530
|
+
"data" => {},
|
|
1531
|
+
"created_at" => "stub",
|
|
1532
|
+
"context" => {}
|
|
1533
|
+
}
|
|
1534
|
+
model = WorkOS::PasswordResetCreated.new(fixture.to_json)
|
|
1535
|
+
json = model.to_h
|
|
1536
|
+
assert_kind_of Hash, json
|
|
1537
|
+
assert_equal fixture["id"], json[:id]
|
|
1538
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1539
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
def test_password_reset_created_data_round_trip
|
|
1543
|
+
fixture = {
|
|
1544
|
+
"object" => "password_reset",
|
|
1545
|
+
"id" => "stub",
|
|
1546
|
+
"user_id" => "stub",
|
|
234
1547
|
"email" => "stub",
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
1548
|
+
"expires_at" => "stub",
|
|
1549
|
+
"created_at" => "stub"
|
|
1550
|
+
}
|
|
1551
|
+
model = WorkOS::PasswordResetCreatedData.new(fixture.to_json)
|
|
1552
|
+
json = model.to_h
|
|
1553
|
+
assert_kind_of Hash, json
|
|
1554
|
+
assert_equal fixture["id"], json[:id]
|
|
1555
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1556
|
+
assert_equal fixture["email"], json[:email]
|
|
1557
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1558
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1559
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1560
|
+
end
|
|
1561
|
+
|
|
1562
|
+
def test_password_reset_succeeded_round_trip
|
|
1563
|
+
fixture = {
|
|
1564
|
+
"object" => "event",
|
|
1565
|
+
"id" => "stub",
|
|
1566
|
+
"event" => "password_reset.succeeded",
|
|
1567
|
+
"data" => {},
|
|
240
1568
|
"created_at" => "stub",
|
|
241
|
-
"
|
|
1569
|
+
"context" => {}
|
|
242
1570
|
}
|
|
243
|
-
model = WorkOS::
|
|
1571
|
+
model = WorkOS::PasswordResetSucceeded.new(fixture.to_json)
|
|
244
1572
|
json = model.to_h
|
|
245
1573
|
assert_kind_of Hash, json
|
|
246
1574
|
assert_equal fixture["id"], json[:id]
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
1575
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1576
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1577
|
+
end
|
|
1578
|
+
|
|
1579
|
+
def test_password_reset_succeeded_data_round_trip
|
|
1580
|
+
fixture = {
|
|
1581
|
+
"object" => "password_reset",
|
|
1582
|
+
"id" => "stub",
|
|
1583
|
+
"user_id" => "stub",
|
|
1584
|
+
"email" => "stub",
|
|
1585
|
+
"expires_at" => "stub",
|
|
1586
|
+
"created_at" => "stub"
|
|
1587
|
+
}
|
|
1588
|
+
model = WorkOS::PasswordResetSucceededData.new(fixture.to_json)
|
|
1589
|
+
json = model.to_h
|
|
1590
|
+
assert_kind_of Hash, json
|
|
1591
|
+
assert_equal fixture["id"], json[:id]
|
|
1592
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
250
1593
|
assert_equal fixture["email"], json[:email]
|
|
251
|
-
assert_equal fixture["
|
|
252
|
-
|
|
253
|
-
|
|
1594
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1595
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1596
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
def test_session_created_round_trip
|
|
1600
|
+
fixture = {
|
|
1601
|
+
"object" => "event",
|
|
1602
|
+
"id" => "stub",
|
|
1603
|
+
"event" => "session.created",
|
|
1604
|
+
"data" => {},
|
|
1605
|
+
"created_at" => "stub",
|
|
1606
|
+
"context" => {}
|
|
1607
|
+
}
|
|
1608
|
+
model = WorkOS::SessionCreated.new(fixture.to_json)
|
|
1609
|
+
json = model.to_h
|
|
1610
|
+
assert_kind_of Hash, json
|
|
1611
|
+
assert_equal fixture["id"], json[:id]
|
|
1612
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1613
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1614
|
+
end
|
|
1615
|
+
|
|
1616
|
+
def test_session_created_data_round_trip
|
|
1617
|
+
fixture = {
|
|
1618
|
+
"object" => "session",
|
|
1619
|
+
"id" => "stub",
|
|
1620
|
+
"impersonator" => {},
|
|
1621
|
+
"ip_address" => nil,
|
|
1622
|
+
"organization_id" => "stub",
|
|
1623
|
+
"user_agent" => nil,
|
|
1624
|
+
"user_id" => "stub",
|
|
1625
|
+
"auth_method" => "stub",
|
|
1626
|
+
"status" => "stub",
|
|
1627
|
+
"expires_at" => "stub",
|
|
1628
|
+
"ended_at" => nil,
|
|
1629
|
+
"created_at" => "stub",
|
|
1630
|
+
"updated_at" => "stub"
|
|
1631
|
+
}
|
|
1632
|
+
model = WorkOS::SessionCreatedData.new(fixture.to_json)
|
|
1633
|
+
json = model.to_h
|
|
1634
|
+
assert_kind_of Hash, json
|
|
1635
|
+
assert_equal fixture["id"], json[:id]
|
|
1636
|
+
assert_nil json[:ip_address]
|
|
1637
|
+
assert_nil json[:user_agent]
|
|
1638
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1639
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1640
|
+
assert_nil json[:ended_at]
|
|
254
1641
|
assert_equal fixture["created_at"], json[:created_at]
|
|
255
1642
|
assert_equal fixture["updated_at"], json[:updated_at]
|
|
256
1643
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
257
1644
|
end
|
|
258
1645
|
|
|
259
|
-
def
|
|
1646
|
+
def test_session_created_data_impersonator_round_trip
|
|
260
1647
|
fixture = {
|
|
261
|
-
"
|
|
1648
|
+
"email" => "stub",
|
|
1649
|
+
"reason" => nil
|
|
1650
|
+
}
|
|
1651
|
+
model = WorkOS::SessionCreatedDataImpersonator.new(fixture.to_json)
|
|
1652
|
+
json = model.to_h
|
|
1653
|
+
assert_kind_of Hash, json
|
|
1654
|
+
assert_equal fixture["email"], json[:email]
|
|
1655
|
+
assert_nil json[:reason]
|
|
1656
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1657
|
+
end
|
|
1658
|
+
|
|
1659
|
+
def test_session_revoked_round_trip
|
|
1660
|
+
fixture = {
|
|
1661
|
+
"object" => "event",
|
|
262
1662
|
"id" => "stub",
|
|
263
|
-
"
|
|
1663
|
+
"event" => "session.revoked",
|
|
1664
|
+
"data" => {},
|
|
1665
|
+
"created_at" => "stub",
|
|
1666
|
+
"context" => {}
|
|
1667
|
+
}
|
|
1668
|
+
model = WorkOS::SessionRevoked.new(fixture.to_json)
|
|
1669
|
+
json = model.to_h
|
|
1670
|
+
assert_kind_of Hash, json
|
|
1671
|
+
assert_equal fixture["id"], json[:id]
|
|
1672
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1673
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1674
|
+
end
|
|
1675
|
+
|
|
1676
|
+
def test_session_revoked_data_round_trip
|
|
1677
|
+
fixture = {
|
|
1678
|
+
"object" => "session",
|
|
1679
|
+
"id" => "stub",
|
|
1680
|
+
"impersonator" => {},
|
|
1681
|
+
"ip_address" => nil,
|
|
1682
|
+
"organization_id" => "stub",
|
|
1683
|
+
"user_agent" => nil,
|
|
1684
|
+
"user_id" => "stub",
|
|
1685
|
+
"auth_method" => "stub",
|
|
1686
|
+
"status" => "stub",
|
|
1687
|
+
"expires_at" => "stub",
|
|
1688
|
+
"ended_at" => nil,
|
|
264
1689
|
"created_at" => "stub",
|
|
265
1690
|
"updated_at" => "stub"
|
|
266
1691
|
}
|
|
267
|
-
model = WorkOS::
|
|
1692
|
+
model = WorkOS::SessionRevokedData.new(fixture.to_json)
|
|
268
1693
|
json = model.to_h
|
|
269
1694
|
assert_kind_of Hash, json
|
|
270
1695
|
assert_equal fixture["id"], json[:id]
|
|
271
|
-
|
|
1696
|
+
assert_nil json[:ip_address]
|
|
1697
|
+
assert_nil json[:user_agent]
|
|
1698
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1699
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
1700
|
+
assert_nil json[:ended_at]
|
|
1701
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1702
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1703
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1704
|
+
end
|
|
1705
|
+
|
|
1706
|
+
def test_session_revoked_data_impersonator_round_trip
|
|
1707
|
+
fixture = {
|
|
1708
|
+
"email" => "stub",
|
|
1709
|
+
"reason" => nil
|
|
1710
|
+
}
|
|
1711
|
+
model = WorkOS::SessionRevokedDataImpersonator.new(fixture.to_json)
|
|
1712
|
+
json = model.to_h
|
|
1713
|
+
assert_kind_of Hash, json
|
|
1714
|
+
assert_equal fixture["email"], json[:email]
|
|
1715
|
+
assert_nil json[:reason]
|
|
1716
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1717
|
+
end
|
|
1718
|
+
|
|
1719
|
+
def test_user_created_round_trip
|
|
1720
|
+
fixture = {
|
|
1721
|
+
"object" => "event",
|
|
1722
|
+
"id" => "stub",
|
|
1723
|
+
"event" => "user.created",
|
|
1724
|
+
"data" => {},
|
|
1725
|
+
"created_at" => "stub",
|
|
1726
|
+
"context" => {}
|
|
1727
|
+
}
|
|
1728
|
+
model = WorkOS::UserCreated.new(fixture.to_json)
|
|
1729
|
+
json = model.to_h
|
|
1730
|
+
assert_kind_of Hash, json
|
|
1731
|
+
assert_equal fixture["id"], json[:id]
|
|
1732
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1733
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1734
|
+
end
|
|
1735
|
+
|
|
1736
|
+
def test_user_deleted_round_trip
|
|
1737
|
+
fixture = {
|
|
1738
|
+
"object" => "event",
|
|
1739
|
+
"id" => "stub",
|
|
1740
|
+
"event" => "user.deleted",
|
|
1741
|
+
"data" => {},
|
|
1742
|
+
"created_at" => "stub",
|
|
1743
|
+
"context" => {}
|
|
1744
|
+
}
|
|
1745
|
+
model = WorkOS::UserDeleted.new(fixture.to_json)
|
|
1746
|
+
json = model.to_h
|
|
1747
|
+
assert_kind_of Hash, json
|
|
1748
|
+
assert_equal fixture["id"], json[:id]
|
|
1749
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1750
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1751
|
+
end
|
|
1752
|
+
|
|
1753
|
+
def test_user_updated_round_trip
|
|
1754
|
+
fixture = {
|
|
1755
|
+
"object" => "event",
|
|
1756
|
+
"id" => "stub",
|
|
1757
|
+
"event" => "user.updated",
|
|
1758
|
+
"data" => {},
|
|
1759
|
+
"created_at" => "stub",
|
|
1760
|
+
"context" => {}
|
|
1761
|
+
}
|
|
1762
|
+
model = WorkOS::UserUpdated.new(fixture.to_json)
|
|
1763
|
+
json = model.to_h
|
|
1764
|
+
assert_kind_of Hash, json
|
|
1765
|
+
assert_equal fixture["id"], json[:id]
|
|
1766
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
1767
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
1768
|
+
end
|
|
1769
|
+
|
|
1770
|
+
def test_radar_challenge_round_trip
|
|
1771
|
+
fixture = {
|
|
1772
|
+
"object" => "radar_challenge",
|
|
1773
|
+
"id" => "stub",
|
|
1774
|
+
"type" => "email",
|
|
1775
|
+
"user_id" => "stub",
|
|
1776
|
+
"email" => "stub",
|
|
1777
|
+
"expires_at" => "stub",
|
|
1778
|
+
"created_at" => "stub",
|
|
1779
|
+
"updated_at" => "stub",
|
|
1780
|
+
"code" => "stub"
|
|
1781
|
+
}
|
|
1782
|
+
model = WorkOS::RadarChallenge.new(fixture.to_json)
|
|
1783
|
+
json = model.to_h
|
|
1784
|
+
assert_kind_of Hash, json
|
|
1785
|
+
assert_equal fixture["id"], json[:id]
|
|
1786
|
+
assert_equal fixture["user_id"], json[:user_id]
|
|
1787
|
+
assert_equal fixture["email"], json[:email]
|
|
1788
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
272
1789
|
assert_equal fixture["created_at"], json[:created_at]
|
|
273
1790
|
assert_equal fixture["updated_at"], json[:updated_at]
|
|
1791
|
+
assert_equal fixture["code"], json[:code]
|
|
274
1792
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
275
1793
|
end
|
|
276
1794
|
|
|
@@ -555,6 +2073,45 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
555
2073
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
556
2074
|
end
|
|
557
2075
|
|
|
2076
|
+
def test_waitlist_round_trip
|
|
2077
|
+
fixture = {
|
|
2078
|
+
"object" => "waitlist",
|
|
2079
|
+
"id" => "stub",
|
|
2080
|
+
"created_at" => "stub",
|
|
2081
|
+
"updated_at" => "stub"
|
|
2082
|
+
}
|
|
2083
|
+
model = WorkOS::Waitlist.new(fixture.to_json)
|
|
2084
|
+
json = model.to_h
|
|
2085
|
+
assert_kind_of Hash, json
|
|
2086
|
+
assert_equal fixture["id"], json[:id]
|
|
2087
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
2088
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
2089
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
2090
|
+
end
|
|
2091
|
+
|
|
2092
|
+
def test_waitlist_entry_round_trip
|
|
2093
|
+
fixture = {
|
|
2094
|
+
"id" => "stub",
|
|
2095
|
+
"email" => "stub",
|
|
2096
|
+
"state" => "stub",
|
|
2097
|
+
"approved_at" => nil,
|
|
2098
|
+
"additional_fields" => {},
|
|
2099
|
+
"waitlist_id" => nil,
|
|
2100
|
+
"created_at" => "stub",
|
|
2101
|
+
"updated_at" => "stub",
|
|
2102
|
+
"object" => "waitlist_entry"
|
|
2103
|
+
}
|
|
2104
|
+
model = WorkOS::WaitlistEntry.new(fixture.to_json)
|
|
2105
|
+
json = model.to_h
|
|
2106
|
+
assert_kind_of Hash, json
|
|
2107
|
+
assert_equal fixture["id"], json[:id]
|
|
2108
|
+
assert_equal fixture["email"], json[:email]
|
|
2109
|
+
assert_nil json[:approved_at]
|
|
2110
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
2111
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
2112
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
2113
|
+
end
|
|
2114
|
+
|
|
558
2115
|
def test_jwks_response_round_trip
|
|
559
2116
|
fixture = {
|
|
560
2117
|
"keys" => []
|
|
@@ -792,6 +2349,28 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
792
2349
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
793
2350
|
end
|
|
794
2351
|
|
|
2352
|
+
def test_email_completion_session_authenticate_request_round_trip
|
|
2353
|
+
fixture = {
|
|
2354
|
+
"client_id" => "stub",
|
|
2355
|
+
"client_secret" => "stub",
|
|
2356
|
+
"grant_type" => "urn:workos:oauth:grant-type:email-completion",
|
|
2357
|
+
"email_completion_token" => "stub",
|
|
2358
|
+
"email" => "stub",
|
|
2359
|
+
"ip_address" => "stub",
|
|
2360
|
+
"device_id" => "stub",
|
|
2361
|
+
"user_agent" => "stub",
|
|
2362
|
+
"signals_id" => "stub"
|
|
2363
|
+
}
|
|
2364
|
+
model = WorkOS::EmailCompletionSessionAuthenticateRequest.new(fixture.to_json)
|
|
2365
|
+
json = model.to_h
|
|
2366
|
+
assert_kind_of Hash, json
|
|
2367
|
+
assert_equal fixture["client_id"], json[:client_id]
|
|
2368
|
+
assert_equal fixture["client_secret"], json[:client_secret]
|
|
2369
|
+
assert_equal fixture["email_completion_token"], json[:email_completion_token]
|
|
2370
|
+
assert_equal fixture["email"], json[:email]
|
|
2371
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
2372
|
+
end
|
|
2373
|
+
|
|
795
2374
|
def test_organization_selection_session_authenticate_request_round_trip
|
|
796
2375
|
fixture = {
|
|
797
2376
|
"client_id" => "stub",
|
|
@@ -855,8 +2434,6 @@ class UserManagementModelRoundTripTest < Minitest::Test
|
|
|
855
2434
|
assert_equal fixture["client_id"], json[:client_id]
|
|
856
2435
|
assert_equal fixture["client_secret"], json[:client_secret]
|
|
857
2436
|
assert_equal fixture["code"], json[:code]
|
|
858
|
-
assert_equal fixture["verification_id"], json[:verification_id]
|
|
859
|
-
assert_equal fixture["phone_number"], json[:phone_number]
|
|
860
2437
|
assert_equal fixture["pending_authentication_token"], json[:pending_authentication_token]
|
|
861
2438
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
862
2439
|
end
|