workos 7.1.2 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.github/workflows/docs.yml +49 -0
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/release-please.yml +164 -10
- data/.github/workflows/release.yml +2 -2
- data/.gitignore +2 -0
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +403 -84
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/.yardopts +6 -0
- data/CHANGELOG.md +331 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -4
- data/README.md +19 -0
- data/docs/V7_MIGRATION_GUIDE.md +21 -0
- data/lib/workos/actions.rb +1 -1
- data/lib/workos/admin_portal/generate_link.rb +0 -3
- data/lib/workos/admin_portal.rb +0 -3
- data/lib/workos/api_keys/api_key.rb +4 -1
- data/lib/workos/api_keys/api_key_created.rb +5 -5
- data/lib/workos/api_keys/api_key_created_data.rb +4 -1
- data/lib/workos/api_keys/api_key_revoked.rb +5 -5
- data/lib/workos/{audit_logs/audit_log_export_json.rb → api_keys/api_key_updated.rb} +10 -10
- data/lib/workos/api_keys/api_key_updated_data.rb +49 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data_domain.rb → api_keys/api_key_updated_data_owner.rb} +1 -1
- data/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb +18 -0
- data/lib/workos/api_keys/create_organization_api_key.rb +5 -2
- data/lib/workos/api_keys/expire_api_key.rb +18 -0
- data/lib/workos/api_keys/organization_api_key.rb +46 -0
- data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
- data/lib/workos/api_keys/organization_api_key_with_value.rb +49 -0
- data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
- data/lib/workos/api_keys.rb +75 -47
- data/lib/workos/audit_logs/audit_log_action.rb +2 -7
- data/lib/workos/audit_logs/audit_log_export.rb +2 -7
- data/lib/workos/audit_logs/audit_log_schema.rb +11 -2
- data/lib/workos/audit_logs/audit_log_schema_actor_input.rb +7 -0
- data/lib/workos/audit_logs/audit_log_schema_input.rb +25 -0
- data/lib/workos/audit_logs/audit_log_schema_target.rb +16 -1
- data/lib/workos/audit_logs/audit_log_schema_target_input.rb +7 -0
- data/lib/workos/audit_logs.rb +20 -20
- data/lib/workos/{audit_logs/audit_log_schema_json_actor.rb → authorization/create_group_role_assignment.rb} +1 -1
- data/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb +7 -0
- data/lib/workos/authorization/{role_assignment.rb → group_role_assignment.rb} +5 -2
- data/lib/workos/authorization/group_role_assignment_list.rb +25 -0
- data/lib/workos/authorization/{role_assignment_resource.rb → group_role_assignment_resource.rb} +1 -1
- data/lib/workos/authorization/permission_created.rb +5 -5
- data/lib/workos/authorization/permission_deleted.rb +5 -5
- data/lib/workos/authorization/permission_updated.rb +5 -5
- data/lib/workos/{api_keys/api_key_with_value_owner.rb → authorization/replace_group_role_assignment_entry.rb} +1 -1
- data/lib/workos/authorization/replace_group_role_assignments.rb +18 -0
- data/lib/workos/authorization/role_created.rb +5 -5
- data/lib/workos/authorization/role_deleted.rb +5 -5
- data/lib/workos/authorization/role_updated.rb +5 -5
- data/lib/workos/authorization/user_role_assignment.rb +40 -0
- data/lib/workos/authorization/user_role_assignment_resource.rb +7 -0
- data/lib/workos/{audit_logs/audit_log_schema_json_target.rb → authorization/user_role_assignment_source.rb} +4 -4
- data/lib/workos/authorization.rb +326 -30
- data/lib/workos/base_client.rb +90 -7
- data/lib/workos/client.rb +18 -10
- data/lib/workos/client_api/client_api_token.rb +22 -0
- data/lib/workos/client_api/client_api_token_response.rb +18 -0
- data/lib/workos/client_api.rb +39 -0
- data/lib/workos/connect/connect_application.rb +12 -0
- data/lib/workos/connect/connect_application_redirect_uri.rb +22 -0
- data/lib/workos/connect/user_object.rb +3 -0
- data/lib/workos/connect.rb +2 -2
- data/lib/workos/directory_sync/directory_user.rb +3 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
- data/lib/workos/directory_sync/dsync_activated.rb +5 -5
- data/lib/workos/directory_sync/dsync_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_added.rb +5 -5
- data/lib/workos/directory_sync/dsync_group_user_removed.rb +5 -5
- data/lib/workos/directory_sync/dsync_token_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_created_data.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked.rb +34 -0
- data/lib/workos/directory_sync/dsync_token_revoked_data.rb +7 -0
- data/lib/workos/directory_sync/dsync_user_created.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_deleted.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated.rb +5 -5
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
- data/lib/workos/directory_sync.rb +6 -6
- data/lib/workos/encryptors/aes_gcm.rb +19 -5
- data/lib/workos/events.rb +2 -2
- data/lib/workos/feature_flags/flag_created.rb +5 -5
- data/lib/workos/feature_flags/flag_deleted.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated.rb +5 -5
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +1 -16
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +1 -1
- data/lib/workos/feature_flags/flag_updated.rb +5 -5
- data/lib/workos/feature_flags.rb +6 -6
- data/lib/workos/{authorization → groups}/user_organization_membership_base_list_data.rb +5 -2
- data/lib/workos/groups.rb +4 -4
- data/lib/workos/inflections.rb +3 -1
- data/lib/workos/multi_factor_auth.rb +2 -2
- data/lib/workos/organization_domains/organization_domain_created.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_deleted.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_updated.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verification_failed.rb +5 -5
- data/lib/workos/organization_domains/organization_domain_verified.rb +5 -5
- data/lib/workos/{user_management → organization_membership}/organization_membership.rb +8 -2
- data/lib/workos/{user_management → organization_membership}/user_organization_membership.rb +8 -2
- data/lib/workos/organization_membership_service.rb +273 -0
- data/lib/workos/organizations/audit_logs_retention.rb +2 -7
- data/lib/workos/organizations/organization_created.rb +5 -5
- data/lib/workos/organizations/organization_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_created.rb +5 -5
- data/lib/workos/organizations/organization_membership_deleted.rb +5 -5
- data/lib/workos/organizations/organization_membership_updated.rb +5 -5
- data/lib/workos/organizations/organization_role_created.rb +5 -5
- data/lib/workos/organizations/organization_role_deleted.rb +5 -5
- data/lib/workos/organizations/organization_role_updated.rb +5 -5
- data/lib/workos/organizations/organization_updated.rb +5 -5
- data/lib/workos/organizations.rb +2 -2
- data/lib/workos/pipes/connected_account.rb +6 -0
- data/lib/workos/pipes/connected_account_dto.rb +31 -0
- data/lib/workos/pipes/create_data_integration.rb +34 -0
- data/lib/workos/pipes/custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/data_integration.rb +55 -0
- data/lib/workos/pipes/data_integration_credential.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
- data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
- data/lib/workos/pipes/data_integrations_list_response_data.rb +3 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
- data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/update_data_integration.rb +31 -0
- data/lib/workos/pipes.rb +309 -5
- data/lib/workos/pipes_provider/configure_data_integration_body.rb +28 -0
- data/lib/workos/pipes_provider/data_integration_configuration_list_response.rb +22 -0
- data/lib/workos/{directory_sync/dsync_deactivated_data.rb → pipes_provider/data_integration_configuration_response.rb} +13 -13
- data/lib/workos/pipes_provider/data_integration_credentials.rb +31 -0
- data/lib/workos/pipes_provider.rb +68 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +3 -6
- data/lib/workos/radar.rb +7 -10
- data/lib/workos/session.rb +28 -7
- data/lib/workos/session_manager.rb +24 -1
- data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
- data/lib/workos/shared/connect_application_m2m.rb +46 -0
- data/lib/workos/shared/connect_application_oauth.rb +58 -0
- data/lib/workos/shared/connect_application_oauth_redirect_uris.rb +22 -0
- data/lib/workos/shared/error_response.rb +18 -0
- data/lib/workos/shared/group_created.rb +5 -5
- data/lib/workos/shared/group_deleted.rb +5 -5
- data/lib/workos/shared/group_member_added.rb +5 -5
- data/lib/workos/shared/group_member_removed.rb +5 -5
- data/lib/workos/shared/group_updated.rb +5 -5
- data/lib/workos/shared/pipe_connected_account.rb +46 -0
- data/lib/workos/{directory_sync/dsync_deactivated.rb → shared/pipes_connected_account_connected.rb} +7 -7
- data/lib/workos/shared/pipes_connected_account_disconnected.rb +34 -0
- data/lib/workos/shared/pipes_connected_account_reauthorization_needed.rb +34 -0
- data/lib/workos/shared/waitlist_user_approved.rb +5 -5
- data/lib/workos/shared/waitlist_user_created.rb +5 -5
- data/lib/workos/shared/waitlist_user_denied.rb +5 -5
- data/lib/workos/sso/connection_activated.rb +5 -5
- data/lib/workos/sso/connection_deactivated.rb +5 -5
- data/lib/workos/sso/connection_deleted.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +5 -5
- data/lib/workos/sso/connection_saml_certificate_renewed.rb +5 -5
- data/lib/workos/sso/profile.rb +3 -0
- data/lib/workos/sso.rb +2 -2
- data/lib/workos/types/audit_log_configuration_log_stream_type.rb +2 -1
- data/lib/workos/types/audit_log_export_state.rb +2 -1
- data/lib/workos/types/connected_account_auth_method.rb +13 -0
- data/lib/workos/types/connected_account_state.rb +1 -2
- data/lib/workos/types/create_webhook_endpoint_events.rb +12 -1
- data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
- data/lib/workos/types/data_integration_access_token_response_error.rb +2 -2
- data/lib/workos/types/data_integration_credential_type.rb +13 -0
- data/lib/workos/types/data_integration_credentials_credentials_type.rb +14 -0
- data/lib/workos/types/{directories_order.rb → data_integration_credentials_response_error.rb} +1 -1
- data/lib/workos/types/{authorization_order.rb → data_integration_credentials_type.rb} +1 -1
- data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
- data/lib/workos/types/data_integration_state.rb +14 -0
- data/lib/workos/types/{connections_order.rb → data_integrations_list_response_data_auth_methods.rb} +1 -1
- data/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
- data/lib/workos/types/event_context_actor_source.rb +2 -1
- data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
- data/lib/workos/types/pipe_connected_account_state.rb +13 -0
- data/lib/workos/types/{radar_action.rb → radar_list_action.rb} +1 -1
- data/lib/workos/types/radar_list_type.rb +18 -0
- data/lib/workos/types/radar_standalone_assess_request_action.rb +1 -7
- data/lib/workos/types/radar_standalone_response_blocklist_type.rb +1 -10
- data/lib/workos/types/radar_standalone_response_control.rb +1 -4
- data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
- data/lib/workos/types/user_management_authentication_screen_hint.rb +1 -5
- data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
- data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
- data/{rbi/workos/types/request_options.rbi → lib/workos/types/vault_order.rb} +4 -3
- data/lib/workos/types/webhook_endpoint_status.rb +1 -5
- data/lib/workos/types/widget_session_token_scopes.rb +2 -1
- data/lib/workos/user_management/action_authentication_denied.rb +6 -6
- data/lib/workos/user_management/action_user_registration_denied.rb +6 -6
- data/lib/workos/user_management/authentication_email_verification_failed.rb +5 -5
- data/lib/workos/user_management/authentication_email_verification_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_failed.rb +5 -5
- data/lib/workos/user_management/authentication_mfa_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_failed.rb +5 -5
- data/lib/workos/user_management/authentication_oauth_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_failed.rb +5 -5
- data/lib/workos/user_management/authentication_passkey_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_password_failed.rb +5 -5
- data/lib/workos/user_management/authentication_password_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_radar_risk_detected.rb +5 -5
- data/lib/workos/user_management/authentication_sso_failed.rb +5 -5
- data/lib/workos/user_management/authentication_sso_started.rb +5 -5
- data/lib/workos/user_management/authentication_sso_succeeded.rb +5 -5
- data/lib/workos/user_management/authentication_sso_timed_out.rb +5 -5
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
- data/lib/workos/user_management/create_user.rb +12 -0
- data/lib/workos/user_management/create_user_api_key.rb +28 -0
- data/lib/workos/user_management/email_change_confirmation_user.rb +3 -0
- data/lib/workos/user_management/email_verification_created.rb +5 -5
- data/lib/workos/user_management/invitation_accepted.rb +5 -5
- data/lib/workos/user_management/invitation_created.rb +5 -5
- data/lib/workos/user_management/invitation_resent.rb +5 -5
- data/lib/workos/user_management/invitation_revoked.rb +5 -5
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/magic_auth_created.rb +5 -5
- data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
- data/lib/workos/user_management/password_reset_created.rb +5 -5
- data/lib/workos/user_management/password_reset_succeeded.rb +5 -5
- data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
- data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
- data/lib/workos/user_management/revoke_session.rb +2 -6
- data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
- data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
- data/lib/workos/user_management/session_created.rb +5 -5
- data/lib/workos/user_management/session_revoked.rb +5 -5
- data/lib/workos/user_management/update_user.rb +3 -0
- data/lib/workos/user_management/user_api_key.rb +46 -0
- data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
- data/lib/workos/user_management/user_api_key_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_revoked_data_owner.rb +7 -0
- data/lib/workos/user_management/user_api_key_updated_data_owner.rb +7 -0
- data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +5 -2
- data/lib/workos/user_management/user_api_key_with_value_owner.rb +7 -0
- data/lib/workos/user_management/user_create_response.rb +61 -0
- data/lib/workos/user_management/user_created.rb +5 -5
- data/lib/workos/user_management/user_deleted.rb +5 -5
- data/lib/workos/user_management/user_updated.rb +5 -5
- data/lib/workos/user_management.rb +351 -202
- data/lib/workos/vault/actor.rb +22 -0
- data/lib/workos/vault/create_data_key_request.rb +18 -0
- data/lib/workos/vault/create_data_key_response.rb +28 -0
- data/lib/workos/vault/create_object_request.rb +25 -0
- data/lib/workos/vault/decrypt_request.rb +18 -0
- data/lib/workos/vault/decrypt_response.rb +22 -0
- data/lib/workos/vault/delete_object_response.rb +22 -0
- data/lib/workos/vault/object_metadata.rb +37 -0
- data/lib/workos/{audit_logs/audit_log_action_json.rb → vault/object_summary.rb} +4 -10
- data/lib/workos/vault/object_version.rb +31 -0
- data/lib/workos/vault/object_without_value.rb +25 -0
- data/lib/workos/vault/rekey_request.rb +22 -0
- data/lib/workos/vault/update_object_request.rb +22 -0
- data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
- data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
- data/lib/workos/vault/vault_byok_key_verification_completed.rb +5 -5
- data/lib/workos/vault/vault_data_created.rb +5 -5
- data/lib/workos/vault/vault_data_deleted.rb +5 -5
- data/lib/workos/vault/vault_data_read.rb +5 -5
- data/lib/workos/vault/vault_data_updated.rb +5 -5
- data/lib/workos/vault/vault_dek_decrypted.rb +5 -5
- data/lib/workos/vault/vault_dek_read.rb +5 -5
- data/lib/workos/vault/vault_kek_created.rb +5 -5
- data/lib/workos/vault/vault_metadata_read.rb +5 -5
- data/lib/workos/vault/vault_names_listed.rb +5 -5
- data/lib/workos/vault/vault_object.rb +28 -0
- data/lib/workos/vault/version_list_response.rb +22 -0
- data/lib/workos/vault.rb +273 -139
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks/webhook_endpoint.rb +2 -7
- data/lib/workos/webhooks.rb +10 -11
- data/lib/workos/widgets/widget_session_token_response.rb +1 -12
- data/lib/workos.rb +3 -0
- data/rbi/workos/action_authentication_denied.rbi +10 -10
- data/rbi/workos/action_user_registration_denied.rbi +10 -10
- data/rbi/workos/actor.rbi +30 -0
- data/rbi/workos/admin_portal.rbi +1 -2
- data/rbi/workos/api_key.rbi +8 -2
- data/rbi/workos/api_key_created.rbi +6 -6
- data/rbi/workos/api_key_created_data.rbi +8 -2
- data/rbi/workos/api_key_revoked.rbi +6 -6
- data/rbi/workos/api_key_revoked_data.rbi +8 -2
- data/rbi/workos/{dsync_deactivated.rbi → api_key_updated.rbi} +9 -9
- data/rbi/workos/api_key_updated_data.rbi +84 -0
- data/rbi/workos/{api_key_with_value_owner.rbi → api_key_updated_data_owner.rbi} +1 -1
- data/rbi/workos/{audit_logs_retention_json.rbi → api_key_updated_data_previous_attribute.rbi} +5 -5
- data/rbi/workos/api_keys.rbi +27 -17
- data/rbi/workos/audit_log_action.rbi +1 -0
- data/rbi/workos/audit_log_export.rbi +1 -0
- data/rbi/workos/audit_log_schema.rbi +18 -0
- data/rbi/workos/{audit_log_schema_json_actor.rbi → audit_log_schema_actor_input.rbi} +1 -1
- data/rbi/workos/audit_log_schema_input.rbi +36 -0
- data/rbi/workos/{audit_log_schema_json_target.rbi → audit_log_schema_target_input.rbi} +1 -1
- data/rbi/workos/audit_logs.rbi +9 -9
- data/rbi/workos/audit_logs_retention.rbi +1 -0
- data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
- data/rbi/workos/authentication_email_verification_failed.rbi +6 -6
- data/rbi/workos/authentication_email_verification_succeeded.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_failed.rbi +6 -6
- data/rbi/workos/authentication_magic_auth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_mfa_failed.rbi +6 -6
- data/rbi/workos/authentication_mfa_succeeded.rbi +6 -6
- data/rbi/workos/authentication_oauth_failed.rbi +6 -6
- data/rbi/workos/authentication_oauth_succeeded.rbi +6 -6
- data/rbi/workos/authentication_passkey_failed.rbi +6 -6
- data/rbi/workos/authentication_passkey_succeeded.rbi +6 -6
- data/rbi/workos/authentication_password_failed.rbi +6 -6
- data/rbi/workos/authentication_password_succeeded.rbi +6 -6
- data/rbi/workos/authentication_radar_risk_detected.rbi +6 -6
- data/rbi/workos/authentication_sso_failed.rbi +6 -6
- data/rbi/workos/authentication_sso_started.rbi +6 -6
- data/rbi/workos/authentication_sso_succeeded.rbi +6 -6
- data/rbi/workos/authentication_sso_timed_out.rbi +6 -6
- data/rbi/workos/authorization.rbi +97 -4
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +8 -2
- data/rbi/workos/client.rbi +15 -6
- data/rbi/workos/client_api.rbi +22 -0
- data/rbi/workos/client_api_token.rbi +30 -0
- data/rbi/workos/client_api_token_response.rbi +24 -0
- data/rbi/workos/configure_data_integration_body.rbi +42 -0
- data/rbi/workos/connect_application.rbi +0 -12
- data/rbi/workos/{dsync_deactivated_data.rbi → connect_application_m2m.rbi} +19 -19
- data/rbi/workos/connect_application_oauth.rbi +102 -0
- data/rbi/workos/connect_application_oauth_redirect_uris.rbi +30 -0
- data/rbi/workos/connected_account.rbi +12 -0
- data/rbi/workos/connected_account_dto.rbi +48 -0
- data/rbi/workos/connection_activated.rbi +6 -6
- data/rbi/workos/connection_deactivated.rbi +6 -6
- data/rbi/workos/connection_deleted.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewal_required.rbi +6 -6
- data/rbi/workos/connection_saml_certificate_renewed.rbi +6 -6
- data/rbi/workos/create_data_integration.rbi +54 -0
- data/rbi/workos/create_data_key_request.rbi +24 -0
- data/rbi/workos/create_data_key_response.rbi +42 -0
- data/rbi/workos/create_group_role_assignment.rbi +42 -0
- data/rbi/workos/create_magic_code_and_return.rbi +24 -0
- data/rbi/workos/create_object_request.rbi +36 -0
- data/rbi/workos/create_organization_api_key.rbi +6 -0
- data/rbi/workos/create_user.rbi +24 -0
- data/rbi/workos/create_user_api_key.rbi +42 -0
- data/rbi/workos/custom_provider_definition.rbi +84 -0
- data/rbi/workos/data_integration.rbi +96 -0
- data/rbi/workos/data_integration_configuration_list_response.rbi +30 -0
- data/rbi/workos/data_integration_configuration_response.rbi +78 -0
- data/rbi/workos/data_integration_credential.rbi +36 -0
- data/rbi/workos/data_integration_credentials.rbi +48 -0
- data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
- data/rbi/workos/data_integration_custom_provider.rbi +84 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +6 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
- data/rbi/workos/decrypt_request.rbi +24 -0
- data/rbi/workos/decrypt_response.rbi +30 -0
- data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +42 -0
- data/rbi/workos/delete_object_response.rbi +30 -0
- data/rbi/workos/directory_user.rbi +6 -0
- data/rbi/workos/directory_user_with_groups.rbi +6 -0
- data/rbi/workos/dsync_activated.rbi +6 -6
- data/rbi/workos/dsync_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_created.rbi +6 -6
- data/rbi/workos/dsync_group_deleted.rbi +6 -6
- data/rbi/workos/dsync_group_updated.rbi +6 -6
- data/rbi/workos/dsync_group_user_added.rbi +6 -6
- data/rbi/workos/dsync_group_user_removed.rbi +6 -6
- data/rbi/workos/dsync_token_created.rbi +54 -0
- data/rbi/workos/{audit_log_export_json.rbi → dsync_token_created_data.rbi} +9 -9
- data/rbi/workos/dsync_token_revoked.rbi +54 -0
- data/rbi/workos/{audit_log_action_json.rbi → dsync_token_revoked_data.rbi} +17 -11
- data/rbi/workos/dsync_user_created.rbi +6 -6
- data/rbi/workos/dsync_user_deleted.rbi +6 -6
- data/rbi/workos/dsync_user_updated.rbi +6 -6
- data/rbi/workos/dsync_user_updated_data.rbi +6 -0
- data/rbi/workos/email_change_confirmation_user.rbi +6 -0
- data/rbi/workos/email_verification_created.rbi +6 -6
- data/rbi/workos/error_response.rbi +24 -0
- data/rbi/workos/expire_api_key.rbi +24 -0
- data/rbi/workos/flag_created.rbi +6 -6
- data/rbi/workos/flag_deleted.rbi +6 -6
- data/rbi/workos/flag_rule_updated.rbi +6 -6
- data/rbi/workos/flag_updated.rbi +6 -6
- data/rbi/workos/generate_link.rbi +0 -6
- data/rbi/workos/group_created.rbi +6 -6
- data/rbi/workos/group_deleted.rbi +6 -6
- data/rbi/workos/group_member_added.rbi +6 -6
- data/rbi/workos/group_member_removed.rbi +6 -6
- data/rbi/workos/{role_assignment.rbi → group_role_assignment.rbi} +9 -3
- data/rbi/workos/group_role_assignment_resource.rbi +36 -0
- data/rbi/workos/group_updated.rbi +6 -6
- data/rbi/workos/invitation_accepted.rbi +6 -6
- data/rbi/workos/invitation_created.rbi +6 -6
- data/rbi/workos/invitation_resent.rbi +6 -6
- data/rbi/workos/invitation_revoked.rbi +6 -6
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/magic_auth_created.rbi +6 -6
- data/rbi/workos/{webhook_endpoint_json.rbi → magic_auth_send_magic_auth_code_and_return_response.rbi} +19 -13
- data/rbi/workos/object_metadata.rbi +60 -0
- data/rbi/workos/object_summary.rbi +36 -0
- data/rbi/workos/object_version.rbi +48 -0
- data/rbi/workos/object_without_value.rbi +36 -0
- data/rbi/workos/organization_api_key.rbi +78 -0
- data/rbi/workos/organization_api_key_owner.rbi +30 -0
- data/rbi/workos/organization_api_key_with_value.rbi +84 -0
- data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/organization_created.rbi +6 -6
- data/rbi/workos/organization_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_created.rbi +6 -6
- data/rbi/workos/organization_domain_deleted.rbi +6 -6
- data/rbi/workos/organization_domain_updated.rbi +6 -6
- data/rbi/workos/organization_domain_verification_failed.rbi +6 -6
- data/rbi/workos/organization_domain_verified.rbi +6 -6
- data/rbi/workos/organization_membership.rbi +12 -0
- data/rbi/workos/organization_membership_created.rbi +6 -6
- data/rbi/workos/organization_membership_deleted.rbi +6 -6
- data/rbi/workos/organization_membership_service.rbi +114 -0
- data/rbi/workos/organization_membership_updated.rbi +6 -6
- data/rbi/workos/organization_role_created.rbi +6 -6
- data/rbi/workos/organization_role_deleted.rbi +6 -6
- data/rbi/workos/organization_role_updated.rbi +6 -6
- data/rbi/workos/organization_updated.rbi +6 -6
- data/rbi/workos/password_reset_created.rbi +6 -6
- data/rbi/workos/password_reset_succeeded.rbi +6 -6
- data/rbi/workos/password_session_authenticate_request.rbi +12 -0
- data/rbi/workos/permission_created.rbi +6 -6
- data/rbi/workos/permission_deleted.rbi +6 -6
- data/rbi/workos/permission_updated.rbi +6 -6
- data/rbi/workos/pipe_connected_account.rbi +78 -0
- data/rbi/workos/pipes.rbi +105 -1
- data/rbi/workos/pipes_connected_account_connected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_disconnected.rbi +54 -0
- data/rbi/workos/pipes_connected_account_reauthorization_needed.rbi +54 -0
- data/rbi/workos/pipes_provider.rbi +34 -0
- data/rbi/workos/profile.rbi +6 -0
- data/rbi/workos/radar.rbi +2 -3
- data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +2 -8
- data/rbi/workos/refresh_token_session_authenticate_request.rbi +2 -2
- data/rbi/workos/rekey_request.rbi +30 -0
- data/rbi/workos/replace_group_role_assignment_entry.rbi +42 -0
- data/rbi/workos/replace_group_role_assignments.rbi +24 -0
- data/rbi/workos/revoke_session.rbi +0 -6
- data/rbi/workos/role_created.rbi +6 -6
- data/rbi/workos/role_deleted.rbi +6 -6
- data/rbi/workos/role_updated.rbi +6 -6
- data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
- data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
- data/rbi/workos/session_created.rbi +6 -6
- data/rbi/workos/session_manager.rbi +1 -1
- data/rbi/workos/session_revoked.rbi +6 -6
- data/rbi/workos/update_custom_provider_definition.rbi +84 -0
- data/rbi/workos/update_data_integration.rbi +48 -0
- data/rbi/workos/update_object_request.rbi +30 -0
- data/rbi/workos/update_user.rbi +6 -0
- data/rbi/workos/user.rbi +6 -0
- data/rbi/workos/{api_key_with_value.rbi → user_api_key.rbi} +9 -9
- data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
- data/rbi/workos/{dsync_deactivated_data_domain.rbi → user_api_key_owner.rbi} +5 -5
- data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_updated_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_with_value.rbi +84 -0
- data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
- data/rbi/workos/user_create_response.rbi +108 -0
- data/rbi/workos/user_created.rbi +6 -6
- data/rbi/workos/user_deleted.rbi +6 -6
- data/rbi/workos/user_management.rbi +72 -86
- data/rbi/workos/user_object.rbi +6 -0
- data/rbi/workos/user_organization_membership.rbi +12 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
- data/rbi/workos/user_role_assignment.rbi +66 -0
- data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
- data/rbi/workos/user_role_assignment_source.rbi +30 -0
- data/rbi/workos/user_updated.rbi +6 -6
- data/rbi/workos/vault.rbi +70 -95
- data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
- data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
- data/rbi/workos/vault_byok_key_verification_completed.rbi +6 -6
- data/rbi/workos/vault_data_created.rbi +6 -6
- data/rbi/workos/vault_data_deleted.rbi +6 -6
- data/rbi/workos/vault_data_read.rbi +6 -6
- data/rbi/workos/vault_data_updated.rbi +6 -6
- data/rbi/workos/vault_dek_decrypted.rbi +6 -6
- data/rbi/workos/vault_dek_read.rbi +6 -6
- data/rbi/workos/vault_kek_created.rbi +6 -6
- data/rbi/workos/vault_metadata_read.rbi +6 -6
- data/rbi/workos/vault_names_listed.rbi +6 -6
- data/rbi/workos/vault_object.rbi +42 -0
- data/rbi/workos/waitlist_user_approved.rbi +6 -6
- data/rbi/workos/waitlist_user_created.rbi +6 -6
- data/rbi/workos/waitlist_user_denied.rbi +6 -6
- data/rbi/workos/webhook_endpoint.rbi +1 -0
- data/rbi/workos/webhooks.rbi +2 -2
- data/renovate.json +1 -61
- data/script/docs +16 -0
- data/script/docs-serve +12 -0
- data/script/llms-txt +37 -0
- data/test/workos/test_actions.rb +9 -0
- data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
- data/test/workos/test_api_keys.rb +20 -12
- data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
- data/test/workos/test_authorization.rb +64 -0
- data/test/workos/test_authorization_model_round_trip.rb +456 -0
- data/test/workos/test_base_client.rb +108 -0
- data/test/workos/test_client_api.rb +33 -0
- data/test/workos/test_connect_model_round_trip.rb +30 -0
- data/test/workos/test_encryptors_aes_gcm.rb +16 -1
- data/test/workos/test_groups_model_round_trip.rb +33 -0
- data/test/workos/test_model_round_trip.rb +2 -7138
- data/test/workos/test_organization_membership_service.rb +107 -0
- data/test/workos/test_organizations_model_round_trip.rb +29 -0
- data/test/workos/test_pipes.rb +75 -3
- data/test/workos/test_pipes_model_round_trip.rb +389 -0
- data/test/workos/test_pipes_provider.rb +41 -0
- data/test/workos/test_radar_model_round_trip.rb +85 -0
- data/test/workos/test_session.rb +43 -4
- data/test/workos/test_shared_model_round_trip.rb +92 -0
- data/test/workos/test_user_management.rb +77 -73
- data/test/workos/test_user_management_model_round_trip.rb +1087 -0
- data/test/workos/test_vault.rb +91 -88
- data/test/workos/test_webhook_verify.rb +11 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +220 -85
- data/lib/workos/audit_logs/audit_log_schema_json.rb +0 -34
- data/lib/workos/organizations/audit_logs_retention_json.rb +0 -18
- data/lib/workos/types/audit_log_export_json_state.rb +0 -14
- data/lib/workos/types/directory_groups_order.rb +0 -9
- data/lib/workos/types/directory_users_order.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_state.rb +0 -9
- data/lib/workos/types/dsync_deactivated_data_type.rb +0 -9
- data/lib/workos/types/feature_flags_order.rb +0 -9
- data/lib/workos/types/groups_order.rb +0 -9
- data/lib/workos/types/organizations_api_keys_order.rb +0 -9
- data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
- data/lib/workos/types/organizations_order.rb +0 -9
- data/lib/workos/types/permissions_order.rb +0 -9
- data/lib/workos/types/radar_type.rb +0 -9
- data/lib/workos/types/user_management_invitations_order.rb +0 -9
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
- data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
- data/lib/workos/types/user_management_users_order.rb +0 -9
- data/lib/workos/types/webhook_endpoint_json_status.rb +0 -9
- data/lib/workos/types/webhooks_order.rb +0 -9
- data/lib/workos/user_management_organization_membership_groups.rb +0 -60
- data/lib/workos/webhooks/webhook_endpoint_json.rb +0 -40
- data/rbi/workos/actions.rbi +0 -48
- data/rbi/workos/audit_log_schema_json.rbi +0 -54
- data/rbi/workos/base_client.rbi +0 -132
- data/rbi/workos/configuration.rbi +0 -68
- data/rbi/workos/encryptors/aes_gcm.rbi +0 -19
- data/rbi/workos/errors.rbi +0 -43
- data/rbi/workos/hash_provider.rbi +0 -18
- data/rbi/workos/passwordless.rbi +0 -47
- data/rbi/workos/public_client.rbi +0 -12
- data/rbi/workos/session.rbi +0 -43
- data/rbi/workos/types/api_response.rbi +0 -29
- data/rbi/workos/types/base_model.rbi +0 -22
- data/rbi/workos/types/list_struct.rbi +0 -89
- data/rbi/workos/user_management_organization_membership_groups.rbi +0 -25
- data/rbi/workos/util.rbi +0 -12
- data/test/workos/test_user_management_organization_membership_groups.rb +0 -33
- /data/lib/workos/{user_management → organization_membership}/create_user_organization_membership.rb +0 -0
- /data/lib/workos/{user_management → organization_membership}/update_user_organization_membership.rb +0 -0
|
@@ -20,18 +20,6 @@ module WorkOS
|
|
|
20
20
|
# @return [WorkOS::Types::CreateUserPasswordHashType]
|
|
21
21
|
PasswordHashed = Data.define(:password_hash, :password_hash_type)
|
|
22
22
|
|
|
23
|
-
# Identifies the role (single variant).
|
|
24
|
-
#
|
|
25
|
-
# @!attribute [r] role_slug
|
|
26
|
-
# @return [String]
|
|
27
|
-
RoleSingle = Data.define(:role_slug)
|
|
28
|
-
|
|
29
|
-
# Identifies the role (multiple variant).
|
|
30
|
-
#
|
|
31
|
-
# @!attribute [r] role_slugs
|
|
32
|
-
# @return [Array<String>]
|
|
33
|
-
RoleMultiple = Data.define(:role_slugs)
|
|
34
|
-
|
|
35
23
|
def initialize(client)
|
|
36
24
|
@client = client
|
|
37
25
|
end
|
|
@@ -57,7 +45,7 @@ module WorkOS
|
|
|
57
45
|
|
|
58
46
|
# Authenticate
|
|
59
47
|
# @param client_id [String] The client ID of the application.
|
|
60
|
-
# @param client_secret [String, nil] The client secret of the application.
|
|
48
|
+
# @param client_secret [String, nil] The client secret of the application. May be omitted by public clients that authenticate through other means, such as a PKCE `code_verifier`.
|
|
61
49
|
# @param grant_type [String]
|
|
62
50
|
# @param code [String, nil] The authorization code received from the redirect.
|
|
63
51
|
# @param code_verifier [String, nil] The PKCE code verifier used to derive the code challenge passed to the authorization URL.
|
|
@@ -65,12 +53,17 @@ module WorkOS
|
|
|
65
53
|
# @param ip_address [String, nil] The IP address of the user's request.
|
|
66
54
|
# @param device_id [String, nil] A unique identifier for the device.
|
|
67
55
|
# @param user_agent [String, nil] The user agent string from the user's browser.
|
|
56
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this authentication attempt.
|
|
68
57
|
# @param email [String, nil] The user's email address.
|
|
69
58
|
# @param password [String, nil] The user's password.
|
|
59
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this authentication.
|
|
70
60
|
# @param refresh_token [String, nil] The refresh token to exchange for new tokens.
|
|
71
61
|
# @param organization_id [String, nil] The ID of the organization to scope the session to.
|
|
72
62
|
# @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
|
|
73
63
|
# @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
|
|
64
|
+
# @param radar_challenge_id [String, nil] The ID of the Radar email challenge being verified.
|
|
65
|
+
# @param verification_id [String, nil] The ID of the Radar SMS verification being confirmed.
|
|
66
|
+
# @param phone_number [String, nil] The phone number the Radar SMS challenge was sent to.
|
|
74
67
|
# @param device_code [String, nil] The device verification code.
|
|
75
68
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
76
69
|
# @return [WorkOS::AuthenticateResponse]
|
|
@@ -84,12 +77,17 @@ module WorkOS
|
|
|
84
77
|
ip_address: nil,
|
|
85
78
|
device_id: nil,
|
|
86
79
|
user_agent: nil,
|
|
80
|
+
signals_id: nil,
|
|
87
81
|
email: nil,
|
|
88
82
|
password: nil,
|
|
83
|
+
radar_auth_attempt_id: nil,
|
|
89
84
|
refresh_token: nil,
|
|
90
85
|
organization_id: nil,
|
|
91
86
|
pending_authentication_token: nil,
|
|
92
87
|
authentication_challenge_id: nil,
|
|
88
|
+
radar_challenge_id: nil,
|
|
89
|
+
verification_id: nil,
|
|
90
|
+
phone_number: nil,
|
|
93
91
|
device_code: nil,
|
|
94
92
|
request_options: {}
|
|
95
93
|
)
|
|
@@ -103,12 +101,17 @@ module WorkOS
|
|
|
103
101
|
"ip_address" => ip_address,
|
|
104
102
|
"device_id" => device_id,
|
|
105
103
|
"user_agent" => user_agent,
|
|
104
|
+
"signals_id" => signals_id,
|
|
106
105
|
"email" => email,
|
|
107
106
|
"password" => password,
|
|
107
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
108
108
|
"refresh_token" => refresh_token,
|
|
109
109
|
"organization_id" => organization_id,
|
|
110
110
|
"pending_authentication_token" => pending_authentication_token,
|
|
111
111
|
"authentication_challenge_id" => authentication_challenge_id,
|
|
112
|
+
"radar_challenge_id" => radar_challenge_id,
|
|
113
|
+
"verification_id" => verification_id,
|
|
114
|
+
"phone_number" => phone_number,
|
|
112
115
|
"device_code" => device_code
|
|
113
116
|
}.compact
|
|
114
117
|
response = @client.request(
|
|
@@ -130,6 +133,8 @@ module WorkOS
|
|
|
130
133
|
# @param ip_address [String, nil]
|
|
131
134
|
# @param device_id [String, nil]
|
|
132
135
|
# @param user_agent [String, nil]
|
|
136
|
+
# @param signals_id [String, nil]
|
|
137
|
+
# @param radar_auth_attempt_id [String, nil]
|
|
133
138
|
# @param request_options [Hash] Per-request overrides.
|
|
134
139
|
# @return [WorkOS::AuthenticateResponse]
|
|
135
140
|
def authenticate_with_password(
|
|
@@ -139,6 +144,8 @@ module WorkOS
|
|
|
139
144
|
ip_address: nil,
|
|
140
145
|
device_id: nil,
|
|
141
146
|
user_agent: nil,
|
|
147
|
+
signals_id: nil,
|
|
148
|
+
radar_auth_attempt_id: nil,
|
|
142
149
|
request_options: {}
|
|
143
150
|
)
|
|
144
151
|
body = {
|
|
@@ -150,7 +157,9 @@ module WorkOS
|
|
|
150
157
|
"invitation_token" => invitation_token,
|
|
151
158
|
"ip_address" => ip_address,
|
|
152
159
|
"device_id" => device_id,
|
|
153
|
-
"user_agent" => user_agent
|
|
160
|
+
"user_agent" => user_agent,
|
|
161
|
+
"signals_id" => signals_id,
|
|
162
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id
|
|
154
163
|
}.compact
|
|
155
164
|
response = @client.request(
|
|
156
165
|
method: :post,
|
|
@@ -169,6 +178,7 @@ module WorkOS
|
|
|
169
178
|
# @param ip_address [String, nil]
|
|
170
179
|
# @param device_id [String, nil]
|
|
171
180
|
# @param user_agent [String, nil]
|
|
181
|
+
# @param signals_id [String, nil]
|
|
172
182
|
# @param request_options [Hash] Per-request overrides.
|
|
173
183
|
# @return [WorkOS::AuthenticateResponse]
|
|
174
184
|
def authenticate_with_code(
|
|
@@ -178,6 +188,7 @@ module WorkOS
|
|
|
178
188
|
ip_address: nil,
|
|
179
189
|
device_id: nil,
|
|
180
190
|
user_agent: nil,
|
|
191
|
+
signals_id: nil,
|
|
181
192
|
request_options: {}
|
|
182
193
|
)
|
|
183
194
|
body = {
|
|
@@ -189,7 +200,8 @@ module WorkOS
|
|
|
189
200
|
"invitation_token" => invitation_token,
|
|
190
201
|
"ip_address" => ip_address,
|
|
191
202
|
"device_id" => device_id,
|
|
192
|
-
"user_agent" => user_agent
|
|
203
|
+
"user_agent" => user_agent,
|
|
204
|
+
"signals_id" => signals_id
|
|
193
205
|
}.compact
|
|
194
206
|
response = @client.request(
|
|
195
207
|
method: :post,
|
|
@@ -244,6 +256,7 @@ module WorkOS
|
|
|
244
256
|
# @param ip_address [String, nil]
|
|
245
257
|
# @param device_id [String, nil]
|
|
246
258
|
# @param user_agent [String, nil]
|
|
259
|
+
# @param radar_auth_attempt_id [String, nil]
|
|
247
260
|
# @param request_options [Hash] Per-request overrides.
|
|
248
261
|
# @return [WorkOS::AuthenticateResponse]
|
|
249
262
|
def authenticate_with_magic_auth(
|
|
@@ -253,6 +266,7 @@ module WorkOS
|
|
|
253
266
|
ip_address: nil,
|
|
254
267
|
device_id: nil,
|
|
255
268
|
user_agent: nil,
|
|
269
|
+
radar_auth_attempt_id: nil,
|
|
256
270
|
request_options: {}
|
|
257
271
|
)
|
|
258
272
|
body = {
|
|
@@ -264,7 +278,8 @@ module WorkOS
|
|
|
264
278
|
"invitation_token" => invitation_token,
|
|
265
279
|
"ip_address" => ip_address,
|
|
266
280
|
"device_id" => device_id,
|
|
267
|
-
"user_agent" => user_agent
|
|
281
|
+
"user_agent" => user_agent,
|
|
282
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id
|
|
268
283
|
}.compact
|
|
269
284
|
response = @client.request(
|
|
270
285
|
method: :post,
|
|
@@ -419,6 +434,87 @@ module WorkOS
|
|
|
419
434
|
WorkOS::AuthenticateResponse.new(response.body)
|
|
420
435
|
end
|
|
421
436
|
|
|
437
|
+
# Authenticate with radar email challenge.
|
|
438
|
+
# @param code [String]
|
|
439
|
+
# @param radar_challenge_id [String]
|
|
440
|
+
# @param pending_authentication_token [String]
|
|
441
|
+
# @param ip_address [String, nil]
|
|
442
|
+
# @param device_id [String, nil]
|
|
443
|
+
# @param user_agent [String, nil]
|
|
444
|
+
# @param request_options [Hash] Per-request overrides.
|
|
445
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
446
|
+
def authenticate_with_radar_email_challenge(
|
|
447
|
+
code:,
|
|
448
|
+
radar_challenge_id:,
|
|
449
|
+
pending_authentication_token:,
|
|
450
|
+
ip_address: nil,
|
|
451
|
+
device_id: nil,
|
|
452
|
+
user_agent: nil,
|
|
453
|
+
request_options: {}
|
|
454
|
+
)
|
|
455
|
+
body = {
|
|
456
|
+
"grant_type" => "urn:workos:oauth:grant-type:radar-email-challenge:code",
|
|
457
|
+
"client_id" => @client.client_id,
|
|
458
|
+
"client_secret" => @client.api_key,
|
|
459
|
+
"code" => code,
|
|
460
|
+
"radar_challenge_id" => radar_challenge_id,
|
|
461
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
462
|
+
"ip_address" => ip_address,
|
|
463
|
+
"device_id" => device_id,
|
|
464
|
+
"user_agent" => user_agent
|
|
465
|
+
}.compact
|
|
466
|
+
response = @client.request(
|
|
467
|
+
method: :post,
|
|
468
|
+
path: "/user_management/authenticate",
|
|
469
|
+
auth: true,
|
|
470
|
+
body: body,
|
|
471
|
+
request_options: request_options
|
|
472
|
+
)
|
|
473
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# Authenticate with radar sms challenge.
|
|
477
|
+
# @param code [String]
|
|
478
|
+
# @param verification_id [String]
|
|
479
|
+
# @param phone_number [String]
|
|
480
|
+
# @param pending_authentication_token [String]
|
|
481
|
+
# @param ip_address [String, nil]
|
|
482
|
+
# @param device_id [String, nil]
|
|
483
|
+
# @param user_agent [String, nil]
|
|
484
|
+
# @param request_options [Hash] Per-request overrides.
|
|
485
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
486
|
+
def authenticate_with_radar_sms_challenge(
|
|
487
|
+
code:,
|
|
488
|
+
verification_id:,
|
|
489
|
+
phone_number:,
|
|
490
|
+
pending_authentication_token:,
|
|
491
|
+
ip_address: nil,
|
|
492
|
+
device_id: nil,
|
|
493
|
+
user_agent: nil,
|
|
494
|
+
request_options: {}
|
|
495
|
+
)
|
|
496
|
+
body = {
|
|
497
|
+
"grant_type" => "urn:workos:oauth:grant-type:radar-sms-challenge:code",
|
|
498
|
+
"client_id" => @client.client_id,
|
|
499
|
+
"client_secret" => @client.api_key,
|
|
500
|
+
"code" => code,
|
|
501
|
+
"verification_id" => verification_id,
|
|
502
|
+
"phone_number" => phone_number,
|
|
503
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
504
|
+
"ip_address" => ip_address,
|
|
505
|
+
"device_id" => device_id,
|
|
506
|
+
"user_agent" => user_agent
|
|
507
|
+
}.compact
|
|
508
|
+
response = @client.request(
|
|
509
|
+
method: :post,
|
|
510
|
+
path: "/user_management/authenticate",
|
|
511
|
+
auth: true,
|
|
512
|
+
body: body,
|
|
513
|
+
request_options: request_options
|
|
514
|
+
)
|
|
515
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
516
|
+
end
|
|
517
|
+
|
|
422
518
|
# Get device authorization URL
|
|
423
519
|
# @param client_id [String] The WorkOS client ID for your application.
|
|
424
520
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -442,20 +538,52 @@ module WorkOS
|
|
|
442
538
|
result
|
|
443
539
|
end
|
|
444
540
|
|
|
541
|
+
# Send a Radar SMS challenge
|
|
542
|
+
# @param user_id [String] The ID of the user to send the SMS challenge to.
|
|
543
|
+
# @param pending_authentication_token [String] The pending authentication token from a previous authentication attempt that triggered the Radar challenge.
|
|
544
|
+
# @param phone_number [String] The phone number to send the SMS verification code to.
|
|
545
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
546
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
547
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
548
|
+
# @return [WorkOS::SendRadarSmsChallengeResponse]
|
|
549
|
+
def create_radar_challenge(
|
|
550
|
+
user_id:,
|
|
551
|
+
pending_authentication_token:,
|
|
552
|
+
phone_number:,
|
|
553
|
+
ip_address: nil,
|
|
554
|
+
user_agent: nil,
|
|
555
|
+
request_options: {}
|
|
556
|
+
)
|
|
557
|
+
body = {
|
|
558
|
+
"user_id" => user_id,
|
|
559
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
560
|
+
"phone_number" => phone_number,
|
|
561
|
+
"ip_address" => ip_address,
|
|
562
|
+
"user_agent" => user_agent
|
|
563
|
+
}.compact
|
|
564
|
+
response = @client.request(
|
|
565
|
+
method: :post,
|
|
566
|
+
path: "/user_management/radar_challenges",
|
|
567
|
+
auth: true,
|
|
568
|
+
body: body,
|
|
569
|
+
request_options: request_options
|
|
570
|
+
)
|
|
571
|
+
result = WorkOS::SendRadarSmsChallengeResponse.new(response.body)
|
|
572
|
+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
573
|
+
result
|
|
574
|
+
end
|
|
575
|
+
|
|
445
576
|
# Revoke Session
|
|
446
577
|
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
|
|
447
|
-
# @param return_to [String, nil] The URL to redirect the user to after session revocation.
|
|
448
578
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
449
579
|
# @return [void]
|
|
450
580
|
def revoke_session(
|
|
451
581
|
session_id:,
|
|
452
|
-
return_to: nil,
|
|
453
582
|
request_options: {}
|
|
454
583
|
)
|
|
455
584
|
body = {
|
|
456
|
-
"session_id" => session_id
|
|
457
|
-
|
|
458
|
-
}.compact
|
|
585
|
+
"session_id" => session_id
|
|
586
|
+
}
|
|
459
587
|
@client.request(
|
|
460
588
|
method: :post,
|
|
461
589
|
path: "/user_management/sessions/revoke",
|
|
@@ -466,6 +594,50 @@ module WorkOS
|
|
|
466
594
|
nil
|
|
467
595
|
end
|
|
468
596
|
|
|
597
|
+
# List CORS origins
|
|
598
|
+
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
599
|
+
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
600
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
601
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
602
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
603
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::CORSOriginResponse>]
|
|
604
|
+
def list_cors_origins(
|
|
605
|
+
before: nil,
|
|
606
|
+
after: nil,
|
|
607
|
+
limit: 10,
|
|
608
|
+
order: "desc",
|
|
609
|
+
request_options: {}
|
|
610
|
+
)
|
|
611
|
+
params = {
|
|
612
|
+
"before" => before,
|
|
613
|
+
"after" => after,
|
|
614
|
+
"limit" => limit,
|
|
615
|
+
"order" => order
|
|
616
|
+
}.compact
|
|
617
|
+
response = @client.request(
|
|
618
|
+
method: :get,
|
|
619
|
+
path: "/user_management/cors_origins",
|
|
620
|
+
auth: true,
|
|
621
|
+
params: params,
|
|
622
|
+
request_options: request_options
|
|
623
|
+
)
|
|
624
|
+
fetch_next = ->(cursor) {
|
|
625
|
+
list_cors_origins(
|
|
626
|
+
before: before,
|
|
627
|
+
after: cursor,
|
|
628
|
+
limit: limit,
|
|
629
|
+
order: order,
|
|
630
|
+
request_options: request_options
|
|
631
|
+
)
|
|
632
|
+
}
|
|
633
|
+
WorkOS::Types::ListStruct.from_response(
|
|
634
|
+
response,
|
|
635
|
+
model: WorkOS::CORSOriginResponse,
|
|
636
|
+
filters: {before: before, limit: limit, order: order},
|
|
637
|
+
fetch_next: fetch_next
|
|
638
|
+
)
|
|
639
|
+
end
|
|
640
|
+
|
|
469
641
|
# Create a CORS origin
|
|
470
642
|
# @param origin [String] The origin URL to allow for CORS requests.
|
|
471
643
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -580,7 +752,7 @@ module WorkOS
|
|
|
580
752
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
581
753
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
582
754
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
583
|
-
# @param order [WorkOS::Types::
|
|
755
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
584
756
|
# @param organization [String, nil] (deprecated) Filter users by the organization they are a member of. Deprecated in favor of `organization_id`.
|
|
585
757
|
# @param organization_id [String, nil] Filter users by the organization they are a member of.
|
|
586
758
|
# @param email [String, nil] Filter users by their email address.
|
|
@@ -589,7 +761,7 @@ module WorkOS
|
|
|
589
761
|
def list_users(
|
|
590
762
|
before: nil,
|
|
591
763
|
after: nil,
|
|
592
|
-
limit:
|
|
764
|
+
limit: 10,
|
|
593
765
|
order: "desc",
|
|
594
766
|
organization: nil,
|
|
595
767
|
organization_id: nil,
|
|
@@ -636,19 +808,27 @@ module WorkOS
|
|
|
636
808
|
# @param email [String] The email address of the user.
|
|
637
809
|
# @param first_name [String, nil] The first name of the user.
|
|
638
810
|
# @param last_name [String, nil] The last name of the user.
|
|
811
|
+
# @param name [String, nil] The user's full name.
|
|
639
812
|
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
640
813
|
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
641
814
|
# @param external_id [String, nil] The external ID of the user.
|
|
815
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
816
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
817
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
642
818
|
# @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password.
|
|
643
819
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
644
|
-
# @return [WorkOS::
|
|
820
|
+
# @return [WorkOS::UserCreateResponse]
|
|
645
821
|
def create_user(
|
|
646
822
|
email:,
|
|
647
823
|
first_name: nil,
|
|
648
824
|
last_name: nil,
|
|
825
|
+
name: nil,
|
|
649
826
|
email_verified: nil,
|
|
650
827
|
metadata: nil,
|
|
651
828
|
external_id: nil,
|
|
829
|
+
ip_address: nil,
|
|
830
|
+
user_agent: nil,
|
|
831
|
+
signals_id: nil,
|
|
652
832
|
password: nil,
|
|
653
833
|
request_options: {}
|
|
654
834
|
)
|
|
@@ -656,9 +836,13 @@ module WorkOS
|
|
|
656
836
|
"email" => email,
|
|
657
837
|
"first_name" => first_name,
|
|
658
838
|
"last_name" => last_name,
|
|
839
|
+
"name" => name,
|
|
659
840
|
"email_verified" => email_verified,
|
|
660
841
|
"metadata" => metadata,
|
|
661
|
-
"external_id" => external_id
|
|
842
|
+
"external_id" => external_id,
|
|
843
|
+
"ip_address" => ip_address,
|
|
844
|
+
"user_agent" => user_agent,
|
|
845
|
+
"signals_id" => signals_id
|
|
662
846
|
}.compact
|
|
663
847
|
if password
|
|
664
848
|
case password
|
|
@@ -678,7 +862,7 @@ module WorkOS
|
|
|
678
862
|
body: body,
|
|
679
863
|
request_options: request_options
|
|
680
864
|
)
|
|
681
|
-
result = WorkOS::
|
|
865
|
+
result = WorkOS::UserCreateResponse.new(response.body)
|
|
682
866
|
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
683
867
|
result
|
|
684
868
|
end
|
|
@@ -726,6 +910,7 @@ module WorkOS
|
|
|
726
910
|
# @param email [String, nil] The email address of the user.
|
|
727
911
|
# @param first_name [String, nil] The first name of the user.
|
|
728
912
|
# @param last_name [String, nil] The last name of the user.
|
|
913
|
+
# @param name [String, nil] The user's full name.
|
|
729
914
|
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
730
915
|
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
731
916
|
# @param external_id [String, nil] The external ID of the user.
|
|
@@ -738,6 +923,7 @@ module WorkOS
|
|
|
738
923
|
email: nil,
|
|
739
924
|
first_name: nil,
|
|
740
925
|
last_name: nil,
|
|
926
|
+
name: nil,
|
|
741
927
|
email_verified: nil,
|
|
742
928
|
metadata: nil,
|
|
743
929
|
external_id: nil,
|
|
@@ -749,6 +935,7 @@ module WorkOS
|
|
|
749
935
|
"email" => email,
|
|
750
936
|
"first_name" => first_name,
|
|
751
937
|
"last_name" => last_name,
|
|
938
|
+
"name" => name,
|
|
752
939
|
"email_verified" => email_verified,
|
|
753
940
|
"metadata" => metadata,
|
|
754
941
|
"external_id" => external_id,
|
|
@@ -911,14 +1098,14 @@ module WorkOS
|
|
|
911
1098
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
912
1099
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
913
1100
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
914
|
-
# @param order [WorkOS::Types::
|
|
1101
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
915
1102
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
916
1103
|
# @return [WorkOS::Types::ListStruct<WorkOS::UserSessionsListItem>]
|
|
917
1104
|
def list_sessions(
|
|
918
1105
|
id:,
|
|
919
1106
|
before: nil,
|
|
920
1107
|
after: nil,
|
|
921
|
-
limit:
|
|
1108
|
+
limit: 10,
|
|
922
1109
|
order: "desc",
|
|
923
1110
|
request_options: {}
|
|
924
1111
|
)
|
|
@@ -957,7 +1144,7 @@ module WorkOS
|
|
|
957
1144
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
958
1145
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
959
1146
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
960
|
-
# @param order [WorkOS::Types::
|
|
1147
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
961
1148
|
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join.
|
|
962
1149
|
# @param email [String, nil] The email address of the recipient.
|
|
963
1150
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -965,7 +1152,7 @@ module WorkOS
|
|
|
965
1152
|
def list_invitations(
|
|
966
1153
|
before: nil,
|
|
967
1154
|
after: nil,
|
|
968
|
-
limit:
|
|
1155
|
+
limit: 10,
|
|
969
1156
|
order: "desc",
|
|
970
1157
|
organization_id: nil,
|
|
971
1158
|
email: nil,
|
|
@@ -1144,6 +1331,21 @@ module WorkOS
|
|
|
1144
1331
|
result
|
|
1145
1332
|
end
|
|
1146
1333
|
|
|
1334
|
+
# Get JWT template
|
|
1335
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1336
|
+
# @return [WorkOS::JWTTemplateResponse]
|
|
1337
|
+
def list_jwt_template(request_options: {})
|
|
1338
|
+
response = @client.request(
|
|
1339
|
+
method: :get,
|
|
1340
|
+
path: "/user_management/jwt_template",
|
|
1341
|
+
auth: true,
|
|
1342
|
+
request_options: request_options
|
|
1343
|
+
)
|
|
1344
|
+
result = WorkOS::JWTTemplateResponse.new(response.body)
|
|
1345
|
+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1346
|
+
result
|
|
1347
|
+
end
|
|
1348
|
+
|
|
1147
1349
|
# Update JWT template
|
|
1148
1350
|
# @param content [String] The JWT template content as a Liquid template string.
|
|
1149
1351
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -1170,16 +1372,28 @@ module WorkOS
|
|
|
1170
1372
|
# Create a Magic Auth code
|
|
1171
1373
|
# @param email [String] The email address to send the magic code to.
|
|
1172
1374
|
# @param invitation_token [String, nil] The invitation token to associate with this magic code.
|
|
1375
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
1376
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
1377
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this request.
|
|
1378
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
1173
1379
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1174
|
-
# @return [WorkOS::
|
|
1380
|
+
# @return [WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse]
|
|
1175
1381
|
def create_magic_auth(
|
|
1176
1382
|
email:,
|
|
1177
1383
|
invitation_token: nil,
|
|
1384
|
+
ip_address: nil,
|
|
1385
|
+
user_agent: nil,
|
|
1386
|
+
radar_auth_attempt_id: nil,
|
|
1387
|
+
signals_id: nil,
|
|
1178
1388
|
request_options: {}
|
|
1179
1389
|
)
|
|
1180
1390
|
body = {
|
|
1181
1391
|
"email" => email,
|
|
1182
|
-
"invitation_token" => invitation_token
|
|
1392
|
+
"invitation_token" => invitation_token,
|
|
1393
|
+
"ip_address" => ip_address,
|
|
1394
|
+
"user_agent" => user_agent,
|
|
1395
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
1396
|
+
"signals_id" => signals_id
|
|
1183
1397
|
}.compact
|
|
1184
1398
|
response = @client.request(
|
|
1185
1399
|
method: :post,
|
|
@@ -1188,7 +1402,7 @@ module WorkOS
|
|
|
1188
1402
|
body: body,
|
|
1189
1403
|
request_options: request_options
|
|
1190
1404
|
)
|
|
1191
|
-
result = WorkOS::
|
|
1405
|
+
result = WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse.new(response.body)
|
|
1192
1406
|
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1193
1407
|
result
|
|
1194
1408
|
end
|
|
@@ -1212,207 +1426,50 @@ module WorkOS
|
|
|
1212
1426
|
result
|
|
1213
1427
|
end
|
|
1214
1428
|
|
|
1215
|
-
# List
|
|
1429
|
+
# List redirect URIs
|
|
1216
1430
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
1217
1431
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
1218
1432
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1219
|
-
# @param order [WorkOS::Types::
|
|
1220
|
-
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
1221
|
-
# @param statuses [Array<WorkOS::Types::UserManagementOrganizationMembershipStatuses>, nil] Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`.
|
|
1222
|
-
# @param user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
1433
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
1223
1434
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1224
|
-
# @return [WorkOS::Types::ListStruct<WorkOS::
|
|
1225
|
-
def
|
|
1435
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::RedirectUri>]
|
|
1436
|
+
def list_redirect_uris(
|
|
1226
1437
|
before: nil,
|
|
1227
1438
|
after: nil,
|
|
1228
|
-
limit:
|
|
1439
|
+
limit: 10,
|
|
1229
1440
|
order: "desc",
|
|
1230
|
-
organization_id: nil,
|
|
1231
|
-
statuses: nil,
|
|
1232
|
-
user_id: nil,
|
|
1233
1441
|
request_options: {}
|
|
1234
1442
|
)
|
|
1235
1443
|
params = {
|
|
1236
1444
|
"before" => before,
|
|
1237
1445
|
"after" => after,
|
|
1238
1446
|
"limit" => limit,
|
|
1239
|
-
"order" => order
|
|
1240
|
-
"organization_id" => organization_id,
|
|
1241
|
-
"statuses" => statuses,
|
|
1242
|
-
"user_id" => user_id
|
|
1447
|
+
"order" => order
|
|
1243
1448
|
}.compact
|
|
1244
1449
|
response = @client.request(
|
|
1245
1450
|
method: :get,
|
|
1246
|
-
path: "/user_management/
|
|
1451
|
+
path: "/user_management/redirect_uris",
|
|
1247
1452
|
auth: true,
|
|
1248
1453
|
params: params,
|
|
1249
1454
|
request_options: request_options
|
|
1250
1455
|
)
|
|
1251
1456
|
fetch_next = ->(cursor) {
|
|
1252
|
-
|
|
1457
|
+
list_redirect_uris(
|
|
1253
1458
|
before: before,
|
|
1254
1459
|
after: cursor,
|
|
1255
1460
|
limit: limit,
|
|
1256
1461
|
order: order,
|
|
1257
|
-
organization_id: organization_id,
|
|
1258
|
-
statuses: statuses,
|
|
1259
|
-
user_id: user_id,
|
|
1260
1462
|
request_options: request_options
|
|
1261
1463
|
)
|
|
1262
1464
|
}
|
|
1263
1465
|
WorkOS::Types::ListStruct.from_response(
|
|
1264
1466
|
response,
|
|
1265
|
-
model: WorkOS::
|
|
1266
|
-
filters: {before: before, limit: limit, order: order
|
|
1467
|
+
model: WorkOS::RedirectUri,
|
|
1468
|
+
filters: {before: before, limit: limit, order: order},
|
|
1267
1469
|
fetch_next: fetch_next
|
|
1268
1470
|
)
|
|
1269
1471
|
end
|
|
1270
1472
|
|
|
1271
|
-
# Create an organization membership
|
|
1272
|
-
# @param user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
1273
|
-
# @param organization_id [String] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
1274
|
-
# @param role [WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, nil] Identifies the role.
|
|
1275
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1276
|
-
# @return [WorkOS::OrganizationMembership]
|
|
1277
|
-
def create_organization_membership(
|
|
1278
|
-
user_id:,
|
|
1279
|
-
organization_id:,
|
|
1280
|
-
role: nil,
|
|
1281
|
-
request_options: {}
|
|
1282
|
-
)
|
|
1283
|
-
body = {
|
|
1284
|
-
"user_id" => user_id,
|
|
1285
|
-
"organization_id" => organization_id
|
|
1286
|
-
}
|
|
1287
|
-
if role
|
|
1288
|
-
case role
|
|
1289
|
-
when WorkOS::UserManagement::RoleSingle
|
|
1290
|
-
body["role_slug"] = role.role_slug
|
|
1291
|
-
when WorkOS::UserManagement::RoleMultiple
|
|
1292
|
-
body["role_slugs"] = role.role_slugs
|
|
1293
|
-
else
|
|
1294
|
-
raise ArgumentError, "expected role to be one of: WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, got #{role.class}"
|
|
1295
|
-
end
|
|
1296
|
-
end
|
|
1297
|
-
response = @client.request(
|
|
1298
|
-
method: :post,
|
|
1299
|
-
path: "/user_management/organization_memberships",
|
|
1300
|
-
auth: true,
|
|
1301
|
-
body: body,
|
|
1302
|
-
request_options: request_options
|
|
1303
|
-
)
|
|
1304
|
-
result = WorkOS::OrganizationMembership.new(response.body)
|
|
1305
|
-
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1306
|
-
result
|
|
1307
|
-
end
|
|
1308
|
-
|
|
1309
|
-
# Get an organization membership
|
|
1310
|
-
# @param id [String] The unique ID of the organization membership.
|
|
1311
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1312
|
-
# @return [WorkOS::UserOrganizationMembership]
|
|
1313
|
-
def get_organization_membership(
|
|
1314
|
-
id:,
|
|
1315
|
-
request_options: {}
|
|
1316
|
-
)
|
|
1317
|
-
response = @client.request(
|
|
1318
|
-
method: :get,
|
|
1319
|
-
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1320
|
-
auth: true,
|
|
1321
|
-
request_options: request_options
|
|
1322
|
-
)
|
|
1323
|
-
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1324
|
-
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1325
|
-
result
|
|
1326
|
-
end
|
|
1327
|
-
|
|
1328
|
-
# Update an organization membership
|
|
1329
|
-
# @param id [String] The unique ID of the organization membership.
|
|
1330
|
-
# @param role [WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, nil] Identifies the role.
|
|
1331
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1332
|
-
# @return [WorkOS::UserOrganizationMembership]
|
|
1333
|
-
def update_organization_membership(
|
|
1334
|
-
id:,
|
|
1335
|
-
role: nil,
|
|
1336
|
-
request_options: {}
|
|
1337
|
-
)
|
|
1338
|
-
body = {}
|
|
1339
|
-
if role
|
|
1340
|
-
case role
|
|
1341
|
-
when WorkOS::UserManagement::RoleSingle
|
|
1342
|
-
body["role_slug"] = role.role_slug
|
|
1343
|
-
when WorkOS::UserManagement::RoleMultiple
|
|
1344
|
-
body["role_slugs"] = role.role_slugs
|
|
1345
|
-
else
|
|
1346
|
-
raise ArgumentError, "expected role to be one of: WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, got #{role.class}"
|
|
1347
|
-
end
|
|
1348
|
-
end
|
|
1349
|
-
response = @client.request(
|
|
1350
|
-
method: :put,
|
|
1351
|
-
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1352
|
-
auth: true,
|
|
1353
|
-
body: body,
|
|
1354
|
-
request_options: request_options
|
|
1355
|
-
)
|
|
1356
|
-
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1357
|
-
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1358
|
-
result
|
|
1359
|
-
end
|
|
1360
|
-
|
|
1361
|
-
# Delete an organization membership
|
|
1362
|
-
# @param id [String] The unique ID of the organization membership.
|
|
1363
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1364
|
-
# @return [void]
|
|
1365
|
-
def delete_organization_membership(
|
|
1366
|
-
id:,
|
|
1367
|
-
request_options: {}
|
|
1368
|
-
)
|
|
1369
|
-
@client.request(
|
|
1370
|
-
method: :delete,
|
|
1371
|
-
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1372
|
-
auth: true,
|
|
1373
|
-
request_options: request_options
|
|
1374
|
-
)
|
|
1375
|
-
nil
|
|
1376
|
-
end
|
|
1377
|
-
|
|
1378
|
-
# Deactivate an organization membership
|
|
1379
|
-
# @param id [String] The unique ID of the organization membership.
|
|
1380
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1381
|
-
# @return [WorkOS::OrganizationMembership]
|
|
1382
|
-
def deactivate_organization_membership(
|
|
1383
|
-
id:,
|
|
1384
|
-
request_options: {}
|
|
1385
|
-
)
|
|
1386
|
-
response = @client.request(
|
|
1387
|
-
method: :put,
|
|
1388
|
-
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/deactivate",
|
|
1389
|
-
auth: true,
|
|
1390
|
-
request_options: request_options
|
|
1391
|
-
)
|
|
1392
|
-
result = WorkOS::OrganizationMembership.new(response.body)
|
|
1393
|
-
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1394
|
-
result
|
|
1395
|
-
end
|
|
1396
|
-
|
|
1397
|
-
# Reactivate an organization membership
|
|
1398
|
-
# @param id [String] The unique ID of the organization membership.
|
|
1399
|
-
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1400
|
-
# @return [WorkOS::UserOrganizationMembership]
|
|
1401
|
-
def reactivate_organization_membership(
|
|
1402
|
-
id:,
|
|
1403
|
-
request_options: {}
|
|
1404
|
-
)
|
|
1405
|
-
response = @client.request(
|
|
1406
|
-
method: :put,
|
|
1407
|
-
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/reactivate",
|
|
1408
|
-
auth: true,
|
|
1409
|
-
request_options: request_options
|
|
1410
|
-
)
|
|
1411
|
-
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1412
|
-
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1413
|
-
result
|
|
1414
|
-
end
|
|
1415
|
-
|
|
1416
1473
|
# Create a redirect URI
|
|
1417
1474
|
# @param uri [String] The redirect URI to create.
|
|
1418
1475
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -1441,14 +1498,14 @@ module WorkOS
|
|
|
1441
1498
|
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
1442
1499
|
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
1443
1500
|
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1444
|
-
# @param order [WorkOS::Types::
|
|
1501
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
1445
1502
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1446
1503
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizedConnectApplicationListData>]
|
|
1447
1504
|
def list_user_authorized_applications(
|
|
1448
1505
|
user_id:,
|
|
1449
1506
|
before: nil,
|
|
1450
1507
|
after: nil,
|
|
1451
|
-
limit:
|
|
1508
|
+
limit: 10,
|
|
1452
1509
|
order: "desc",
|
|
1453
1510
|
request_options: {}
|
|
1454
1511
|
)
|
|
@@ -1502,6 +1559,91 @@ module WorkOS
|
|
|
1502
1559
|
nil
|
|
1503
1560
|
end
|
|
1504
1561
|
|
|
1562
|
+
# List API keys for a user
|
|
1563
|
+
# @param user_id [String] Unique identifier of the user.
|
|
1564
|
+
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
|
|
1565
|
+
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
|
|
1566
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1567
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
|
|
1568
|
+
# @param organization_id [String, nil] The ID of the organization to filter user API keys by. When provided, only API keys created against that organization membership are returned.
|
|
1569
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1570
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserApiKey>]
|
|
1571
|
+
def list_user_api_keys(
|
|
1572
|
+
user_id:,
|
|
1573
|
+
before: nil,
|
|
1574
|
+
after: nil,
|
|
1575
|
+
limit: 10,
|
|
1576
|
+
order: "desc",
|
|
1577
|
+
organization_id: nil,
|
|
1578
|
+
request_options: {}
|
|
1579
|
+
)
|
|
1580
|
+
params = {
|
|
1581
|
+
"before" => before,
|
|
1582
|
+
"after" => after,
|
|
1583
|
+
"limit" => limit,
|
|
1584
|
+
"order" => order,
|
|
1585
|
+
"organization_id" => organization_id
|
|
1586
|
+
}.compact
|
|
1587
|
+
response = @client.request(
|
|
1588
|
+
method: :get,
|
|
1589
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/api_keys",
|
|
1590
|
+
auth: true,
|
|
1591
|
+
params: params,
|
|
1592
|
+
request_options: request_options
|
|
1593
|
+
)
|
|
1594
|
+
fetch_next = ->(cursor) {
|
|
1595
|
+
list_user_api_keys(
|
|
1596
|
+
user_id: user_id,
|
|
1597
|
+
before: before,
|
|
1598
|
+
after: cursor,
|
|
1599
|
+
limit: limit,
|
|
1600
|
+
order: order,
|
|
1601
|
+
organization_id: organization_id,
|
|
1602
|
+
request_options: request_options
|
|
1603
|
+
)
|
|
1604
|
+
}
|
|
1605
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1606
|
+
response,
|
|
1607
|
+
model: WorkOS::UserApiKey,
|
|
1608
|
+
filters: {user_id: user_id, before: before, limit: limit, order: order, organization_id: organization_id},
|
|
1609
|
+
fetch_next: fetch_next
|
|
1610
|
+
)
|
|
1611
|
+
end
|
|
1612
|
+
|
|
1613
|
+
# Create an API key for a user
|
|
1614
|
+
# @param user_id [String] Unique identifier of the user.
|
|
1615
|
+
# @param name [String] A descriptive name for the API key.
|
|
1616
|
+
# @param organization_id [String] The ID of the organization the user API key is associated with. The user must have an active membership in this organization.
|
|
1617
|
+
# @param permissions [Array<String>, nil] The permission slugs to assign to the API key. Each permission must be enabled for user API keys.
|
|
1618
|
+
# @param expires_at [String, nil] The timestamp when the API key should expire. Must be a future timestamp. If omitted, the key does not expire.
|
|
1619
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1620
|
+
# @return [WorkOS::UserApiKeyWithValue]
|
|
1621
|
+
def create_user_api_key(
|
|
1622
|
+
user_id:,
|
|
1623
|
+
name:,
|
|
1624
|
+
organization_id:,
|
|
1625
|
+
permissions: nil,
|
|
1626
|
+
expires_at: nil,
|
|
1627
|
+
request_options: {}
|
|
1628
|
+
)
|
|
1629
|
+
body = {
|
|
1630
|
+
"name" => name,
|
|
1631
|
+
"organization_id" => organization_id,
|
|
1632
|
+
"permissions" => permissions,
|
|
1633
|
+
"expires_at" => expires_at
|
|
1634
|
+
}.compact
|
|
1635
|
+
response = @client.request(
|
|
1636
|
+
method: :post,
|
|
1637
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/api_keys",
|
|
1638
|
+
auth: true,
|
|
1639
|
+
body: body,
|
|
1640
|
+
request_options: request_options
|
|
1641
|
+
)
|
|
1642
|
+
result = WorkOS::UserApiKeyWithValue.new(response.body)
|
|
1643
|
+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1644
|
+
result
|
|
1645
|
+
end
|
|
1646
|
+
|
|
1505
1647
|
# @oagen-ignore-start — non-spec helpers (hand-maintained)
|
|
1506
1648
|
# H13 — Build the JWKS URL for a given client_id (no HTTP call).
|
|
1507
1649
|
# Pair with #get_jwks (generated) to fetch the keyset.
|
|
@@ -1544,6 +1686,13 @@ module WorkOS
|
|
|
1544
1686
|
def get_authorization_url_with_pkce(redirect_uri:, client_id: nil, **opts)
|
|
1545
1687
|
pair = WorkOS::PKCE.generate_pair
|
|
1546
1688
|
state = opts.delete(:state) || WorkOS::PKCE.generate_code_verifier
|
|
1689
|
+
# Strip caller-supplied PKCE params: this helper exists specifically
|
|
1690
|
+
# to generate them, so a caller-provided value would either silently
|
|
1691
|
+
# override our freshly-generated challenge (defeating the helper) or
|
|
1692
|
+
# collide with the keyword args below and raise. Mirror the existing
|
|
1693
|
+
# opts.delete(:state) pattern.
|
|
1694
|
+
opts.delete(:code_challenge)
|
|
1695
|
+
opts.delete(:code_challenge_method)
|
|
1547
1696
|
url = get_authorization_url(
|
|
1548
1697
|
redirect_uri: redirect_uri,
|
|
1549
1698
|
client_id: client_id,
|