workos 6.2.0 → 7.1.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 +6 -9
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/release-please.yml +30 -2
- data/.github/workflows/release.yml +2 -6
- data/.last-synced-sha +1 -0
- data/.oagen-manifest.json +1750 -0
- data/.release-please-manifest.json +1 -1
- data/.ruby-version +1 -1
- data/.standard.yml +1 -0
- data/CHANGELOG.md +41 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +93 -47
- data/README.md +161 -14
- data/Rakefile +8 -4
- data/docs/V7_MIGRATION_GUIDE.md +780 -0
- data/lib/workos/actions.rb +93 -0
- data/lib/workos/admin_portal/domain_verification_intent_options.rb +18 -0
- data/lib/workos/admin_portal/generate_link.rb +34 -0
- data/lib/workos/admin_portal/intent_options.rb +22 -0
- data/lib/workos/admin_portal/portal_link_response.rb +18 -0
- data/lib/workos/admin_portal/sso_intent_options.rb +22 -0
- data/lib/workos/admin_portal.rb +51 -0
- data/lib/workos/api_keys/api_key.rb +43 -0
- data/lib/workos/api_keys/api_key_created.rb +34 -0
- data/lib/workos/api_keys/api_key_created_data.rb +43 -0
- data/lib/workos/api_keys/api_key_created_data_owner.rb +22 -0
- data/lib/workos/api_keys/api_key_owner.rb +7 -0
- data/lib/workos/api_keys/api_key_revoked.rb +34 -0
- data/lib/workos/api_keys/api_key_revoked_data.rb +7 -0
- data/lib/workos/api_keys/api_key_revoked_data_owner.rb +7 -0
- data/lib/workos/api_keys/api_key_validation_response.rb +18 -0
- data/lib/workos/api_keys/api_key_with_value.rb +46 -0
- data/lib/workos/api_keys/api_key_with_value_owner.rb +7 -0
- data/lib/workos/api_keys/create_organization_api_key.rb +22 -0
- data/lib/workos/api_keys/validate_api_key.rb +18 -0
- data/lib/workos/api_keys.rb +128 -0
- data/lib/workos/audit_logs/audit_log_action.rb +36 -0
- data/lib/workos/audit_logs/audit_log_action_json.rb +31 -0
- data/lib/workos/audit_logs/audit_log_event.rb +37 -0
- data/lib/workos/audit_logs/audit_log_event_actor.rb +28 -0
- data/lib/workos/audit_logs/audit_log_event_context.rb +22 -0
- data/lib/workos/audit_logs/audit_log_event_create_response.rb +18 -0
- data/lib/workos/audit_logs/audit_log_event_ingestion.rb +22 -0
- data/lib/workos/audit_logs/audit_log_event_target.rb +7 -0
- data/lib/workos/audit_logs/audit_log_export.rb +39 -0
- data/lib/workos/audit_logs/audit_log_export_creation.rb +49 -0
- data/lib/workos/audit_logs/audit_log_export_json.rb +34 -0
- data/lib/workos/audit_logs/audit_log_schema.rb +25 -0
- data/lib/workos/audit_logs/audit_log_schema_actor.rb +18 -0
- data/lib/workos/audit_logs/audit_log_schema_json.rb +34 -0
- data/lib/workos/audit_logs/audit_log_schema_json_actor.rb +7 -0
- data/lib/workos/audit_logs/audit_log_schema_json_target.rb +22 -0
- data/lib/workos/audit_logs/audit_log_schema_target.rb +7 -0
- data/lib/workos/audit_logs.rb +252 -72
- data/lib/workos/authorization/add_role_permission.rb +18 -0
- data/lib/workos/authorization/assign_role.rb +28 -0
- data/lib/workos/authorization/authorization_check.rb +18 -0
- data/lib/workos/authorization/authorization_permission.rb +43 -0
- data/lib/workos/authorization/authorization_resource.rb +46 -0
- data/lib/workos/authorization/check_authorization.rb +28 -0
- data/lib/workos/authorization/create_authorization_permission.rb +28 -0
- data/lib/workos/authorization/create_authorization_resource.rb +40 -0
- data/lib/workos/authorization/create_organization_role.rb +28 -0
- data/lib/workos/authorization/create_role.rb +7 -0
- data/lib/workos/authorization/permission.rb +7 -0
- data/lib/workos/authorization/permission_created.rb +34 -0
- data/lib/workos/authorization/permission_created_data.rb +40 -0
- data/lib/workos/authorization/permission_deleted.rb +34 -0
- data/lib/workos/authorization/permission_deleted_data.rb +7 -0
- data/lib/workos/authorization/permission_updated.rb +34 -0
- data/lib/workos/authorization/permission_updated_data.rb +7 -0
- data/lib/workos/authorization/remove_role.rb +7 -0
- data/lib/workos/authorization/role.rb +46 -0
- data/lib/workos/authorization/role_assignment.rb +34 -0
- data/lib/workos/authorization/role_assignment_resource.rb +25 -0
- data/lib/workos/authorization/role_created.rb +34 -0
- data/lib/workos/authorization/role_created_data.rb +34 -0
- data/lib/workos/authorization/role_deleted.rb +34 -0
- data/lib/workos/authorization/role_deleted_data.rb +7 -0
- data/lib/workos/authorization/role_list.rb +22 -0
- data/lib/workos/authorization/role_updated.rb +34 -0
- data/lib/workos/authorization/role_updated_data.rb +7 -0
- data/lib/workos/authorization/set_role_permissions.rb +18 -0
- data/lib/workos/authorization/slim_role.rb +7 -0
- data/lib/workos/authorization/update_authorization_permission.rb +22 -0
- data/lib/workos/authorization/update_authorization_resource.rb +31 -0
- data/lib/workos/authorization/update_organization_role.rb +7 -0
- data/lib/workos/authorization/update_role.rb +7 -0
- data/lib/workos/authorization/user_organization_membership_base_list_data.rb +46 -0
- data/lib/workos/authorization.rb +1283 -0
- data/lib/workos/base_client.rb +350 -0
- data/lib/workos/client.rb +102 -159
- data/lib/workos/configuration.rb +56 -5
- data/lib/workos/connect/application_credentials_list_item.rb +34 -0
- data/lib/workos/connect/connect_application.rb +46 -0
- data/lib/workos/connect/create_application_secret.rb +13 -0
- data/lib/workos/connect/create_m2m_application.rb +31 -0
- data/lib/workos/connect/create_oauth_application.rb +40 -0
- data/lib/workos/connect/external_auth_complete_response.rb +18 -0
- data/lib/workos/connect/new_connect_application_secret.rb +37 -0
- data/lib/workos/connect/redirect_uri_input.rb +22 -0
- data/lib/workos/connect/update_oauth_application.rb +28 -0
- data/lib/workos/connect/user_consent_option.rb +28 -0
- data/lib/workos/connect/user_consent_option_choice.rb +22 -0
- data/lib/workos/connect/user_management_login_request.rb +25 -0
- data/lib/workos/connect/user_object.rb +31 -0
- data/lib/workos/connect.rb +329 -0
- data/lib/workos/directory_sync/directory.rb +49 -0
- data/lib/workos/directory_sync/directory_group.rb +43 -0
- data/lib/workos/directory_sync/directory_metadata.rb +22 -0
- data/lib/workos/directory_sync/directory_metadata_user.rb +22 -0
- data/lib/workos/directory_sync/directory_user.rb +103 -0
- data/lib/workos/directory_sync/directory_user_email.rb +25 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +114 -0
- data/lib/workos/directory_sync/directory_user_with_groups_email.rb +7 -0
- data/lib/workos/directory_sync/dsync_activated.rb +34 -0
- data/lib/workos/directory_sync/dsync_activated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_activated_data_domain.rb +25 -0
- data/lib/workos/directory_sync/dsync_deactivated.rb +34 -0
- data/lib/workos/directory_sync/dsync_deactivated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_deactivated_data_domain.rb +7 -0
- data/lib/workos/directory_sync/dsync_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_deleted_data.rb +40 -0
- data/lib/workos/directory_sync/dsync_group_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_updated.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_updated_data.rb +46 -0
- data/lib/workos/directory_sync/dsync_group_user_added.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_user_added_data.rb +25 -0
- data/lib/workos/directory_sync/dsync_group_user_removed.rb +34 -0
- data/lib/workos/directory_sync/dsync_group_user_removed_data.rb +7 -0
- data/lib/workos/directory_sync/dsync_user_created.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_deleted.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_updated.rb +34 -0
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +106 -0
- data/lib/workos/directory_sync/dsync_user_updated_data_email.rb +7 -0
- data/lib/workos/directory_sync.rb +230 -181
- data/lib/workos/encryptors/aes_gcm.rb +40 -33
- data/lib/workos/encryptors.rb +3 -3
- data/lib/workos/errors.rb +17 -75
- data/lib/workos/events/event_list_list_metadata.rb +18 -0
- data/lib/workos/events/event_schema.rb +34 -0
- data/lib/workos/events.rb +64 -38
- data/lib/workos/feature_flags/feature_flag.rb +49 -0
- data/lib/workos/feature_flags/feature_flag_owner.rb +25 -0
- data/lib/workos/feature_flags/flag.rb +7 -0
- data/lib/workos/feature_flags/flag_created.rb +34 -0
- data/lib/workos/feature_flags/flag_created_context.rb +22 -0
- data/lib/workos/feature_flags/flag_created_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_created_data.rb +52 -0
- data/lib/workos/feature_flags/flag_created_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_deleted.rb +34 -0
- data/lib/workos/feature_flags/flag_deleted_context.rb +22 -0
- data/lib/workos/feature_flags/flag_deleted_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_deleted_data.rb +7 -0
- data/lib/workos/feature_flags/flag_deleted_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated.rb +34 -0
- data/lib/workos/feature_flags/flag_rule_updated_context.rb +31 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb +22 -0
- data/lib/workos/feature_flags/flag_rule_updated_data.rb +7 -0
- data/lib/workos/feature_flags/flag_rule_updated_data_owner.rb +7 -0
- data/lib/workos/feature_flags/flag_updated.rb +34 -0
- data/lib/workos/feature_flags/flag_updated_context.rb +25 -0
- data/lib/workos/feature_flags/flag_updated_context_actor.rb +25 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb +18 -0
- data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +31 -0
- data/lib/workos/feature_flags/flag_updated_data.rb +7 -0
- data/lib/workos/feature_flags/flag_updated_data_owner.rb +7 -0
- data/lib/workos/feature_flags.rb +246 -0
- data/lib/workos/groups/create_group.rb +22 -0
- data/lib/workos/groups/create_group_membership.rb +18 -0
- data/lib/workos/groups/group.rb +37 -0
- data/lib/workos/groups/update_group.rb +7 -0
- data/lib/workos/groups.rb +256 -0
- data/lib/workos/hash_provider.rb +34 -8
- data/lib/workos/inflections.rb +64 -0
- data/lib/workos/multi_factor_auth/authentication_challenge.rb +37 -0
- data/lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb +22 -0
- data/lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb +18 -0
- data/lib/workos/multi_factor_auth/authentication_factor.rb +40 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled.rb +40 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb +18 -0
- data/lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb +31 -0
- data/lib/workos/multi_factor_auth/authentication_factor_sms.rb +7 -0
- data/lib/workos/multi_factor_auth/authentication_factor_totp.rb +22 -0
- data/lib/workos/multi_factor_auth/authentication_factors_create_request.rb +31 -0
- data/lib/workos/multi_factor_auth/challenge_authentication_factor.rb +18 -0
- data/lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb +28 -0
- data/lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb +22 -0
- data/lib/workos/multi_factor_auth.rb +215 -0
- data/lib/workos/organization_domains/create_organization_domain.rb +22 -0
- data/lib/workos/organization_domains/organization_domain.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_created.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_created_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_deleted.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_deleted_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_stand_alone.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_updated.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_updated_data.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed_data.rb +22 -0
- data/lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb +46 -0
- data/lib/workos/organization_domains/organization_domain_verified.rb +34 -0
- data/lib/workos/organization_domains/organization_domain_verified_data.rb +46 -0
- data/lib/workos/organization_domains.rb +94 -0
- data/lib/workos/organizations/audit_log_configuration.rb +28 -0
- data/lib/workos/organizations/audit_log_configuration_log_stream.rb +31 -0
- data/lib/workos/organizations/audit_logs_retention.rb +23 -0
- data/lib/workos/organizations/audit_logs_retention_json.rb +18 -0
- data/lib/workos/organizations/organization.rb +55 -0
- data/lib/workos/organizations/organization_created.rb +34 -0
- data/lib/workos/organizations/organization_created_data.rb +43 -0
- data/lib/workos/organizations/organization_created_data_domain.rb +46 -0
- data/lib/workos/organizations/organization_deleted.rb +34 -0
- data/lib/workos/organizations/organization_deleted_data.rb +43 -0
- data/lib/workos/organizations/organization_deleted_data_domain.rb +46 -0
- data/lib/workos/organizations/organization_domain_data.rb +22 -0
- data/lib/workos/organizations/organization_input.rb +34 -0
- data/lib/workos/organizations/organization_membership_created.rb +34 -0
- data/lib/workos/organizations/organization_membership_created_data.rb +49 -0
- data/lib/workos/organizations/organization_membership_deleted.rb +34 -0
- data/lib/workos/organizations/organization_membership_deleted_data.rb +49 -0
- data/lib/workos/organizations/organization_membership_updated.rb +34 -0
- data/lib/workos/organizations/organization_membership_updated_data.rb +49 -0
- data/lib/workos/organizations/organization_role_created.rb +34 -0
- data/lib/workos/organizations/organization_role_created_data.rb +43 -0
- data/lib/workos/organizations/organization_role_deleted.rb +34 -0
- data/lib/workos/organizations/organization_role_deleted_data.rb +7 -0
- data/lib/workos/organizations/organization_role_updated.rb +34 -0
- data/lib/workos/organizations/organization_role_updated_data.rb +7 -0
- data/lib/workos/organizations/organization_updated.rb +34 -0
- data/lib/workos/organizations/organization_updated_data.rb +43 -0
- data/lib/workos/organizations/organization_updated_data_domain.rb +46 -0
- data/lib/workos/organizations/update_audit_logs_retention.rb +18 -0
- data/lib/workos/organizations/update_organization.rb +46 -0
- data/lib/workos/organizations.rb +203 -271
- data/lib/workos/passwordless.rb +63 -58
- data/lib/workos/pipes/connected_account.rb +40 -0
- data/lib/workos/pipes/data_integration_access_token_response.rb +25 -0
- data/lib/workos/pipes/data_integration_access_token_response_access_token.rb +31 -0
- data/lib/workos/pipes/data_integration_authorize_url_response.rb +18 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_get_user_token_request.rb +22 -0
- data/lib/workos/pipes/data_integrations_list_response.rb +22 -0
- data/lib/workos/pipes/data_integrations_list_response_data.rb +52 -0
- data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +52 -0
- data/lib/workos/pipes.rb +149 -0
- data/lib/workos/pkce.rb +42 -0
- data/lib/workos/public_client.rb +27 -0
- data/lib/workos/radar/radar_list_entry_already_present_response.rb +18 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +37 -0
- data/lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb +18 -0
- data/lib/workos/radar/radar_standalone_response.rb +31 -0
- data/lib/workos/radar/radar_standalone_update_radar_attempt_request.rb +22 -0
- data/lib/workos/radar/radar_standalone_update_radar_list_request.rb +7 -0
- data/lib/workos/radar.rb +132 -0
- data/lib/workos/session.rb +108 -160
- data/lib/workos/session_manager.rb +196 -0
- data/lib/workos/shared/event_context.rb +34 -0
- data/lib/workos/shared/event_context_actor.rb +25 -0
- data/lib/workos/shared/event_context_google_analytics_session.rb +25 -0
- data/lib/workos/shared/group_created.rb +34 -0
- data/lib/workos/shared/group_deleted.rb +34 -0
- data/lib/workos/shared/group_member_added.rb +34 -0
- data/lib/workos/shared/group_member_added_data.rb +22 -0
- data/lib/workos/shared/group_member_removed.rb +34 -0
- data/lib/workos/shared/group_member_removed_data.rb +7 -0
- data/lib/workos/shared/group_updated.rb +34 -0
- data/lib/workos/shared/waitlist_user.rb +37 -0
- data/lib/workos/shared/waitlist_user_approved.rb +34 -0
- data/lib/workos/shared/waitlist_user_created.rb +34 -0
- data/lib/workos/shared/waitlist_user_denied.rb +34 -0
- data/lib/workos/sso/connection.rb +58 -0
- data/lib/workos/sso/connection_activated.rb +34 -0
- data/lib/workos/sso/connection_activated_data.rb +49 -0
- data/lib/workos/sso/connection_activated_data_domain.rb +25 -0
- data/lib/workos/sso/connection_deactivated.rb +34 -0
- data/lib/workos/sso/connection_deactivated_data.rb +49 -0
- data/lib/workos/sso/connection_deactivated_data_domain.rb +7 -0
- data/lib/workos/sso/connection_deleted.rb +34 -0
- data/lib/workos/sso/connection_deleted_data.rb +40 -0
- data/lib/workos/sso/connection_domain.rb +7 -0
- data/lib/workos/sso/connection_option.rb +18 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +34 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb +22 -0
- data/lib/workos/sso/connection_saml_certificate_renewed.rb +34 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data.rb +25 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb +22 -0
- data/lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb +7 -0
- data/lib/workos/sso/profile.rb +58 -0
- data/lib/workos/sso/sso_authorize_url_response.rb +18 -0
- data/lib/workos/sso/sso_logout_authorize_request.rb +18 -0
- data/lib/workos/sso/sso_logout_authorize_response.rb +22 -0
- data/lib/workos/sso/sso_token_response.rb +31 -0
- data/lib/workos/sso/sso_token_response_oauth_token.rb +7 -0
- data/lib/workos/sso/token_query.rb +28 -0
- data/lib/workos/sso.rb +231 -212
- data/lib/workos/types/api_response.rb +10 -0
- data/lib/workos/types/applications_order.rb +14 -0
- data/lib/workos/types/audit_log_configuration_log_stream_state.rb +15 -0
- data/lib/workos/types/audit_log_configuration_log_stream_type.rb +17 -0
- data/lib/workos/types/audit_log_configuration_state.rb +14 -0
- data/lib/workos/types/audit_log_export_json_state.rb +14 -0
- data/lib/workos/types/audit_log_export_state.rb +14 -0
- data/lib/workos/types/audit_logs_order.rb +9 -0
- data/lib/workos/types/authenticate_response_authentication_method.rb +33 -0
- data/lib/workos/types/authentication_factor_enrolled_type.rb +15 -0
- data/lib/workos/types/authentication_factor_type.rb +9 -0
- data/lib/workos/types/authentication_factors_create_request_type.rb +14 -0
- data/lib/workos/types/authentication_radar_risk_detected_data_action.rb +13 -0
- data/lib/workos/types/authorization_assignment.rb +13 -0
- data/lib/workos/types/authorization_order.rb +9 -0
- data/lib/workos/types/base_model.rb +35 -0
- data/lib/workos/types/connected_account_state.rb +14 -0
- data/lib/workos/types/connection_activated_data_connection_type.rb +61 -0
- data/lib/workos/types/connection_activated_data_state.rb +16 -0
- data/lib/workos/types/connection_activated_data_status.rb +13 -0
- data/lib/workos/types/connection_deactivated_data_connection_type.rb +9 -0
- data/lib/workos/types/connection_deactivated_data_state.rb +9 -0
- data/lib/workos/types/connection_deactivated_data_status.rb +9 -0
- data/lib/workos/types/connection_deleted_data_connection_type.rb +9 -0
- data/lib/workos/types/connection_deleted_data_state.rb +9 -0
- data/lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb +14 -0
- data/lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb +9 -0
- data/lib/workos/types/connection_state.rb +17 -0
- data/lib/workos/types/connection_status.rb +9 -0
- data/lib/workos/types/connection_type.rb +62 -0
- data/lib/workos/types/connections_connection_type.rb +59 -0
- data/lib/workos/types/connections_order.rb +9 -0
- data/lib/workos/types/create_user_invite_options_locale.rb +101 -0
- data/lib/workos/types/create_user_password_hash_type.rb +17 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +88 -0
- data/lib/workos/types/data_integration_access_token_response_error.rb +13 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +9 -0
- data/lib/workos/types/data_integrations_list_response_data_ownership.rb +13 -0
- data/lib/workos/types/directories_order.rb +9 -0
- data/lib/workos/types/directory_groups_order.rb +9 -0
- data/lib/workos/types/directory_state.rb +16 -0
- data/lib/workos/types/directory_type.rb +32 -0
- data/lib/workos/types/directory_user_state.rb +14 -0
- data/lib/workos/types/directory_user_with_groups_state.rb +9 -0
- data/lib/workos/types/directory_users_order.rb +9 -0
- data/lib/workos/types/dsync_activated_data_state.rb +16 -0
- data/lib/workos/types/dsync_activated_data_type.rb +34 -0
- data/lib/workos/types/dsync_deactivated_data_state.rb +9 -0
- data/lib/workos/types/dsync_deactivated_data_type.rb +9 -0
- data/lib/workos/types/dsync_deleted_data_state.rb +9 -0
- data/lib/workos/types/dsync_deleted_data_type.rb +9 -0
- data/lib/workos/types/dsync_user_updated_data_state.rb +9 -0
- data/lib/workos/types/event_context_actor_source.rb +14 -0
- data/lib/workos/types/events_order.rb +9 -0
- data/lib/workos/types/feature_flags_order.rb +9 -0
- data/lib/workos/types/flag_created_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_deleted_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_rule_updated_context_access_type.rb +14 -0
- data/lib/workos/types/flag_rule_updated_context_actor_source.rb +9 -0
- data/lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb +9 -0
- data/lib/workos/types/flag_updated_context_actor_source.rb +9 -0
- data/lib/workos/types/generate_link_intent.rb +18 -0
- data/lib/workos/types/groups_order.rb +9 -0
- data/lib/workos/types/invitation_accepted_data_state.rb +15 -0
- data/lib/workos/types/invitation_created_data_state.rb +9 -0
- data/lib/workos/types/invitation_resent_data_state.rb +9 -0
- data/lib/workos/types/invitation_revoked_data_state.rb +9 -0
- data/lib/workos/types/invitation_state.rb +9 -0
- data/lib/workos/types/list_struct.rb +122 -6
- data/lib/workos/types/organization_created_data_domain_state.rb +16 -0
- data/lib/workos/types/organization_created_data_domain_verification_strategy.rb +13 -0
- data/lib/workos/types/organization_deleted_data_domain_state.rb +9 -0
- data/lib/workos/types/organization_deleted_data_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_created_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_created_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_data_state.rb +13 -0
- data/lib/workos/types/organization_domain_deleted_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_deleted_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_stand_alone_state.rb +9 -0
- data/lib/workos/types/organization_domain_stand_alone_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_state.rb +9 -0
- data/lib/workos/types/organization_domain_updated_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_updated_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verification_failed_data_reason.rb +13 -0
- data/lib/workos/types/organization_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_domain_verified_data_state.rb +9 -0
- data/lib/workos/types/organization_domain_verified_data_verification_strategy.rb +9 -0
- data/lib/workos/types/organization_membership_created_data_status.rb +14 -0
- data/lib/workos/types/organization_membership_deleted_data_status.rb +9 -0
- data/lib/workos/types/organization_membership_status.rb +9 -0
- data/lib/workos/types/organization_membership_updated_data_status.rb +9 -0
- data/lib/workos/types/organization_updated_data_domain_state.rb +9 -0
- data/lib/workos/types/organization_updated_data_domain_verification_strategy.rb +9 -0
- data/lib/workos/types/organizations_api_keys_order.rb +9 -0
- data/lib/workos/types/organizations_feature_flags_order.rb +9 -0
- data/lib/workos/types/organizations_order.rb +9 -0
- data/lib/workos/types/permissions_order.rb +9 -0
- data/lib/workos/types/profile_connection_type.rb +9 -0
- data/lib/workos/types/radar_action.rb +13 -0
- data/lib/workos/types/radar_standalone_assess_request_action.rb +19 -0
- data/lib/workos/types/radar_standalone_assess_request_auth_method.rb +19 -0
- data/lib/workos/types/radar_standalone_response_blocklist_type.rb +18 -0
- data/lib/workos/types/radar_standalone_response_control.rb +21 -0
- data/lib/workos/types/radar_standalone_response_verdict.rb +14 -0
- data/lib/workos/types/radar_type.rb +9 -0
- data/lib/workos/types/request_options.rb +33 -0
- data/lib/workos/types/resend_user_invite_options_locale.rb +9 -0
- data/lib/workos/types/role_type.rb +13 -0
- data/lib/workos/types/session_created_data_auth_method.rb +21 -0
- data/lib/workos/types/session_created_data_status.rb +14 -0
- data/lib/workos/types/session_revoked_data_auth_method.rb +9 -0
- data/lib/workos/types/session_revoked_data_status.rb +9 -0
- data/lib/workos/types/sso_provider.rb +24 -0
- data/lib/workos/types/update_user_password_hash_type.rb +9 -0
- data/lib/workos/types/update_webhook_endpoint_events.rb +9 -0
- data/lib/workos/types/update_webhook_endpoint_status.rb +13 -0
- data/lib/workos/types/user_identities_get_item_provider.rb +25 -0
- data/lib/workos/types/user_invite_state.rb +9 -0
- data/lib/workos/types/user_management_authentication_provider.rb +25 -0
- data/lib/workos/types/user_management_authentication_screen_hint.rb +13 -0
- data/lib/workos/types/user_management_invitations_order.rb +9 -0
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_order.rb +9 -0
- data/lib/workos/types/user_management_organization_membership_statuses.rb +9 -0
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +9 -0
- data/lib/workos/types/user_management_users_feature_flags_order.rb +9 -0
- data/lib/workos/types/user_management_users_order.rb +9 -0
- data/lib/workos/types/user_organization_membership_base_list_data_status.rb +9 -0
- data/lib/workos/types/user_organization_membership_status.rb +9 -0
- data/lib/workos/types/user_sessions_auth_method.rb +9 -0
- data/lib/workos/types/user_sessions_status.rb +9 -0
- data/lib/workos/types/vault_byok_key_verification_completed_data_key_provider.rb +14 -0
- data/lib/workos/types/vault_data_created_data_actor_source.rb +13 -0
- data/lib/workos/types/vault_data_deleted_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_data_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_data_updated_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_dek_decrypted_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_dek_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_kek_created_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_metadata_read_data_actor_source.rb +9 -0
- data/lib/workos/types/vault_names_listed_data_actor_source.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +14 -0
- data/lib/workos/types/webhook_endpoint_json_status.rb +9 -0
- data/lib/workos/types/webhook_endpoint_status.rb +13 -0
- data/lib/workos/types/webhooks_order.rb +9 -0
- data/lib/workos/types/widget_session_token_scopes.rb +17 -0
- data/lib/workos/user_management/action_authentication_denied.rb +34 -0
- data/lib/workos/user_management/action_authentication_denied_data.rb +43 -0
- data/lib/workos/user_management/action_user_registration_denied.rb +34 -0
- data/lib/workos/user_management/action_user_registration_denied_data.rb +40 -0
- data/lib/workos/user_management/authenticate_response.rb +40 -0
- data/lib/workos/user_management/authenticate_response_impersonator.rb +22 -0
- data/lib/workos/user_management/authenticate_response_oauth_token.rb +31 -0
- data/lib/workos/user_management/authentication_email_verification_failed.rb +34 -0
- data/lib/workos/user_management/authentication_email_verification_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_email_verification_failed_data_error.rb +22 -0
- data/lib/workos/user_management/authentication_email_verification_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_email_verification_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_failed.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_magic_auth_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_magic_auth_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_failed.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_mfa_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_mfa_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_mfa_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_failed.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_oauth_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_oauth_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_failed.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_passkey_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_passkey_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_passkey_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_password_failed.rb +34 -0
- data/lib/workos/user_management/authentication_password_failed_data.rb +37 -0
- data/lib/workos/user_management/authentication_password_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_password_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_password_succeeded_data.rb +34 -0
- data/lib/workos/user_management/authentication_radar_risk_detected.rb +34 -0
- data/lib/workos/user_management/authentication_radar_risk_detected_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_failed.rb +34 -0
- data/lib/workos/user_management/authentication_sso_failed_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_failed_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_sso_failed_data_sso.rb +25 -0
- data/lib/workos/user_management/authentication_sso_started.rb +34 -0
- data/lib/workos/user_management/authentication_sso_started_data.rb +37 -0
- data/lib/workos/user_management/authentication_sso_started_data_sso.rb +7 -0
- data/lib/workos/user_management/authentication_sso_succeeded.rb +34 -0
- data/lib/workos/user_management/authentication_sso_succeeded_data.rb +37 -0
- data/lib/workos/user_management/authentication_sso_succeeded_data_sso.rb +7 -0
- data/lib/workos/user_management/authentication_sso_timed_out.rb +34 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data.rb +40 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data_error.rb +7 -0
- data/lib/workos/user_management/authentication_sso_timed_out_data_sso.rb +7 -0
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/authorized_connect_application_list_data.rb +31 -0
- data/lib/workos/user_management/confirm_email_change.rb +7 -0
- data/lib/workos/user_management/cors_origin_response.rb +31 -0
- data/lib/workos/user_management/create_cors_origin.rb +18 -0
- data/lib/workos/user_management/create_magic_code_and_return.rb +22 -0
- data/lib/workos/user_management/create_password_reset.rb +22 -0
- data/lib/workos/user_management/create_password_reset_token.rb +18 -0
- data/lib/workos/user_management/create_redirect_uri.rb +18 -0
- data/lib/workos/user_management/create_user.rb +43 -0
- data/lib/workos/user_management/create_user_invite_options.rb +34 -0
- data/lib/workos/user_management/create_user_organization_membership.rb +28 -0
- data/lib/workos/user_management/device_authorization_response.rb +34 -0
- data/lib/workos/user_management/device_code_session_authenticate_request.rb +34 -0
- data/lib/workos/user_management/email_change.rb +31 -0
- data/lib/workos/user_management/email_change_confirmation.rb +22 -0
- data/lib/workos/user_management/email_change_confirmation_user.rb +55 -0
- data/lib/workos/user_management/email_verification.rb +40 -0
- data/lib/workos/user_management/email_verification_code_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/email_verification_created.rb +34 -0
- data/lib/workos/user_management/email_verification_created_data.rb +37 -0
- data/lib/workos/user_management/invitation.rb +61 -0
- data/lib/workos/user_management/invitation_accepted.rb +34 -0
- data/lib/workos/user_management/invitation_accepted_data.rb +55 -0
- data/lib/workos/user_management/invitation_created.rb +34 -0
- data/lib/workos/user_management/invitation_created_data.rb +55 -0
- data/lib/workos/user_management/invitation_resent.rb +34 -0
- data/lib/workos/user_management/invitation_resent_data.rb +55 -0
- data/lib/workos/user_management/invitation_revoked.rb +34 -0
- data/lib/workos/user_management/invitation_revoked_data.rb +55 -0
- data/lib/workos/user_management/jwks_response.rb +18 -0
- data/lib/workos/user_management/jwks_response_keys.rb +40 -0
- data/lib/workos/user_management/jwt_template_response.rb +28 -0
- data/lib/workos/user_management/magic_auth.rb +40 -0
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/magic_auth_created.rb +34 -0
- data/lib/workos/user_management/magic_auth_created_data.rb +37 -0
- data/lib/workos/user_management/mfa_totp_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/organization_membership.rb +49 -0
- data/lib/workos/user_management/organization_selection_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/password_reset.rb +40 -0
- data/lib/workos/user_management/password_reset_created.rb +34 -0
- data/lib/workos/user_management/password_reset_created_data.rb +34 -0
- data/lib/workos/user_management/password_reset_succeeded.rb +34 -0
- data/lib/workos/user_management/password_reset_succeeded_data.rb +7 -0
- data/lib/workos/user_management/password_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/redirect_uri.rb +34 -0
- data/lib/workos/user_management/refresh_token_session_authenticate_request.rb +40 -0
- data/lib/workos/user_management/resend_user_invite_options.rb +18 -0
- data/lib/workos/user_management/reset_password_response.rb +18 -0
- data/lib/workos/user_management/revoke_session.rb +22 -0
- data/lib/workos/user_management/send_email_change.rb +18 -0
- data/lib/workos/user_management/send_verification_email_response.rb +7 -0
- data/lib/workos/user_management/session_created.rb +34 -0
- data/lib/workos/user_management/session_created_data.rb +55 -0
- data/lib/workos/user_management/session_created_data_impersonator.rb +7 -0
- data/lib/workos/user_management/session_revoked.rb +34 -0
- data/lib/workos/user_management/session_revoked_data.rb +55 -0
- data/lib/workos/user_management/session_revoked_data_impersonator.rb +7 -0
- data/lib/workos/user_management/sso_device_authorization_request.rb +18 -0
- data/lib/workos/user_management/update_jwt_template.rb +18 -0
- data/lib/workos/user_management/update_user.rb +46 -0
- data/lib/workos/user_management/update_user_organization_membership.rb +22 -0
- data/lib/workos/user_management/user.rb +7 -0
- data/lib/workos/user_management/user_created.rb +34 -0
- data/lib/workos/user_management/user_deleted.rb +34 -0
- data/lib/workos/user_management/user_identities_get_item.rb +25 -0
- data/lib/workos/user_management/user_invite.rb +61 -0
- data/lib/workos/user_management/user_organization_membership.rb +49 -0
- data/lib/workos/user_management/user_sessions_impersonator.rb +7 -0
- data/lib/workos/user_management/user_sessions_list_item.rb +55 -0
- data/lib/workos/user_management/user_updated.rb +34 -0
- data/lib/workos/user_management/verify_email_address.rb +7 -0
- data/lib/workos/user_management/verify_email_response.rb +7 -0
- data/lib/workos/user_management.rb +1514 -1170
- data/lib/workos/user_management_organization_membership_groups.rb +60 -0
- data/lib/workos/util/signature.rb +55 -0
- data/lib/workos/util.rb +16 -0
- data/lib/workos/vault/vault_byok_key_verification_completed.rb +34 -0
- data/lib/workos/vault/vault_byok_key_verification_completed_data.rb +25 -0
- data/lib/workos/vault/vault_data_created.rb +34 -0
- data/lib/workos/vault/vault_data_created_data.rb +34 -0
- data/lib/workos/vault/vault_data_deleted.rb +34 -0
- data/lib/workos/vault/vault_data_deleted_data.rb +28 -0
- data/lib/workos/vault/vault_data_read.rb +34 -0
- data/lib/workos/vault/vault_data_read_data.rb +31 -0
- data/lib/workos/vault/vault_data_updated.rb +34 -0
- data/lib/workos/vault/vault_data_updated_data.rb +34 -0
- data/lib/workos/vault/vault_dek_decrypted.rb +34 -0
- data/lib/workos/vault/vault_dek_decrypted_data.rb +28 -0
- data/lib/workos/vault/vault_dek_read.rb +34 -0
- data/lib/workos/vault/vault_dek_read_data.rb +31 -0
- data/lib/workos/vault/vault_kek_created.rb +34 -0
- data/lib/workos/vault/vault_kek_created_data.rb +31 -0
- data/lib/workos/vault/vault_metadata_read.rb +34 -0
- data/lib/workos/vault/vault_metadata_read_data.rb +28 -0
- data/lib/workos/vault/vault_names_listed.rb +34 -0
- data/lib/workos/vault/vault_names_listed_data.rb +25 -0
- data/lib/workos/vault.rb +241 -0
- data/lib/workos/version.rb +2 -1
- data/lib/workos/webhook_event.rb +120 -0
- data/lib/workos/webhooks/create_webhook_endpoint.rb +22 -0
- data/lib/workos/webhooks/update_webhook_endpoint.rb +25 -0
- data/lib/workos/webhooks/webhook_endpoint.rb +45 -0
- data/lib/workos/webhooks/webhook_endpoint_json.rb +40 -0
- data/lib/workos/webhooks.rb +213 -159
- data/lib/workos/widgets/widget_session_token.rb +25 -0
- data/lib/workos/widgets/widget_session_token_response.rb +18 -0
- data/lib/workos/widgets.rb +34 -38
- data/lib/workos.rb +34 -96
- data/rbi/workos/action_authentication_denied.rbi +54 -0
- data/rbi/workos/action_authentication_denied_data.rbi +72 -0
- data/rbi/workos/action_user_registration_denied.rbi +54 -0
- data/rbi/workos/action_user_registration_denied_data.rbi +66 -0
- data/rbi/workos/actions.rbi +48 -0
- data/rbi/workos/add_role_permission.rbi +24 -0
- data/rbi/workos/admin_portal.rbi +26 -0
- data/rbi/workos/api_key.rbi +72 -0
- data/rbi/workos/api_key_created.rbi +54 -0
- data/rbi/workos/api_key_created_data.rbi +72 -0
- data/rbi/workos/api_key_created_data_owner.rbi +30 -0
- data/rbi/workos/api_key_owner.rbi +30 -0
- data/rbi/workos/api_key_revoked.rbi +54 -0
- data/rbi/workos/api_key_revoked_data.rbi +72 -0
- data/rbi/workos/api_key_revoked_data_owner.rbi +30 -0
- data/rbi/workos/api_key_validation_response.rbi +24 -0
- data/rbi/workos/api_key_with_value.rbi +78 -0
- data/rbi/workos/api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/api_keys.rbi +51 -0
- data/rbi/workos/application_credentials_list_item.rbi +54 -0
- data/rbi/workos/assign_role.rbi +42 -0
- data/rbi/workos/audit_log_action.rbi +47 -0
- data/rbi/workos/audit_log_action_json.rbi +48 -0
- data/rbi/workos/audit_log_configuration.rbi +42 -0
- data/rbi/workos/audit_log_configuration_log_stream.rbi +48 -0
- data/rbi/workos/audit_log_event.rbi +60 -0
- data/rbi/workos/audit_log_event_actor.rbi +42 -0
- data/rbi/workos/audit_log_event_context.rbi +30 -0
- data/rbi/workos/audit_log_event_create_response.rbi +24 -0
- data/rbi/workos/audit_log_event_ingestion.rbi +30 -0
- data/rbi/workos/audit_log_event_target.rbi +42 -0
- data/rbi/workos/audit_log_export.rbi +53 -0
- data/rbi/workos/audit_log_export_creation.rbi +66 -0
- data/rbi/workos/audit_log_export_json.rbi +54 -0
- data/rbi/workos/audit_log_schema.rbi +36 -0
- data/rbi/workos/audit_log_schema_actor.rbi +24 -0
- data/rbi/workos/audit_log_schema_json.rbi +54 -0
- data/rbi/workos/audit_log_schema_json_actor.rbi +24 -0
- data/rbi/workos/audit_log_schema_json_target.rbi +30 -0
- data/rbi/workos/audit_log_schema_target.rbi +30 -0
- data/rbi/workos/audit_logs.rbi +96 -0
- data/rbi/workos/audit_logs_retention.rbi +23 -0
- data/rbi/workos/audit_logs_retention_json.rbi +24 -0
- data/rbi/workos/authenticate_response.rbi +66 -0
- data/rbi/workos/authenticate_response_impersonator.rbi +30 -0
- data/rbi/workos/authenticate_response_oauth_token.rbi +48 -0
- data/rbi/workos/authentication_challenge.rbi +60 -0
- data/rbi/workos/authentication_challenge_verify_response.rbi +30 -0
- data/rbi/workos/authentication_challenges_verify_request.rbi +24 -0
- data/rbi/workos/authentication_email_verification_failed.rbi +54 -0
- data/rbi/workos/authentication_email_verification_failed_data.rbi +60 -0
- data/rbi/workos/authentication_email_verification_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_email_verification_succeeded.rbi +54 -0
- data/rbi/workos/authentication_email_verification_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_factor.rbi +66 -0
- data/rbi/workos/authentication_factor_enrolled.rbi +66 -0
- data/rbi/workos/authentication_factor_enrolled_sms.rbi +24 -0
- data/rbi/workos/authentication_factor_enrolled_totp.rbi +48 -0
- data/rbi/workos/authentication_factor_sms.rbi +24 -0
- data/rbi/workos/authentication_factor_totp.rbi +30 -0
- data/rbi/workos/authentication_factors_create_request.rbi +48 -0
- data/rbi/workos/authentication_magic_auth_failed.rbi +54 -0
- data/rbi/workos/authentication_magic_auth_failed_data.rbi +60 -0
- data/rbi/workos/authentication_magic_auth_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_magic_auth_succeeded.rbi +54 -0
- data/rbi/workos/authentication_magic_auth_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_mfa_failed.rbi +54 -0
- data/rbi/workos/authentication_mfa_failed_data.rbi +60 -0
- data/rbi/workos/authentication_mfa_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_mfa_succeeded.rbi +54 -0
- data/rbi/workos/authentication_mfa_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_oauth_failed.rbi +54 -0
- data/rbi/workos/authentication_oauth_failed_data.rbi +60 -0
- data/rbi/workos/authentication_oauth_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_oauth_succeeded.rbi +54 -0
- data/rbi/workos/authentication_oauth_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_passkey_failed.rbi +54 -0
- data/rbi/workos/authentication_passkey_failed_data.rbi +60 -0
- data/rbi/workos/authentication_passkey_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_passkey_succeeded.rbi +54 -0
- data/rbi/workos/authentication_passkey_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_password_failed.rbi +54 -0
- data/rbi/workos/authentication_password_failed_data.rbi +60 -0
- data/rbi/workos/authentication_password_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_password_succeeded.rbi +54 -0
- data/rbi/workos/authentication_password_succeeded_data.rbi +54 -0
- data/rbi/workos/authentication_radar_risk_detected.rbi +54 -0
- data/rbi/workos/authentication_radar_risk_detected_data.rbi +66 -0
- data/rbi/workos/authentication_sso_failed.rbi +54 -0
- data/rbi/workos/authentication_sso_failed_data.rbi +66 -0
- data/rbi/workos/authentication_sso_failed_data_error.rbi +30 -0
- data/rbi/workos/authentication_sso_failed_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_started.rbi +54 -0
- data/rbi/workos/authentication_sso_started_data.rbi +60 -0
- data/rbi/workos/authentication_sso_started_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_succeeded.rbi +54 -0
- data/rbi/workos/authentication_sso_succeeded_data.rbi +60 -0
- data/rbi/workos/authentication_sso_succeeded_data_sso.rbi +36 -0
- data/rbi/workos/authentication_sso_timed_out.rbi +54 -0
- data/rbi/workos/authentication_sso_timed_out_data.rbi +66 -0
- data/rbi/workos/authentication_sso_timed_out_data_error.rbi +30 -0
- data/rbi/workos/authentication_sso_timed_out_data_sso.rbi +36 -0
- data/rbi/workos/authorization.rbi +415 -0
- data/rbi/workos/authorization_check.rbi +24 -0
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/authorization_permission.rbi +72 -0
- data/rbi/workos/authorization_resource.rbi +78 -0
- data/rbi/workos/authorized_connect_application_list_data.rbi +48 -0
- data/rbi/workos/base_client.rbi +132 -0
- data/rbi/workos/challenge_authentication_factor.rbi +24 -0
- data/rbi/workos/check_authorization.rbi +42 -0
- data/rbi/workos/client.rbi +67 -0
- data/rbi/workos/configuration.rbi +68 -0
- data/rbi/workos/confirm_email_change.rbi +24 -0
- data/rbi/workos/connect.rbi +102 -0
- data/rbi/workos/connect_application.rbi +78 -0
- data/rbi/workos/connected_account.rbi +66 -0
- data/rbi/workos/connection.rbi +84 -0
- data/rbi/workos/connection_activated.rbi +54 -0
- data/rbi/workos/connection_activated_data.rbi +84 -0
- data/rbi/workos/connection_activated_data_domain.rbi +36 -0
- data/rbi/workos/connection_deactivated.rbi +54 -0
- data/rbi/workos/connection_deactivated_data.rbi +84 -0
- data/rbi/workos/connection_deactivated_data_domain.rbi +36 -0
- data/rbi/workos/connection_deleted.rbi +54 -0
- data/rbi/workos/connection_deleted_data.rbi +66 -0
- data/rbi/workos/connection_domain.rbi +36 -0
- data/rbi/workos/connection_option.rbi +24 -0
- data/rbi/workos/connection_saml_certificate_renewal_required.rbi +54 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi +30 -0
- data/rbi/workos/connection_saml_certificate_renewed.rbi +54 -0
- data/rbi/workos/connection_saml_certificate_renewed_data.rbi +36 -0
- data/rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi +30 -0
- data/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi +30 -0
- data/rbi/workos/cors_origin_response.rbi +48 -0
- data/rbi/workos/create_application_secret.rbi +18 -0
- data/rbi/workos/create_authorization_permission.rbi +42 -0
- data/rbi/workos/create_authorization_resource.rbi +66 -0
- data/rbi/workos/create_cors_origin.rbi +24 -0
- data/rbi/workos/create_group.rbi +30 -0
- data/rbi/workos/create_group_membership.rbi +24 -0
- data/rbi/workos/create_m2m_application.rbi +48 -0
- data/rbi/workos/create_magic_code_and_return.rbi +30 -0
- data/rbi/workos/create_oauth_application.rbi +66 -0
- data/rbi/workos/create_organization_api_key.rbi +30 -0
- data/rbi/workos/create_organization_domain.rbi +30 -0
- data/rbi/workos/create_organization_role.rbi +42 -0
- data/rbi/workos/create_password_reset.rbi +30 -0
- data/rbi/workos/create_password_reset_token.rbi +24 -0
- data/rbi/workos/create_redirect_uri.rbi +24 -0
- data/rbi/workos/create_role.rbi +42 -0
- data/rbi/workos/create_user.rbi +72 -0
- data/rbi/workos/create_user_invite_options.rbi +54 -0
- data/rbi/workos/create_user_organization_membership.rbi +42 -0
- data/rbi/workos/create_webhook_endpoint.rbi +30 -0
- data/rbi/workos/data_integration_access_token_response.rbi +36 -0
- data/rbi/workos/data_integration_access_token_response_access_token.rbi +48 -0
- data/rbi/workos/data_integration_authorize_url_response.rbi +24 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +36 -0
- data/rbi/workos/data_integrations_get_user_token_request.rbi +30 -0
- data/rbi/workos/data_integrations_list_response.rbi +30 -0
- data/rbi/workos/data_integrations_list_response_data.rbi +90 -0
- data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +72 -0
- data/rbi/workos/device_authorization_response.rbi +54 -0
- data/rbi/workos/device_code_session_authenticate_request.rbi +54 -0
- data/rbi/workos/directory.rbi +84 -0
- data/rbi/workos/directory_group.rbi +72 -0
- data/rbi/workos/directory_metadata.rbi +30 -0
- data/rbi/workos/directory_metadata_user.rbi +30 -0
- data/rbi/workos/directory_sync.rbi +85 -0
- data/rbi/workos/directory_user.rbi +126 -0
- data/rbi/workos/directory_user_email.rbi +36 -0
- data/rbi/workos/directory_user_with_groups.rbi +132 -0
- data/rbi/workos/directory_user_with_groups_email.rbi +36 -0
- data/rbi/workos/domain_verification_intent_options.rbi +24 -0
- data/rbi/workos/dsync_activated.rbi +54 -0
- data/rbi/workos/dsync_activated_data.rbi +78 -0
- data/rbi/workos/dsync_activated_data_domain.rbi +36 -0
- data/rbi/workos/dsync_deactivated.rbi +54 -0
- data/rbi/workos/dsync_deactivated_data.rbi +78 -0
- data/rbi/workos/dsync_deactivated_data_domain.rbi +36 -0
- data/rbi/workos/dsync_deleted.rbi +54 -0
- data/rbi/workos/dsync_deleted_data.rbi +66 -0
- data/rbi/workos/dsync_group_created.rbi +54 -0
- data/rbi/workos/dsync_group_deleted.rbi +54 -0
- data/rbi/workos/dsync_group_updated.rbi +54 -0
- data/rbi/workos/dsync_group_updated_data.rbi +78 -0
- data/rbi/workos/dsync_group_user_added.rbi +54 -0
- data/rbi/workos/dsync_group_user_added_data.rbi +36 -0
- data/rbi/workos/dsync_group_user_removed.rbi +54 -0
- data/rbi/workos/dsync_group_user_removed_data.rbi +36 -0
- data/rbi/workos/dsync_user_created.rbi +54 -0
- data/rbi/workos/dsync_user_deleted.rbi +54 -0
- data/rbi/workos/dsync_user_updated.rbi +54 -0
- data/rbi/workos/dsync_user_updated_data.rbi +132 -0
- data/rbi/workos/dsync_user_updated_data_email.rbi +36 -0
- data/rbi/workos/email_change.rbi +48 -0
- data/rbi/workos/email_change_confirmation.rbi +30 -0
- data/rbi/workos/email_change_confirmation_user.rbi +96 -0
- data/rbi/workos/email_verification.rbi +66 -0
- data/rbi/workos/email_verification_code_session_authenticate_request.rbi +66 -0
- data/rbi/workos/email_verification_created.rbi +54 -0
- data/rbi/workos/email_verification_created_data.rbi +60 -0
- data/rbi/workos/encryptors/aes_gcm.rbi +19 -0
- data/rbi/workos/enroll_user_authentication_factor.rbi +42 -0
- data/rbi/workos/errors.rbi +43 -0
- data/rbi/workos/event_context.rbi +54 -0
- data/rbi/workos/event_context_actor.rbi +36 -0
- data/rbi/workos/event_context_google_analytics_session.rbi +36 -0
- data/rbi/workos/event_list_list_metadata.rbi +24 -0
- data/rbi/workos/event_schema.rbi +54 -0
- data/rbi/workos/events.rbi +28 -0
- data/rbi/workos/external_auth_complete_response.rbi +24 -0
- data/rbi/workos/feature_flag.rbi +84 -0
- data/rbi/workos/feature_flag_owner.rbi +36 -0
- data/rbi/workos/feature_flags.rbi +90 -0
- data/rbi/workos/flag.rbi +84 -0
- data/rbi/workos/flag_created.rbi +54 -0
- data/rbi/workos/flag_created_context.rbi +30 -0
- data/rbi/workos/flag_created_context_actor.rbi +36 -0
- data/rbi/workos/flag_created_data.rbi +90 -0
- data/rbi/workos/flag_created_data_owner.rbi +36 -0
- data/rbi/workos/flag_deleted.rbi +54 -0
- data/rbi/workos/flag_deleted_context.rbi +30 -0
- data/rbi/workos/flag_deleted_context_actor.rbi +36 -0
- data/rbi/workos/flag_deleted_data.rbi +90 -0
- data/rbi/workos/flag_deleted_data_owner.rbi +36 -0
- data/rbi/workos/flag_owner.rbi +36 -0
- data/rbi/workos/flag_rule_updated.rbi +54 -0
- data/rbi/workos/flag_rule_updated_context.rbi +48 -0
- data/rbi/workos/flag_rule_updated_context_actor.rbi +36 -0
- data/rbi/workos/flag_rule_updated_context_configured_target.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_configured_target_user.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi +30 -0
- data/rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi +30 -0
- data/rbi/workos/flag_rule_updated_data.rbi +90 -0
- data/rbi/workos/flag_rule_updated_data_owner.rbi +36 -0
- data/rbi/workos/flag_updated.rbi +54 -0
- data/rbi/workos/flag_updated_context.rbi +36 -0
- data/rbi/workos/flag_updated_context_actor.rbi +36 -0
- data/rbi/workos/flag_updated_context_previous_attribute.rbi +24 -0
- data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +48 -0
- data/rbi/workos/flag_updated_data.rbi +90 -0
- data/rbi/workos/flag_updated_data_owner.rbi +36 -0
- data/rbi/workos/generate_link.rbi +54 -0
- data/rbi/workos/group.rbi +60 -0
- data/rbi/workos/group_created.rbi +54 -0
- data/rbi/workos/group_deleted.rbi +54 -0
- data/rbi/workos/group_member_added.rbi +54 -0
- data/rbi/workos/group_member_added_data.rbi +30 -0
- data/rbi/workos/group_member_removed.rbi +54 -0
- data/rbi/workos/group_member_removed_data.rbi +30 -0
- data/rbi/workos/group_updated.rbi +54 -0
- data/rbi/workos/groups.rbi +97 -0
- data/rbi/workos/hash_provider.rbi +18 -0
- data/rbi/workos/intent_options.rbi +30 -0
- data/rbi/workos/invitation.rbi +108 -0
- data/rbi/workos/invitation_accepted.rbi +54 -0
- data/rbi/workos/invitation_accepted_data.rbi +96 -0
- data/rbi/workos/invitation_created.rbi +54 -0
- data/rbi/workos/invitation_created_data.rbi +96 -0
- data/rbi/workos/invitation_resent.rbi +54 -0
- data/rbi/workos/invitation_resent_data.rbi +96 -0
- data/rbi/workos/invitation_revoked.rbi +54 -0
- data/rbi/workos/invitation_revoked_data.rbi +96 -0
- data/rbi/workos/jwks_response.rbi +24 -0
- data/rbi/workos/jwks_response_keys.rbi +66 -0
- data/rbi/workos/jwt_template_response.rbi +42 -0
- data/rbi/workos/magic_auth.rbi +66 -0
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/magic_auth_created.rbi +54 -0
- data/rbi/workos/magic_auth_created_data.rbi +60 -0
- data/rbi/workos/mfa_totp_session_authenticate_request.rbi +72 -0
- data/rbi/workos/multi_factor_auth.rbi +83 -0
- data/rbi/workos/new_connect_application_secret.rbi +60 -0
- data/rbi/workos/organization.rbi +78 -0
- data/rbi/workos/organization_created.rbi +54 -0
- data/rbi/workos/organization_created_data.rbi +72 -0
- data/rbi/workos/organization_created_data_domain.rbi +78 -0
- data/rbi/workos/organization_deleted.rbi +54 -0
- data/rbi/workos/organization_deleted_data.rbi +72 -0
- data/rbi/workos/organization_deleted_data_domain.rbi +78 -0
- data/rbi/workos/organization_domain.rbi +78 -0
- data/rbi/workos/organization_domain_created.rbi +54 -0
- data/rbi/workos/organization_domain_created_data.rbi +78 -0
- data/rbi/workos/organization_domain_data.rbi +30 -0
- data/rbi/workos/organization_domain_deleted.rbi +54 -0
- data/rbi/workos/organization_domain_deleted_data.rbi +78 -0
- data/rbi/workos/organization_domain_stand_alone.rbi +78 -0
- data/rbi/workos/organization_domain_updated.rbi +54 -0
- data/rbi/workos/organization_domain_updated_data.rbi +78 -0
- data/rbi/workos/organization_domain_verification_failed.rbi +54 -0
- data/rbi/workos/organization_domain_verification_failed_data.rbi +30 -0
- data/rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi +78 -0
- data/rbi/workos/organization_domain_verified.rbi +54 -0
- data/rbi/workos/organization_domain_verified_data.rbi +78 -0
- data/rbi/workos/organization_domains.rbi +46 -0
- data/rbi/workos/organization_input.rbi +54 -0
- data/rbi/workos/organization_membership.rbi +84 -0
- data/rbi/workos/organization_membership_created.rbi +54 -0
- data/rbi/workos/organization_membership_created_data.rbi +84 -0
- data/rbi/workos/organization_membership_deleted.rbi +54 -0
- data/rbi/workos/organization_membership_deleted_data.rbi +84 -0
- data/rbi/workos/organization_membership_updated.rbi +54 -0
- data/rbi/workos/organization_membership_updated_data.rbi +84 -0
- data/rbi/workos/organization_role_created.rbi +54 -0
- data/rbi/workos/organization_role_created_data.rbi +72 -0
- data/rbi/workos/organization_role_deleted.rbi +54 -0
- data/rbi/workos/organization_role_deleted_data.rbi +72 -0
- data/rbi/workos/organization_role_updated.rbi +54 -0
- data/rbi/workos/organization_role_updated_data.rbi +72 -0
- data/rbi/workos/organization_selection_session_authenticate_request.rbi +66 -0
- data/rbi/workos/organization_updated.rbi +54 -0
- data/rbi/workos/organization_updated_data.rbi +72 -0
- data/rbi/workos/organization_updated_data_domain.rbi +78 -0
- data/rbi/workos/organizations.rbi +86 -0
- data/rbi/workos/password_reset.rbi +66 -0
- data/rbi/workos/password_reset_created.rbi +54 -0
- data/rbi/workos/password_reset_created_data.rbi +54 -0
- data/rbi/workos/password_reset_succeeded.rbi +54 -0
- data/rbi/workos/password_reset_succeeded_data.rbi +54 -0
- data/rbi/workos/password_session_authenticate_request.rbi +72 -0
- data/rbi/workos/passwordless.rbi +47 -0
- data/rbi/workos/permission.rbi +72 -0
- data/rbi/workos/permission_created.rbi +54 -0
- data/rbi/workos/permission_created_data.rbi +66 -0
- data/rbi/workos/permission_deleted.rbi +54 -0
- data/rbi/workos/permission_deleted_data.rbi +66 -0
- data/rbi/workos/permission_updated.rbi +54 -0
- data/rbi/workos/permission_updated_data.rbi +66 -0
- data/rbi/workos/pipes.rbi +63 -0
- data/rbi/workos/portal_link_response.rbi +24 -0
- data/rbi/workos/profile.rbi +102 -0
- data/rbi/workos/public_client.rbi +12 -0
- data/rbi/workos/radar.rbi +57 -0
- data/rbi/workos/radar_list_entry_already_present_response.rbi +24 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +60 -0
- data/rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi +24 -0
- data/rbi/workos/radar_standalone_response.rbi +48 -0
- data/rbi/workos/radar_standalone_update_radar_attempt_request.rbi +30 -0
- data/rbi/workos/radar_standalone_update_radar_list_request.rbi +24 -0
- data/rbi/workos/redirect_uri.rbi +54 -0
- data/rbi/workos/redirect_uri_input.rbi +30 -0
- data/rbi/workos/refresh_token_session_authenticate_request.rbi +66 -0
- data/rbi/workos/remove_role.rbi +42 -0
- data/rbi/workos/resend_user_invite_options.rbi +24 -0
- data/rbi/workos/reset_password_response.rbi +24 -0
- data/rbi/workos/revoke_session.rbi +30 -0
- data/rbi/workos/role.rbi +78 -0
- data/rbi/workos/role_assignment.rbi +54 -0
- data/rbi/workos/role_assignment_resource.rbi +36 -0
- data/rbi/workos/role_created.rbi +54 -0
- data/rbi/workos/role_created_data.rbi +54 -0
- data/rbi/workos/role_deleted.rbi +54 -0
- data/rbi/workos/role_deleted_data.rbi +54 -0
- data/rbi/workos/role_list.rbi +30 -0
- data/rbi/workos/role_updated.rbi +54 -0
- data/rbi/workos/role_updated_data.rbi +54 -0
- data/rbi/workos/send_email_change.rbi +24 -0
- data/rbi/workos/send_verification_email_response.rbi +24 -0
- data/rbi/workos/session.rbi +43 -0
- data/rbi/workos/session_created.rbi +54 -0
- data/rbi/workos/session_created_data.rbi +96 -0
- data/rbi/workos/session_created_data_impersonator.rbi +30 -0
- data/rbi/workos/session_manager.rbi +154 -0
- data/rbi/workos/session_revoked.rbi +54 -0
- data/rbi/workos/session_revoked_data.rbi +96 -0
- data/rbi/workos/session_revoked_data_impersonator.rbi +30 -0
- data/rbi/workos/set_role_permissions.rbi +24 -0
- data/rbi/workos/slim_role.rbi +24 -0
- data/rbi/workos/sso.rbi +67 -0
- data/rbi/workos/sso_authorize_url_response.rbi +24 -0
- data/rbi/workos/sso_device_authorization_request.rbi +24 -0
- data/rbi/workos/sso_intent_options.rbi +30 -0
- data/rbi/workos/sso_logout_authorize_request.rbi +24 -0
- data/rbi/workos/sso_logout_authorize_response.rbi +30 -0
- data/rbi/workos/sso_token_response.rbi +48 -0
- data/rbi/workos/sso_token_response_oauth_token.rbi +48 -0
- data/rbi/workos/token_query.rbi +42 -0
- data/rbi/workos/types/api_response.rbi +29 -0
- data/rbi/workos/types/base_model.rbi +22 -0
- data/rbi/workos/types/list_struct.rbi +89 -0
- data/rbi/workos/types/request_options.rbi +12 -0
- data/rbi/workos/update_audit_logs_retention.rbi +24 -0
- data/rbi/workos/update_authorization_permission.rbi +30 -0
- data/rbi/workos/update_authorization_resource.rbi +48 -0
- data/rbi/workos/update_group.rbi +30 -0
- data/rbi/workos/update_jwt_template.rbi +24 -0
- data/rbi/workos/update_oauth_application.rbi +42 -0
- data/rbi/workos/update_organization.rbi +60 -0
- data/rbi/workos/update_organization_role.rbi +30 -0
- data/rbi/workos/update_role.rbi +30 -0
- data/rbi/workos/update_user.rbi +78 -0
- data/rbi/workos/update_user_organization_membership.rbi +30 -0
- data/rbi/workos/update_webhook_endpoint.rbi +36 -0
- data/rbi/workos/user.rbi +96 -0
- data/rbi/workos/user_authentication_factor_enroll_response.rbi +30 -0
- data/rbi/workos/user_consent_option.rbi +42 -0
- data/rbi/workos/user_consent_option_choice.rbi +30 -0
- data/rbi/workos/user_created.rbi +54 -0
- data/rbi/workos/user_deleted.rbi +54 -0
- data/rbi/workos/user_identities_get_item.rbi +36 -0
- data/rbi/workos/user_invite.rbi +108 -0
- data/rbi/workos/user_management.rbi +410 -0
- data/rbi/workos/user_management_login_request.rbi +36 -0
- data/rbi/workos/user_management_organization_membership_groups.rbi +25 -0
- data/rbi/workos/user_object.rbi +48 -0
- data/rbi/workos/user_organization_membership.rbi +84 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +78 -0
- data/rbi/workos/user_sessions_impersonator.rbi +30 -0
- data/rbi/workos/user_sessions_list_item.rbi +96 -0
- data/rbi/workos/user_updated.rbi +54 -0
- data/rbi/workos/util.rbi +12 -0
- data/rbi/workos/validate_api_key.rbi +24 -0
- data/rbi/workos/vault.rbi +137 -0
- data/rbi/workos/vault_byok_key_verification_completed.rbi +54 -0
- data/rbi/workos/vault_byok_key_verification_completed_data.rbi +36 -0
- data/rbi/workos/vault_data_created.rbi +54 -0
- data/rbi/workos/vault_data_created_data.rbi +54 -0
- data/rbi/workos/vault_data_deleted.rbi +54 -0
- data/rbi/workos/vault_data_deleted_data.rbi +42 -0
- data/rbi/workos/vault_data_read.rbi +54 -0
- data/rbi/workos/vault_data_read_data.rbi +48 -0
- data/rbi/workos/vault_data_updated.rbi +54 -0
- data/rbi/workos/vault_data_updated_data.rbi +54 -0
- data/rbi/workos/vault_dek_decrypted.rbi +54 -0
- data/rbi/workos/vault_dek_decrypted_data.rbi +42 -0
- data/rbi/workos/vault_dek_read.rbi +54 -0
- data/rbi/workos/vault_dek_read_data.rbi +48 -0
- data/rbi/workos/vault_kek_created.rbi +54 -0
- data/rbi/workos/vault_kek_created_data.rbi +48 -0
- data/rbi/workos/vault_metadata_read.rbi +54 -0
- data/rbi/workos/vault_metadata_read_data.rbi +42 -0
- data/rbi/workos/vault_names_listed.rbi +54 -0
- data/rbi/workos/vault_names_listed_data.rbi +36 -0
- data/rbi/workos/verify_email_address.rbi +24 -0
- data/rbi/workos/verify_email_response.rbi +24 -0
- data/rbi/workos/waitlist_user.rbi +60 -0
- data/rbi/workos/waitlist_user_approved.rbi +54 -0
- data/rbi/workos/waitlist_user_created.rbi +54 -0
- data/rbi/workos/waitlist_user_denied.rbi +54 -0
- data/rbi/workos/webhook_endpoint.rbi +65 -0
- data/rbi/workos/webhook_endpoint_json.rbi +66 -0
- data/rbi/workos/webhooks.rbi +52 -0
- data/rbi/workos/widget_session_token.rbi +36 -0
- data/rbi/workos/widget_session_token_response.rbi +24 -0
- data/rbi/workos/widgets.rbi +23 -0
- data/renovate.json +34 -0
- data/script/ci +16 -0
- data/test/test_helper.rb +20 -0
- data/test/workos/test_actions.rb +78 -0
- data/test/workos/test_admin_portal.rb +33 -0
- data/test/workos/test_api_keys.rb +57 -0
- data/test/workos/test_audit_logs.rb +89 -0
- data/test/workos/test_authkit_helpers.rb +109 -0
- data/test/workos/test_authorization.rb +321 -0
- data/test/workos/test_base_client.rb +173 -0
- data/test/workos/test_connect.rb +127 -0
- data/test/workos/test_directory_sync.rb +81 -0
- data/test/workos/test_encryptors_aes_gcm.rb +54 -0
- data/test/workos/test_events.rb +33 -0
- data/test/workos/test_feature_flags.rb +89 -0
- data/test/workos/test_groups.rb +89 -0
- data/test/workos/test_list_struct.rb +39 -0
- data/test/workos/test_model_round_trip.rb +7142 -0
- data/test/workos/test_multi_factor_auth.rb +81 -0
- data/test/workos/test_organization_domains.rb +57 -0
- data/test/workos/test_organizations.rb +81 -0
- data/test/workos/test_passwordless.rb +59 -0
- data/test/workos/test_pipes.rb +65 -0
- data/test/workos/test_pkce.rb +40 -0
- data/test/workos/test_public_client.rb +38 -0
- data/test/workos/test_radar.rb +57 -0
- data/test/workos/test_session.rb +261 -0
- data/test/workos/test_sso.rb +73 -0
- data/test/workos/test_sso_helpers.rb +80 -0
- data/test/workos/test_sso_runtime.rb +45 -0
- data/test/workos/test_user_management.rb +473 -0
- data/test/workos/test_user_management_organization_membership_groups.rb +33 -0
- data/test/workos/test_vault.rb +151 -0
- data/test/workos/test_webhook_verify.rb +84 -0
- data/test/workos/test_webhooks.rb +57 -0
- data/test/workos/test_widgets.rb +33 -0
- data/workos.gemspec +22 -21
- metadata +1117 -508
- data/.rspec +0 -1
- data/.rubocop.yml +0 -34
- data/.rubocop_todo.yml +0 -94
- data/lib/workos/audit_log_export.rb +0 -32
- data/lib/workos/authentication_factor_and_challenge.rb +0 -28
- data/lib/workos/authentication_response.rb +0 -62
- data/lib/workos/cache.rb +0 -94
- data/lib/workos/challenge.rb +0 -36
- data/lib/workos/connection.rb +0 -42
- data/lib/workos/deprecated_hash_wrapper.rb +0 -76
- data/lib/workos/deprecation.rb +0 -16
- data/lib/workos/directory.rb +0 -38
- data/lib/workos/directory_group.rb +0 -41
- data/lib/workos/directory_user.rb +0 -93
- data/lib/workos/email_verification.rb +0 -37
- data/lib/workos/event.rb +0 -30
- data/lib/workos/factor.rb +0 -35
- data/lib/workos/feature_flag.rb +0 -34
- data/lib/workos/impersonator.rb +0 -23
- data/lib/workos/invitation.rb +0 -49
- data/lib/workos/magic_auth.rb +0 -37
- data/lib/workos/mfa.rb +0 -136
- data/lib/workos/oauth_tokens.rb +0 -29
- data/lib/workos/organization.rb +0 -47
- data/lib/workos/organization_membership.rb +0 -43
- data/lib/workos/password_reset.rb +0 -37
- data/lib/workos/portal.rb +0 -54
- data/lib/workos/profile.rb +0 -57
- data/lib/workos/profile_and_token.rb +0 -26
- data/lib/workos/refresh_authentication_response.rb +0 -51
- data/lib/workos/role.rb +0 -38
- data/lib/workos/types/intent.rb +0 -18
- data/lib/workos/types/passwordless_session_struct.rb +0 -18
- data/lib/workos/types/provider.rb +0 -16
- data/lib/workos/types/widget_scope.rb +0 -15
- data/lib/workos/types.rb +0 -12
- data/lib/workos/user.rb +0 -45
- data/lib/workos/user_and_token.rb +0 -26
- data/lib/workos/user_management/session.rb +0 -57
- data/lib/workos/user_response.rb +0 -22
- data/lib/workos/verify_challenge.rb +0 -25
- data/lib/workos/webhook.rb +0 -30
- data/spec/lib/workos/audit_logs_spec.rb +0 -150
- data/spec/lib/workos/cache_spec.rb +0 -94
- data/spec/lib/workos/client.rb +0 -67
- data/spec/lib/workos/configuration_spec.rb +0 -60
- data/spec/lib/workos/directory_sync_spec.rb +0 -483
- data/spec/lib/workos/directory_user_spec.rb +0 -61
- data/spec/lib/workos/encryptors/aes_gcm_spec.rb +0 -41
- data/spec/lib/workos/event_spec.rb +0 -109
- data/spec/lib/workos/mfa_spec.rb +0 -285
- data/spec/lib/workos/organizations_spec.rb +0 -569
- data/spec/lib/workos/passwordless_spec.rb +0 -76
- data/spec/lib/workos/portal_spec.rb +0 -116
- data/spec/lib/workos/role_spec.rb +0 -142
- data/spec/lib/workos/session_spec.rb +0 -475
- data/spec/lib/workos/sso_spec.rb +0 -756
- data/spec/lib/workos/user_management_spec.rb +0 -1999
- data/spec/lib/workos/webhooks_spec.rb +0 -235
- data/spec/lib/workos/widgets_spec.rb +0 -73
- data/spec/spec_helper.rb +0 -53
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml +0 -59
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml +0 -60
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml +0 -59
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml +0 -65
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml +0 -67
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml +0 -68
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml +0 -131
- data/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml +0 -134
- data/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml +0 -61
- data/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +0 -66
- data/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml +0 -62
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml +0 -62
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +0 -87
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +0 -89
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +0 -93
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +0 -186
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +0 -88
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +0 -194
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +0 -186
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +0 -189
- data/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +0 -75
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_organization_id.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/create.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_domain_data.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_domains.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml +0 -155
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml +0 -154
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_external_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml +0 -79
- data/spec/support/fixtures/vcr_cassettes/organization/create_without_domains.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/organization/delete.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/get.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/organization/list.yml +0 -87
- data/spec/support/fixtures/vcr_cassettes/organization/list_organization_feature_flags.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/organization/update.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_external_id_null.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_with_stripe_customer_id.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml +0 -85
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml +0 -73
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_certificate_renewal.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_domain_verification.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml +0 -70
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml +0 -72
- data/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +0 -90
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +0 -89
- data/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +0 -86
- data/spec/support/fixtures/vcr_cassettes/sso/profile.yml +0 -74
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml +0 -84
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_oauth_tokens.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/invalid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/unverified.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml +0 -81
- data/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/create_user_with_external_id.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml +0 -78
- data/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/find_invitation_by_token/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/invalid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/valid.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/get_user.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/list_sessions/valid.yml +0 -38
- data/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml +0 -64
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/accepted.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/expired.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/revoked.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/resend_invitation/valid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml +0 -80
- data/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/invalid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/locale.yml +0 -76
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_external_id_null.yml +0 -77
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml +0 -83
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token.yml +0 -82
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token_invalid_organization_id.yml +0 -74
- data/spec/support/fixtures/vcr_cassettes/widgets/get_token_invalid_user_id.yml +0 -74
- data/spec/support/profile.txt +0 -1
- data/spec/support/shared_examples/client.rb +0 -29
- data/spec/support/webhook_payload.txt +0 -1
|
@@ -1,1258 +1,1602 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require 'uri'
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
# The UserManagement module provides convenience methods for working with the
|
|
8
|
-
# WorkOS User platform. You'll need a valid API key.
|
|
9
|
-
module UserManagement
|
|
10
|
-
autoload :Session, 'workos/user_management/session'
|
|
11
|
-
|
|
12
|
-
module Types
|
|
13
|
-
# The ProviderEnum is a declaration of a
|
|
14
|
-
# fixed set of values for User Management Providers.
|
|
15
|
-
class Provider
|
|
16
|
-
Apple = 'AppleOAuth'
|
|
17
|
-
GitHub = 'GitHubOAuth'
|
|
18
|
-
Google = 'GoogleOAuth'
|
|
19
|
-
Microsoft = 'MicrosoftOAuth'
|
|
20
|
-
AuthKit = 'authkit'
|
|
21
|
-
|
|
22
|
-
ALL = [Apple, GitHub, Google, Microsoft, AuthKit].freeze
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# The AuthFactorType is a declaration of a
|
|
26
|
-
# fixed set of factor values to enroll
|
|
27
|
-
class AuthFactorType
|
|
28
|
-
Totp = 'totp'
|
|
5
|
+
require "json"
|
|
29
6
|
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
module WorkOS
|
|
8
|
+
class UserManagement
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
32
11
|
end
|
|
33
12
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# @return WorkOS::Session
|
|
48
|
-
def load_sealed_session(client_id:, session_data:, cookie_password:, encryptor: nil)
|
|
49
|
-
WorkOS::Session.new(
|
|
50
|
-
user_management: self,
|
|
51
|
-
client_id: client_id,
|
|
52
|
-
session_data: session_data,
|
|
53
|
-
cookie_password: cookie_password,
|
|
54
|
-
encryptor: encryptor,
|
|
55
|
-
)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# Generate an OAuth 2.0 authorization URL that automatically directs a user
|
|
59
|
-
# to their Identity Provider.
|
|
60
|
-
#
|
|
61
|
-
# @param [String] redirect_uri The URI where users are directed
|
|
62
|
-
# after completing the authentication step. Must match a
|
|
63
|
-
# configured redirect URI on your WorkOS dashboard.
|
|
64
|
-
# @param [String] client_id This value can be obtained from the API Keys page in the WorkOS dashboard.
|
|
65
|
-
# @param [String] provider A provider name is used to initiate SSO using an
|
|
66
|
-
# OAuth-compatible provider. Only 'authkit', 'AppleOAuth', 'GitHubOAuth', 'GoogleOAuth',
|
|
67
|
-
# and 'MicrosoftOAuth' are supported.
|
|
68
|
-
# @param [String] connection_id The ID for a Connection configured on
|
|
69
|
-
# WorkOS.
|
|
70
|
-
# @param [String] organization_id The organization_id selector is used to
|
|
71
|
-
# initiate SSO for an Organization.
|
|
72
|
-
# @param [String] state An arbitrary state object
|
|
73
|
-
# that is preserved and available to the client in the response.
|
|
74
|
-
# @param [String] login_hint Can be used to pre-fill the username/email address
|
|
75
|
-
# field of the IdP sign-in page for the user, if you know their username ahead of time.
|
|
76
|
-
# @param [String] screen_hint Specify which AuthKit screen users should land on upon redirection
|
|
77
|
-
# (Only applicable when provider is 'authkit').
|
|
78
|
-
# @param [String] domain_hint Can be used to pre-fill the domain field when
|
|
79
|
-
# initiating authentication with Microsoft OAuth, or with a GoogleSAML connection type.
|
|
80
|
-
# @param [Array<String>] provider_scopes An array of additional OAuth scopes to request from the provider.
|
|
81
|
-
# @example
|
|
82
|
-
# WorkOS::UserManagement.authorization_url(
|
|
83
|
-
# connection_id: 'conn_123',
|
|
84
|
-
# client_id: 'project_01DG5TGK363GRVXP3ZS40WNGEZ',
|
|
85
|
-
# redirect_uri: 'https://your-app.com/callback',
|
|
86
|
-
# state: {
|
|
87
|
-
# next_page: '/docs'
|
|
88
|
-
# }.to_s
|
|
89
|
-
# )
|
|
90
|
-
#
|
|
91
|
-
# => "https://api.workos.com/user_management/authorize?connection_id=conn_123" \
|
|
92
|
-
# "&client_id=project_01DG5TGK363GRVXP3ZS40WNGEZ" \
|
|
93
|
-
# "&redirect_uri=https%3A%2F%2Fyour-app.com%2Fcallback&" \
|
|
94
|
-
# "response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D"
|
|
95
|
-
#
|
|
96
|
-
# @return [String]
|
|
97
|
-
# rubocop:disable Metrics/ParameterLists
|
|
98
|
-
def authorization_url(
|
|
99
|
-
redirect_uri:,
|
|
100
|
-
client_id: nil,
|
|
101
|
-
domain_hint: nil,
|
|
102
|
-
login_hint: nil,
|
|
103
|
-
screen_hint: nil,
|
|
104
|
-
provider: nil,
|
|
105
|
-
connection_id: nil,
|
|
106
|
-
organization_id: nil,
|
|
107
|
-
state: '',
|
|
108
|
-
provider_scopes: nil
|
|
13
|
+
# Get JWKS
|
|
14
|
+
# @param client_id [String] Identifies the application making the request to the WorkOS server. You can obtain your client ID from the [API Keys](https://dashboard.workos.com/api-keys) page in the dashboard.
|
|
15
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
16
|
+
# @return [WorkOS::JwksResponse]
|
|
17
|
+
def get_jwks(
|
|
18
|
+
client_id:,
|
|
19
|
+
request_options: {}
|
|
20
|
+
)
|
|
21
|
+
response = @client.request(
|
|
22
|
+
method: :get,
|
|
23
|
+
path: "/sso/jwks/#{WorkOS::Util.encode_path(client_id)}",
|
|
24
|
+
auth: true,
|
|
25
|
+
request_options: request_options
|
|
109
26
|
)
|
|
27
|
+
result = WorkOS::JwksResponse.new(response.body)
|
|
28
|
+
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"])
|
|
29
|
+
result
|
|
30
|
+
end
|
|
110
31
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
parsed_response = JSON.parse(response.body)
|
|
175
|
-
|
|
176
|
-
users = parsed_response['data'].map do |user|
|
|
177
|
-
::WorkOS::User.new(user.to_json)
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
WorkOS::Types::ListStruct.new(
|
|
181
|
-
data: users,
|
|
182
|
-
list_metadata: parsed_response['list_metadata'],
|
|
183
|
-
)
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Create a user
|
|
187
|
-
#
|
|
188
|
-
# @param [String] email The email address of the user.
|
|
189
|
-
# @param [String] password The password to set for the user.
|
|
190
|
-
# @param [String] first_name The user's first name.
|
|
191
|
-
# @param [String] last_name The user's last name.
|
|
192
|
-
# @param [Boolean] email_verified Whether the user's email address was previously verified.
|
|
193
|
-
# @param [String] external_id The user's external ID.
|
|
194
|
-
# @param [String] password_hash The user's hashed password.
|
|
195
|
-
# @option [String] password_hash_type The algorithm originally used to hash the password.
|
|
196
|
-
#
|
|
197
|
-
# @return [WorkOS::User]
|
|
198
|
-
# rubocop:disable Metrics/ParameterLists
|
|
199
|
-
def create_user(
|
|
200
|
-
email:,
|
|
201
|
-
password: nil,
|
|
202
|
-
first_name: nil,
|
|
203
|
-
last_name: nil,
|
|
204
|
-
email_verified: nil,
|
|
205
|
-
external_id: nil,
|
|
206
|
-
password_hash: nil,
|
|
207
|
-
password_hash_type: nil
|
|
32
|
+
# Authenticate
|
|
33
|
+
# @param client_id [String] The client ID of the application.
|
|
34
|
+
# @param client_secret [String, nil] The client secret of the application.
|
|
35
|
+
# @param grant_type [String]
|
|
36
|
+
# @param code [String, nil] The authorization code received from the redirect.
|
|
37
|
+
# @param code_verifier [String, nil] The PKCE code verifier used to derive the code challenge passed to the authorization URL.
|
|
38
|
+
# @param invitation_token [String, nil] An invitation token to accept during authentication.
|
|
39
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
40
|
+
# @param device_id [String, nil] A unique identifier for the device.
|
|
41
|
+
# @param user_agent [String, nil] The user agent string from the user's browser.
|
|
42
|
+
# @param email [String, nil] The user's email address.
|
|
43
|
+
# @param password [String, nil] The user's password.
|
|
44
|
+
# @param refresh_token [String, nil] The refresh token to exchange for new tokens.
|
|
45
|
+
# @param organization_id [String, nil] The ID of the organization to scope the session to.
|
|
46
|
+
# @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
|
|
47
|
+
# @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
|
|
48
|
+
# @param device_code [String, nil] The device verification code.
|
|
49
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
50
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
51
|
+
def create_authenticate(
|
|
52
|
+
client_id:,
|
|
53
|
+
grant_type:,
|
|
54
|
+
client_secret: nil,
|
|
55
|
+
code: nil,
|
|
56
|
+
code_verifier: nil,
|
|
57
|
+
invitation_token: nil,
|
|
58
|
+
ip_address: nil,
|
|
59
|
+
device_id: nil,
|
|
60
|
+
user_agent: nil,
|
|
61
|
+
email: nil,
|
|
62
|
+
password: nil,
|
|
63
|
+
refresh_token: nil,
|
|
64
|
+
organization_id: nil,
|
|
65
|
+
pending_authentication_token: nil,
|
|
66
|
+
authentication_challenge_id: nil,
|
|
67
|
+
device_code: nil,
|
|
68
|
+
request_options: {}
|
|
69
|
+
)
|
|
70
|
+
body = {
|
|
71
|
+
"client_id" => client_id,
|
|
72
|
+
"client_secret" => client_secret,
|
|
73
|
+
"grant_type" => grant_type,
|
|
74
|
+
"code" => code,
|
|
75
|
+
"code_verifier" => code_verifier,
|
|
76
|
+
"invitation_token" => invitation_token,
|
|
77
|
+
"ip_address" => ip_address,
|
|
78
|
+
"device_id" => device_id,
|
|
79
|
+
"user_agent" => user_agent,
|
|
80
|
+
"email" => email,
|
|
81
|
+
"password" => password,
|
|
82
|
+
"refresh_token" => refresh_token,
|
|
83
|
+
"organization_id" => organization_id,
|
|
84
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
85
|
+
"authentication_challenge_id" => authentication_challenge_id,
|
|
86
|
+
"device_code" => device_code
|
|
87
|
+
}.compact
|
|
88
|
+
response = @client.request(
|
|
89
|
+
method: :post,
|
|
90
|
+
path: "/user_management/authenticate",
|
|
91
|
+
auth: true,
|
|
92
|
+
body: body,
|
|
93
|
+
request_options: request_options
|
|
208
94
|
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
password: password,
|
|
214
|
-
first_name: first_name,
|
|
215
|
-
last_name: last_name,
|
|
216
|
-
email_verified: email_verified,
|
|
217
|
-
external_id: external_id,
|
|
218
|
-
password_hash: password_hash,
|
|
219
|
-
password_hash_type: password_hash_type,
|
|
220
|
-
}.compact,
|
|
221
|
-
auth: true,
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
response = execute_request(request: request)
|
|
225
|
-
|
|
226
|
-
WorkOS::User.new(response.body)
|
|
227
|
-
end
|
|
95
|
+
result = WorkOS::AuthenticateResponse.new(response.body)
|
|
96
|
+
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"])
|
|
97
|
+
result
|
|
98
|
+
end
|
|
228
99
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
password
|
|
253
|
-
|
|
254
|
-
|
|
100
|
+
# Authenticate with password.
|
|
101
|
+
# @param email [String]
|
|
102
|
+
# @param password [String]
|
|
103
|
+
# @param invitation_token [String, nil]
|
|
104
|
+
# @param ip_address [String, nil]
|
|
105
|
+
# @param device_id [String, nil]
|
|
106
|
+
# @param user_agent [String, nil]
|
|
107
|
+
# @param request_options [Hash] Per-request overrides.
|
|
108
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
109
|
+
def authenticate_with_password(
|
|
110
|
+
email:,
|
|
111
|
+
password:,
|
|
112
|
+
invitation_token: nil,
|
|
113
|
+
ip_address: nil,
|
|
114
|
+
device_id: nil,
|
|
115
|
+
user_agent: nil,
|
|
116
|
+
request_options: {}
|
|
117
|
+
)
|
|
118
|
+
body = {
|
|
119
|
+
"grant_type" => "password",
|
|
120
|
+
"client_id" => @client.client_id,
|
|
121
|
+
"client_secret" => @client.api_key,
|
|
122
|
+
"email" => email,
|
|
123
|
+
"password" => password,
|
|
124
|
+
"invitation_token" => invitation_token,
|
|
125
|
+
"ip_address" => ip_address,
|
|
126
|
+
"device_id" => device_id,
|
|
127
|
+
"user_agent" => user_agent
|
|
128
|
+
}.compact
|
|
129
|
+
response = @client.request(
|
|
130
|
+
method: :post,
|
|
131
|
+
path: "/user_management/authenticate",
|
|
132
|
+
auth: true,
|
|
133
|
+
body: body,
|
|
134
|
+
request_options: request_options
|
|
255
135
|
)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
body: {
|
|
259
|
-
email: email,
|
|
260
|
-
first_name: first_name,
|
|
261
|
-
last_name: last_name,
|
|
262
|
-
email_verified: email_verified,
|
|
263
|
-
external_id: external_id,
|
|
264
|
-
locale: locale,
|
|
265
|
-
password: password,
|
|
266
|
-
password_hash: password_hash,
|
|
267
|
-
password_hash_type: password_hash_type,
|
|
268
|
-
}.reject { |_, v| v == :not_set },
|
|
269
|
-
auth: true,
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
response = execute_request(request: request)
|
|
273
|
-
|
|
274
|
-
WorkOS::User.new(response.body)
|
|
275
|
-
end
|
|
276
|
-
# rubocop:enable Metrics/ParameterLists
|
|
277
|
-
|
|
278
|
-
# Delete a User
|
|
279
|
-
#
|
|
280
|
-
# @param [String] id The unique ID of the User.
|
|
281
|
-
#
|
|
282
|
-
# @return [Bool] - returns `true` if successful
|
|
283
|
-
def delete_user(id:)
|
|
284
|
-
response = execute_request(
|
|
285
|
-
request: delete_request(
|
|
286
|
-
path: "/user_management/users/#{id}",
|
|
287
|
-
auth: true,
|
|
288
|
-
),
|
|
289
|
-
)
|
|
290
|
-
|
|
291
|
-
response.is_a? Net::HTTPSuccess
|
|
292
|
-
end
|
|
136
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
137
|
+
end
|
|
293
138
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
139
|
+
# Authenticate with code.
|
|
140
|
+
# @param code [String]
|
|
141
|
+
# @param code_verifier [String, nil]
|
|
142
|
+
# @param invitation_token [String, nil]
|
|
143
|
+
# @param ip_address [String, nil]
|
|
144
|
+
# @param device_id [String, nil]
|
|
145
|
+
# @param user_agent [String, nil]
|
|
146
|
+
# @param request_options [Hash] Per-request overrides.
|
|
147
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
148
|
+
def authenticate_with_code(
|
|
149
|
+
code:,
|
|
150
|
+
code_verifier: nil,
|
|
151
|
+
invitation_token: nil,
|
|
152
|
+
ip_address: nil,
|
|
153
|
+
device_id: nil,
|
|
154
|
+
user_agent: nil,
|
|
155
|
+
request_options: {}
|
|
156
|
+
)
|
|
157
|
+
body = {
|
|
158
|
+
"grant_type" => "authorization_code",
|
|
159
|
+
"client_id" => @client.client_id,
|
|
160
|
+
"client_secret" => @client.api_key,
|
|
161
|
+
"code" => code,
|
|
162
|
+
"code_verifier" => code_verifier,
|
|
163
|
+
"invitation_token" => invitation_token,
|
|
164
|
+
"ip_address" => ip_address,
|
|
165
|
+
"device_id" => device_id,
|
|
166
|
+
"user_agent" => user_agent
|
|
167
|
+
}.compact
|
|
168
|
+
response = @client.request(
|
|
169
|
+
method: :post,
|
|
170
|
+
path: "/user_management/authenticate",
|
|
171
|
+
auth: true,
|
|
172
|
+
body: body,
|
|
173
|
+
request_options: request_options
|
|
315
174
|
)
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
response = execute_request(
|
|
319
|
-
request: post_request(
|
|
320
|
-
path: '/user_management/authenticate',
|
|
321
|
-
body: {
|
|
322
|
-
client_id: client_id,
|
|
323
|
-
client_secret: WorkOS.config.key!,
|
|
324
|
-
email: email,
|
|
325
|
-
password: password,
|
|
326
|
-
ip_address: ip_address,
|
|
327
|
-
user_agent: user_agent,
|
|
328
|
-
invitation_token: invitation_token,
|
|
329
|
-
grant_type: 'password',
|
|
330
|
-
},
|
|
331
|
-
),
|
|
332
|
-
)
|
|
333
|
-
|
|
334
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
335
|
-
end
|
|
336
|
-
# rubocop:enable Metrics/ParameterLists
|
|
175
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
176
|
+
end
|
|
337
177
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
178
|
+
# Authenticate with refresh token.
|
|
179
|
+
# @param refresh_token [String]
|
|
180
|
+
# @param organization_id [String, nil]
|
|
181
|
+
# @param ip_address [String, nil]
|
|
182
|
+
# @param device_id [String, nil]
|
|
183
|
+
# @param user_agent [String, nil]
|
|
184
|
+
# @param request_options [Hash] Per-request overrides.
|
|
185
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
186
|
+
def authenticate_with_refresh_token(
|
|
187
|
+
refresh_token:,
|
|
188
|
+
organization_id: nil,
|
|
189
|
+
ip_address: nil,
|
|
190
|
+
device_id: nil,
|
|
191
|
+
user_agent: nil,
|
|
192
|
+
request_options: {}
|
|
193
|
+
)
|
|
194
|
+
body = {
|
|
195
|
+
"grant_type" => "refresh_token",
|
|
196
|
+
"client_id" => @client.client_id,
|
|
197
|
+
"client_secret" => @client.api_key,
|
|
198
|
+
"refresh_token" => refresh_token,
|
|
199
|
+
"organization_id" => organization_id,
|
|
200
|
+
"ip_address" => ip_address,
|
|
201
|
+
"device_id" => device_id,
|
|
202
|
+
"user_agent" => user_agent
|
|
203
|
+
}.compact
|
|
204
|
+
response = @client.request(
|
|
205
|
+
method: :post,
|
|
206
|
+
path: "/user_management/authenticate",
|
|
207
|
+
auth: true,
|
|
208
|
+
body: body,
|
|
209
|
+
request_options: request_options
|
|
357
210
|
)
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
response = execute_request(
|
|
361
|
-
request: post_request(
|
|
362
|
-
path: '/user_management/authenticate',
|
|
363
|
-
body: {
|
|
364
|
-
code: code,
|
|
365
|
-
client_id: client_id,
|
|
366
|
-
client_secret: WorkOS.config.key!,
|
|
367
|
-
ip_address: ip_address,
|
|
368
|
-
user_agent: user_agent,
|
|
369
|
-
invitation_token: invitation_token,
|
|
370
|
-
grant_type: 'authorization_code',
|
|
371
|
-
},
|
|
372
|
-
),
|
|
373
|
-
)
|
|
374
|
-
|
|
375
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
376
|
-
end
|
|
211
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
212
|
+
end
|
|
377
213
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
214
|
+
# Authenticate with magic auth.
|
|
215
|
+
# @param code [String]
|
|
216
|
+
# @param email [String]
|
|
217
|
+
# @param invitation_token [String, nil]
|
|
218
|
+
# @param ip_address [String, nil]
|
|
219
|
+
# @param device_id [String, nil]
|
|
220
|
+
# @param user_agent [String, nil]
|
|
221
|
+
# @param request_options [Hash] Per-request overrides.
|
|
222
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
223
|
+
def authenticate_with_magic_auth(
|
|
224
|
+
code:,
|
|
225
|
+
email:,
|
|
226
|
+
invitation_token: nil,
|
|
227
|
+
ip_address: nil,
|
|
228
|
+
device_id: nil,
|
|
229
|
+
user_agent: nil,
|
|
230
|
+
request_options: {}
|
|
231
|
+
)
|
|
232
|
+
body = {
|
|
233
|
+
"grant_type" => "urn:workos:oauth:grant-type:magic-auth:code",
|
|
234
|
+
"client_id" => @client.client_id,
|
|
235
|
+
"client_secret" => @client.api_key,
|
|
236
|
+
"code" => code,
|
|
237
|
+
"email" => email,
|
|
238
|
+
"invitation_token" => invitation_token,
|
|
239
|
+
"ip_address" => ip_address,
|
|
240
|
+
"device_id" => device_id,
|
|
241
|
+
"user_agent" => user_agent
|
|
242
|
+
}.compact
|
|
243
|
+
response = @client.request(
|
|
244
|
+
method: :post,
|
|
245
|
+
path: "/user_management/authenticate",
|
|
246
|
+
auth: true,
|
|
247
|
+
body: body,
|
|
248
|
+
request_options: request_options
|
|
396
249
|
)
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
response = execute_request(
|
|
400
|
-
request: post_request(
|
|
401
|
-
path: '/user_management/authenticate',
|
|
402
|
-
body: {
|
|
403
|
-
refresh_token: refresh_token,
|
|
404
|
-
client_id: client_id,
|
|
405
|
-
client_secret: WorkOS.config.key!,
|
|
406
|
-
ip_address: ip_address,
|
|
407
|
-
user_agent: user_agent,
|
|
408
|
-
grant_type: 'refresh_token',
|
|
409
|
-
organization_id: organization_id,
|
|
410
|
-
},
|
|
411
|
-
),
|
|
412
|
-
)
|
|
413
|
-
|
|
414
|
-
WorkOS::RefreshAuthenticationResponse.new(response.body, session)
|
|
415
|
-
end
|
|
250
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
251
|
+
end
|
|
416
252
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
email
|
|
435
|
-
client_id
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
253
|
+
# Authenticate with email verification.
|
|
254
|
+
# @param code [String]
|
|
255
|
+
# @param pending_authentication_token [String]
|
|
256
|
+
# @param ip_address [String, nil]
|
|
257
|
+
# @param device_id [String, nil]
|
|
258
|
+
# @param user_agent [String, nil]
|
|
259
|
+
# @param request_options [Hash] Per-request overrides.
|
|
260
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
261
|
+
def authenticate_with_email_verification(
|
|
262
|
+
code:,
|
|
263
|
+
pending_authentication_token:,
|
|
264
|
+
ip_address: nil,
|
|
265
|
+
device_id: nil,
|
|
266
|
+
user_agent: nil,
|
|
267
|
+
request_options: {}
|
|
268
|
+
)
|
|
269
|
+
body = {
|
|
270
|
+
"grant_type" => "urn:workos:oauth:grant-type:email-verification:code",
|
|
271
|
+
"client_id" => @client.client_id,
|
|
272
|
+
"client_secret" => @client.api_key,
|
|
273
|
+
"code" => code,
|
|
274
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
275
|
+
"ip_address" => ip_address,
|
|
276
|
+
"device_id" => device_id,
|
|
277
|
+
"user_agent" => user_agent
|
|
278
|
+
}.compact
|
|
279
|
+
response = @client.request(
|
|
280
|
+
method: :post,
|
|
281
|
+
path: "/user_management/authenticate",
|
|
282
|
+
auth: true,
|
|
283
|
+
body: body,
|
|
284
|
+
request_options: request_options
|
|
441
285
|
)
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
response = execute_request(
|
|
445
|
-
request: post_request(
|
|
446
|
-
path: '/user_management/authenticate',
|
|
447
|
-
body: {
|
|
448
|
-
code: code,
|
|
449
|
-
email: email,
|
|
450
|
-
client_id: client_id,
|
|
451
|
-
client_secret: WorkOS.config.key!,
|
|
452
|
-
ip_address: ip_address,
|
|
453
|
-
user_agent: user_agent,
|
|
454
|
-
grant_type: 'urn:workos:oauth:grant-type:magic-auth:code',
|
|
455
|
-
link_authorization_code: link_authorization_code,
|
|
456
|
-
invitation_token: invitation_token,
|
|
457
|
-
},
|
|
458
|
-
),
|
|
459
|
-
)
|
|
460
|
-
|
|
461
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
462
|
-
end
|
|
463
|
-
# rubocop:enable Metrics/ParameterLists
|
|
286
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
287
|
+
end
|
|
464
288
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
289
|
+
# Authenticate with totp.
|
|
290
|
+
# @param code [String]
|
|
291
|
+
# @param pending_authentication_token [String]
|
|
292
|
+
# @param authentication_challenge_id [String]
|
|
293
|
+
# @param ip_address [String, nil]
|
|
294
|
+
# @param device_id [String, nil]
|
|
295
|
+
# @param user_agent [String, nil]
|
|
296
|
+
# @param request_options [Hash] Per-request overrides.
|
|
297
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
298
|
+
def authenticate_with_totp(
|
|
299
|
+
code:,
|
|
300
|
+
pending_authentication_token:,
|
|
301
|
+
authentication_challenge_id:,
|
|
302
|
+
ip_address: nil,
|
|
303
|
+
device_id: nil,
|
|
304
|
+
user_agent: nil,
|
|
305
|
+
request_options: {}
|
|
306
|
+
)
|
|
307
|
+
body = {
|
|
308
|
+
"grant_type" => "urn:workos:oauth:grant-type:mfa-totp",
|
|
309
|
+
"client_id" => @client.client_id,
|
|
310
|
+
"client_secret" => @client.api_key,
|
|
311
|
+
"code" => code,
|
|
312
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
313
|
+
"authentication_challenge_id" => authentication_challenge_id,
|
|
314
|
+
"ip_address" => ip_address,
|
|
315
|
+
"device_id" => device_id,
|
|
316
|
+
"user_agent" => user_agent
|
|
317
|
+
}.compact
|
|
318
|
+
response = @client.request(
|
|
319
|
+
method: :post,
|
|
320
|
+
path: "/user_management/authenticate",
|
|
321
|
+
auth: true,
|
|
322
|
+
body: body,
|
|
323
|
+
request_options: request_options
|
|
483
324
|
)
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
response = execute_request(
|
|
487
|
-
request: post_request(
|
|
488
|
-
path: '/user_management/authenticate',
|
|
489
|
-
body: {
|
|
490
|
-
client_id: client_id,
|
|
491
|
-
client_secret: WorkOS.config.key!,
|
|
492
|
-
ip_address: ip_address,
|
|
493
|
-
user_agent: user_agent,
|
|
494
|
-
grant_type: 'urn:workos:oauth:grant-type:organization-selection',
|
|
495
|
-
organization_id: organization_id,
|
|
496
|
-
pending_authentication_token: pending_authentication_token,
|
|
497
|
-
},
|
|
498
|
-
),
|
|
499
|
-
)
|
|
500
|
-
|
|
501
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
502
|
-
end
|
|
325
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
326
|
+
end
|
|
503
327
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
328
|
+
# Authenticate with organization selection.
|
|
329
|
+
# @param pending_authentication_token [String]
|
|
330
|
+
# @param organization_id [String]
|
|
331
|
+
# @param ip_address [String, nil]
|
|
332
|
+
# @param device_id [String, nil]
|
|
333
|
+
# @param user_agent [String, nil]
|
|
334
|
+
# @param request_options [Hash] Per-request overrides.
|
|
335
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
336
|
+
def authenticate_with_organization_selection(
|
|
337
|
+
pending_authentication_token:,
|
|
338
|
+
organization_id:,
|
|
339
|
+
ip_address: nil,
|
|
340
|
+
device_id: nil,
|
|
341
|
+
user_agent: nil,
|
|
342
|
+
request_options: {}
|
|
343
|
+
)
|
|
344
|
+
body = {
|
|
345
|
+
"grant_type" => "urn:workos:oauth:grant-type:organization-selection",
|
|
346
|
+
"client_id" => @client.client_id,
|
|
347
|
+
"client_secret" => @client.api_key,
|
|
348
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
349
|
+
"organization_id" => organization_id,
|
|
350
|
+
"ip_address" => ip_address,
|
|
351
|
+
"device_id" => device_id,
|
|
352
|
+
"user_agent" => user_agent
|
|
353
|
+
}.compact
|
|
354
|
+
response = @client.request(
|
|
355
|
+
method: :post,
|
|
356
|
+
path: "/user_management/authenticate",
|
|
357
|
+
auth: true,
|
|
358
|
+
body: body,
|
|
359
|
+
request_options: request_options
|
|
527
360
|
)
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
response = execute_request(
|
|
531
|
-
request: post_request(
|
|
532
|
-
path: '/user_management/authenticate',
|
|
533
|
-
body: {
|
|
534
|
-
code: code,
|
|
535
|
-
client_id: client_id,
|
|
536
|
-
client_secret: WorkOS.config.key!,
|
|
537
|
-
pending_authentication_token: pending_authentication_token,
|
|
538
|
-
grant_type: 'urn:workos:oauth:grant-type:mfa-totp',
|
|
539
|
-
authentication_challenge_id: authentication_challenge_id,
|
|
540
|
-
ip_address: ip_address,
|
|
541
|
-
user_agent: user_agent,
|
|
542
|
-
},
|
|
543
|
-
),
|
|
544
|
-
)
|
|
545
|
-
|
|
546
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
547
|
-
end
|
|
548
|
-
# rubocop:enable Metrics/ParameterLists
|
|
361
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
362
|
+
end
|
|
549
363
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
364
|
+
# Authenticate with device code.
|
|
365
|
+
# @param device_code [String]
|
|
366
|
+
# @param ip_address [String, nil]
|
|
367
|
+
# @param device_id [String, nil]
|
|
368
|
+
# @param user_agent [String, nil]
|
|
369
|
+
# @param request_options [Hash] Per-request overrides.
|
|
370
|
+
# @return [WorkOS::AuthenticateResponse]
|
|
371
|
+
def authenticate_with_device_code(
|
|
372
|
+
device_code:,
|
|
373
|
+
ip_address: nil,
|
|
374
|
+
device_id: nil,
|
|
375
|
+
user_agent: nil,
|
|
376
|
+
request_options: {}
|
|
377
|
+
)
|
|
378
|
+
body = {
|
|
379
|
+
"grant_type" => "urn:ietf:params:oauth:grant-type:device_code",
|
|
380
|
+
"client_id" => @client.client_id,
|
|
381
|
+
"device_code" => device_code,
|
|
382
|
+
"ip_address" => ip_address,
|
|
383
|
+
"device_id" => device_id,
|
|
384
|
+
"user_agent" => user_agent
|
|
385
|
+
}.compact
|
|
386
|
+
response = @client.request(
|
|
387
|
+
method: :post,
|
|
388
|
+
path: "/user_management/authenticate",
|
|
389
|
+
auth: true,
|
|
390
|
+
body: body,
|
|
391
|
+
request_options: request_options
|
|
569
392
|
)
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
response = execute_request(
|
|
573
|
-
request: post_request(
|
|
574
|
-
path: '/user_management/authenticate',
|
|
575
|
-
body: {
|
|
576
|
-
code: code,
|
|
577
|
-
client_id: client_id,
|
|
578
|
-
pending_authentication_token: pending_authentication_token,
|
|
579
|
-
client_secret: WorkOS.config.key!,
|
|
580
|
-
grant_type: 'urn:workos:oauth:grant-type:email-verification:code',
|
|
581
|
-
ip_address: ip_address,
|
|
582
|
-
user_agent: user_agent,
|
|
583
|
-
},
|
|
584
|
-
),
|
|
585
|
-
)
|
|
586
|
-
|
|
587
|
-
WorkOS::AuthenticationResponse.new(response.body, session)
|
|
588
|
-
end
|
|
589
|
-
|
|
590
|
-
# Get the logout URL for a session
|
|
591
|
-
#
|
|
592
|
-
# The user's browser should be navigated to this URL
|
|
593
|
-
#
|
|
594
|
-
# @param [String] session_id The session ID can be found in the `sid`
|
|
595
|
-
# claim of the access token
|
|
596
|
-
# @param [String] return_to The URL to redirect the user to after logging out
|
|
597
|
-
#
|
|
598
|
-
# @return String
|
|
599
|
-
def get_logout_url(session_id:, return_to: nil)
|
|
600
|
-
params = { session_id: session_id }
|
|
601
|
-
params[:return_to] = return_to if return_to
|
|
602
|
-
|
|
603
|
-
URI::HTTPS.build(
|
|
604
|
-
host: WorkOS.config.api_hostname,
|
|
605
|
-
path: '/user_management/sessions/logout',
|
|
606
|
-
query: URI.encode_www_form(params),
|
|
607
|
-
).to_s
|
|
608
|
-
end
|
|
609
|
-
|
|
610
|
-
# Revokes a session
|
|
611
|
-
#
|
|
612
|
-
# @param [String] session_id The session ID can be found in the `sid`
|
|
613
|
-
# claim of the access token
|
|
614
|
-
def revoke_session(session_id:)
|
|
615
|
-
response = execute_request(
|
|
616
|
-
request: post_request(
|
|
617
|
-
path: '/user_management/sessions/revoke',
|
|
618
|
-
body: {
|
|
619
|
-
session_id: session_id,
|
|
620
|
-
},
|
|
621
|
-
auth: true,
|
|
622
|
-
),
|
|
623
|
-
)
|
|
624
|
-
|
|
625
|
-
response.is_a? Net::HTTPSuccess
|
|
626
|
-
end
|
|
627
|
-
|
|
628
|
-
# Get the JWKS URL
|
|
629
|
-
#
|
|
630
|
-
# The JWKS can be used to validate the access token returned upon successful authentication
|
|
631
|
-
#
|
|
632
|
-
# @param [String] client_id The WorkOS client ID for the environment
|
|
633
|
-
#
|
|
634
|
-
# @return String
|
|
635
|
-
def get_jwks_url(client_id)
|
|
636
|
-
URI::HTTPS.build(
|
|
637
|
-
host: WorkOS.config.api_hostname,
|
|
638
|
-
path: "/sso/jwks/#{client_id}",
|
|
639
|
-
).to_s
|
|
640
|
-
end
|
|
641
|
-
|
|
642
|
-
# Gets a Magic Auth object
|
|
643
|
-
#
|
|
644
|
-
# @param [String] id The unique ID of the MagicAuth object.
|
|
645
|
-
#
|
|
646
|
-
# @return WorkOS::MagicAuth
|
|
647
|
-
def get_magic_auth(id:)
|
|
648
|
-
response = execute_request(
|
|
649
|
-
request: get_request(
|
|
650
|
-
path: "/user_management/magic_auth/#{id}",
|
|
651
|
-
auth: true,
|
|
652
|
-
),
|
|
653
|
-
)
|
|
654
|
-
|
|
655
|
-
WorkOS::MagicAuth.new(response.body)
|
|
656
|
-
end
|
|
657
|
-
|
|
658
|
-
# Creates a MagicAuth code
|
|
659
|
-
#
|
|
660
|
-
# @param [String] email The email address of the recipient.
|
|
661
|
-
# @param [String] invitation_token The token of an Invitation, if required.
|
|
662
|
-
#
|
|
663
|
-
# @return WorkOS::MagicAuth
|
|
664
|
-
def create_magic_auth(email:, invitation_token: nil)
|
|
665
|
-
response = execute_request(
|
|
666
|
-
request: post_request(
|
|
667
|
-
path: '/user_management/magic_auth',
|
|
668
|
-
body: {
|
|
669
|
-
email: email,
|
|
670
|
-
invitation_token: invitation_token,
|
|
671
|
-
}.compact,
|
|
672
|
-
auth: true,
|
|
673
|
-
),
|
|
674
|
-
)
|
|
393
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
394
|
+
end
|
|
675
395
|
|
|
676
|
-
|
|
677
|
-
|
|
396
|
+
# Get device authorization URL
|
|
397
|
+
# @param client_id [String] The WorkOS client ID for your application.
|
|
398
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
399
|
+
# @return [WorkOS::DeviceAuthorizationResponse]
|
|
400
|
+
def create_device(
|
|
401
|
+
client_id:,
|
|
402
|
+
request_options: {}
|
|
403
|
+
)
|
|
404
|
+
body = {
|
|
405
|
+
"client_id" => client_id
|
|
406
|
+
}.compact
|
|
407
|
+
response = @client.request(
|
|
408
|
+
method: :post,
|
|
409
|
+
path: "/user_management/authorize/device",
|
|
410
|
+
auth: true,
|
|
411
|
+
body: body,
|
|
412
|
+
request_options: request_options
|
|
413
|
+
)
|
|
414
|
+
result = WorkOS::DeviceAuthorizationResponse.new(response.body)
|
|
415
|
+
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"])
|
|
416
|
+
result
|
|
417
|
+
end
|
|
678
418
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
419
|
+
# Revoke Session
|
|
420
|
+
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
|
|
421
|
+
# @param return_to [String, nil] The URL to redirect the user to after session revocation.
|
|
422
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
423
|
+
# @return [void]
|
|
424
|
+
def revoke_session(
|
|
425
|
+
session_id:,
|
|
426
|
+
return_to: nil,
|
|
427
|
+
request_options: {}
|
|
428
|
+
)
|
|
429
|
+
body = {
|
|
430
|
+
"session_id" => session_id,
|
|
431
|
+
"return_to" => return_to
|
|
432
|
+
}.compact
|
|
433
|
+
@client.request(
|
|
434
|
+
method: :post,
|
|
435
|
+
path: "/user_management/sessions/revoke",
|
|
436
|
+
auth: true,
|
|
437
|
+
body: body,
|
|
438
|
+
request_options: request_options
|
|
439
|
+
)
|
|
440
|
+
nil
|
|
441
|
+
end
|
|
687
442
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
443
|
+
# Create a CORS origin
|
|
444
|
+
# @param origin [String] The origin URL to allow for CORS requests.
|
|
445
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
446
|
+
# @return [WorkOS::CORSOriginResponse]
|
|
447
|
+
def create_cors_origin(
|
|
448
|
+
origin:,
|
|
449
|
+
request_options: {}
|
|
450
|
+
)
|
|
451
|
+
body = {
|
|
452
|
+
"origin" => origin
|
|
453
|
+
}.compact
|
|
454
|
+
response = @client.request(
|
|
455
|
+
method: :post,
|
|
456
|
+
path: "/user_management/cors_origins",
|
|
457
|
+
auth: true,
|
|
458
|
+
body: body,
|
|
459
|
+
request_options: request_options
|
|
460
|
+
)
|
|
461
|
+
result = WorkOS::CORSOriginResponse.new(response.body)
|
|
462
|
+
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"])
|
|
463
|
+
result
|
|
464
|
+
end
|
|
697
465
|
|
|
698
|
-
|
|
699
|
-
|
|
466
|
+
# Get an email verification code
|
|
467
|
+
# @param id [String] The ID of the email verification code.
|
|
468
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
469
|
+
# @return [WorkOS::EmailVerification]
|
|
470
|
+
def get_email_verification(
|
|
471
|
+
id:,
|
|
472
|
+
request_options: {}
|
|
473
|
+
)
|
|
474
|
+
response = @client.request(
|
|
475
|
+
method: :get,
|
|
476
|
+
path: "/user_management/email_verification/#{WorkOS::Util.encode_path(id)}",
|
|
477
|
+
auth: true,
|
|
478
|
+
request_options: request_options
|
|
479
|
+
)
|
|
480
|
+
result = WorkOS::EmailVerification.new(response.body)
|
|
481
|
+
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"])
|
|
482
|
+
result
|
|
483
|
+
end
|
|
700
484
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
485
|
+
# Create a password reset token
|
|
486
|
+
# @param email [String] The email address of the user requesting a password reset.
|
|
487
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
488
|
+
# @return [WorkOS::PasswordReset]
|
|
489
|
+
def reset_password(
|
|
490
|
+
email:,
|
|
491
|
+
request_options: {}
|
|
492
|
+
)
|
|
493
|
+
body = {
|
|
494
|
+
"email" => email
|
|
495
|
+
}.compact
|
|
496
|
+
response = @client.request(
|
|
497
|
+
method: :post,
|
|
498
|
+
path: "/user_management/password_reset",
|
|
499
|
+
auth: true,
|
|
500
|
+
body: body,
|
|
501
|
+
request_options: request_options
|
|
502
|
+
)
|
|
503
|
+
result = WorkOS::PasswordReset.new(response.body)
|
|
504
|
+
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"])
|
|
505
|
+
result
|
|
506
|
+
end
|
|
716
507
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
508
|
+
# Reset the password
|
|
509
|
+
# @param token [String] The password reset token.
|
|
510
|
+
# @param new_password [String] The new password to set for the user.
|
|
511
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
512
|
+
# @return [WorkOS::ResetPasswordResponse]
|
|
513
|
+
def confirm_password_reset(
|
|
514
|
+
token:,
|
|
515
|
+
new_password:,
|
|
516
|
+
request_options: {}
|
|
517
|
+
)
|
|
518
|
+
body = {
|
|
519
|
+
"token" => token,
|
|
520
|
+
"new_password" => new_password
|
|
521
|
+
}.compact
|
|
522
|
+
response = @client.request(
|
|
523
|
+
method: :post,
|
|
524
|
+
path: "/user_management/password_reset/confirm",
|
|
525
|
+
auth: true,
|
|
526
|
+
body: body,
|
|
527
|
+
request_options: request_options
|
|
528
|
+
)
|
|
529
|
+
result = WorkOS::ResetPasswordResponse.new(response.body)
|
|
530
|
+
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"])
|
|
531
|
+
result
|
|
532
|
+
end
|
|
729
533
|
|
|
730
|
-
|
|
731
|
-
|
|
534
|
+
# Get a password reset token
|
|
535
|
+
# @param id [String] The ID of the password reset token.
|
|
536
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
537
|
+
# @return [WorkOS::PasswordReset]
|
|
538
|
+
def get_password_reset(
|
|
539
|
+
id:,
|
|
540
|
+
request_options: {}
|
|
541
|
+
)
|
|
542
|
+
response = @client.request(
|
|
543
|
+
method: :get,
|
|
544
|
+
path: "/user_management/password_reset/#{WorkOS::Util.encode_path(id)}",
|
|
545
|
+
auth: true,
|
|
546
|
+
request_options: request_options
|
|
547
|
+
)
|
|
548
|
+
result = WorkOS::PasswordReset.new(response.body)
|
|
549
|
+
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"])
|
|
550
|
+
result
|
|
551
|
+
end
|
|
732
552
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
553
|
+
# List users
|
|
554
|
+
# @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"`.
|
|
555
|
+
# @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"`.
|
|
556
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
557
|
+
# @param order [WorkOS::Types::UserManagementUsersOrder, 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). Defaults to descending.
|
|
558
|
+
# @param organization [String, nil] (deprecated) Filter users by the organization they are a member of. Deprecated in favor of `organization_id`.
|
|
559
|
+
# @param organization_id [String, nil] Filter users by the organization they are a member of.
|
|
560
|
+
# @param email [String, nil] Filter users by their email address.
|
|
561
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
562
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::User>]
|
|
563
|
+
def list_users(
|
|
564
|
+
before: nil,
|
|
565
|
+
after: nil,
|
|
566
|
+
limit: nil,
|
|
567
|
+
order: "desc",
|
|
568
|
+
organization: nil,
|
|
569
|
+
organization_id: nil,
|
|
570
|
+
email: nil,
|
|
571
|
+
request_options: {}
|
|
572
|
+
)
|
|
573
|
+
params = {
|
|
574
|
+
"before" => before,
|
|
575
|
+
"after" => after,
|
|
576
|
+
"limit" => limit,
|
|
577
|
+
"order" => order,
|
|
578
|
+
"organization" => organization,
|
|
579
|
+
"organization_id" => organization_id,
|
|
580
|
+
"email" => email
|
|
581
|
+
}.compact
|
|
582
|
+
response = @client.request(
|
|
583
|
+
method: :get,
|
|
584
|
+
path: "/user_management/users",
|
|
585
|
+
auth: true,
|
|
586
|
+
params: params,
|
|
587
|
+
request_options: request_options
|
|
588
|
+
)
|
|
589
|
+
fetch_next = ->(cursor) {
|
|
590
|
+
list_users(
|
|
591
|
+
before: before,
|
|
592
|
+
after: cursor,
|
|
593
|
+
limit: limit,
|
|
594
|
+
order: order,
|
|
595
|
+
organization: organization,
|
|
596
|
+
organization_id: organization_id,
|
|
597
|
+
email: email,
|
|
598
|
+
request_options: request_options
|
|
744
599
|
)
|
|
600
|
+
}
|
|
601
|
+
WorkOS::Types::ListStruct.from_response(
|
|
602
|
+
response,
|
|
603
|
+
model: WorkOS::User,
|
|
604
|
+
filters: {before: before, limit: limit, order: order, organization: organization, organization_id: organization_id, email: email},
|
|
605
|
+
fetch_next: fetch_next
|
|
606
|
+
)
|
|
607
|
+
end
|
|
745
608
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
609
|
+
# Create a user
|
|
610
|
+
# @param email [String] The email address of the user.
|
|
611
|
+
# @param first_name [String, nil] The first name of the user.
|
|
612
|
+
# @param last_name [String, nil] The last name of the user.
|
|
613
|
+
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
614
|
+
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
615
|
+
# @param external_id [String, nil] The external ID of the user.
|
|
616
|
+
# @param password [String, nil] The password to set for the user. Mutually exclusive with `password_hash` and `password_hash_type`.
|
|
617
|
+
# @param password_hash [String, nil] The hashed password to set for the user. Required with `password_hash_type`. Mutually exclusive with `password`.
|
|
618
|
+
# @param password_hash_type [WorkOS::Types::CreateUserPasswordHashType, nil] The algorithm originally used to hash the password, used when providing a `password_hash`. Required with `password_hash`. Mutually exclusive with `password`.
|
|
619
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
620
|
+
# @return [WorkOS::User]
|
|
621
|
+
def create_user(
|
|
622
|
+
email:,
|
|
623
|
+
first_name: nil,
|
|
624
|
+
last_name: nil,
|
|
625
|
+
email_verified: nil,
|
|
626
|
+
metadata: nil,
|
|
627
|
+
external_id: nil,
|
|
628
|
+
password: nil,
|
|
629
|
+
password_hash: nil,
|
|
630
|
+
password_hash_type: nil,
|
|
631
|
+
request_options: {}
|
|
632
|
+
)
|
|
633
|
+
body = {
|
|
634
|
+
"email" => email,
|
|
635
|
+
"first_name" => first_name,
|
|
636
|
+
"last_name" => last_name,
|
|
637
|
+
"email_verified" => email_verified,
|
|
638
|
+
"metadata" => metadata,
|
|
639
|
+
"external_id" => external_id,
|
|
640
|
+
"password" => password,
|
|
641
|
+
"password_hash" => password_hash,
|
|
642
|
+
"password_hash_type" => password_hash_type
|
|
643
|
+
}.compact
|
|
644
|
+
if password
|
|
645
|
+
case password[:type]
|
|
646
|
+
when "plaintext"
|
|
647
|
+
body["password"] = password[:password]
|
|
648
|
+
when "hashed"
|
|
649
|
+
body["password_hash"] = password[:password_hash]
|
|
650
|
+
body["password_hash_type"] = password[:password_hash_type]
|
|
750
651
|
end
|
|
751
|
-
|
|
752
|
-
WorkOS::Types::ListStruct.new(
|
|
753
|
-
data: auth_factors,
|
|
754
|
-
list_metadata: parsed_response['list_metadata'],
|
|
755
|
-
)
|
|
756
652
|
end
|
|
653
|
+
response = @client.request(
|
|
654
|
+
method: :post,
|
|
655
|
+
path: "/user_management/users",
|
|
656
|
+
auth: true,
|
|
657
|
+
body: body,
|
|
658
|
+
request_options: request_options
|
|
659
|
+
)
|
|
660
|
+
result = WorkOS::User.new(response.body)
|
|
661
|
+
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"])
|
|
662
|
+
result
|
|
663
|
+
end
|
|
757
664
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
params: options,
|
|
777
|
-
),
|
|
778
|
-
)
|
|
665
|
+
# Get a user by external ID
|
|
666
|
+
# @param external_id [String] The external ID of the user.
|
|
667
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
668
|
+
# @return [WorkOS::User]
|
|
669
|
+
def get_user_by_external_id(
|
|
670
|
+
external_id:,
|
|
671
|
+
request_options: {}
|
|
672
|
+
)
|
|
673
|
+
response = @client.request(
|
|
674
|
+
method: :get,
|
|
675
|
+
path: "/user_management/users/external_id/#{WorkOS::Util.encode_path(external_id)}",
|
|
676
|
+
auth: true,
|
|
677
|
+
request_options: request_options
|
|
678
|
+
)
|
|
679
|
+
result = WorkOS::User.new(response.body)
|
|
680
|
+
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"])
|
|
681
|
+
result
|
|
682
|
+
end
|
|
779
683
|
|
|
780
|
-
|
|
684
|
+
# Get a user
|
|
685
|
+
# @param id [String] The unique ID of the user.
|
|
686
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
687
|
+
# @return [WorkOS::User]
|
|
688
|
+
def get_user(
|
|
689
|
+
id:,
|
|
690
|
+
request_options: {}
|
|
691
|
+
)
|
|
692
|
+
response = @client.request(
|
|
693
|
+
method: :get,
|
|
694
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}",
|
|
695
|
+
auth: true,
|
|
696
|
+
request_options: request_options
|
|
697
|
+
)
|
|
698
|
+
result = WorkOS::User.new(response.body)
|
|
699
|
+
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"])
|
|
700
|
+
result
|
|
701
|
+
end
|
|
781
702
|
|
|
782
|
-
|
|
783
|
-
|
|
703
|
+
# Update a user
|
|
704
|
+
# @param id [String] The unique ID of the user.
|
|
705
|
+
# @param email [String, nil] The email address of the user.
|
|
706
|
+
# @param first_name [String, nil] The first name of the user.
|
|
707
|
+
# @param last_name [String, nil] The last name of the user.
|
|
708
|
+
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
709
|
+
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
710
|
+
# @param external_id [String, nil] The external ID of the user.
|
|
711
|
+
# @param locale [String, nil] The user's preferred locale.
|
|
712
|
+
# @param password [String, nil] The password to set for the user. Mutually exclusive with `password_hash` and `password_hash_type`.
|
|
713
|
+
# @param password_hash [String, nil] The hashed password to set for the user. Required with `password_hash_type`. Mutually exclusive with `password`.
|
|
714
|
+
# @param password_hash_type [WorkOS::Types::UpdateUserPasswordHashType, nil] The algorithm originally used to hash the password, used when providing a `password_hash`. Required with `password_hash`. Mutually exclusive with `password`.
|
|
715
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
716
|
+
# @return [WorkOS::User]
|
|
717
|
+
def update_user(
|
|
718
|
+
id:,
|
|
719
|
+
email: nil,
|
|
720
|
+
first_name: nil,
|
|
721
|
+
last_name: nil,
|
|
722
|
+
email_verified: nil,
|
|
723
|
+
metadata: nil,
|
|
724
|
+
external_id: nil,
|
|
725
|
+
locale: nil,
|
|
726
|
+
password: nil,
|
|
727
|
+
password_hash: nil,
|
|
728
|
+
password_hash_type: nil,
|
|
729
|
+
request_options: {}
|
|
730
|
+
)
|
|
731
|
+
body = {
|
|
732
|
+
"email" => email,
|
|
733
|
+
"first_name" => first_name,
|
|
734
|
+
"last_name" => last_name,
|
|
735
|
+
"email_verified" => email_verified,
|
|
736
|
+
"metadata" => metadata,
|
|
737
|
+
"external_id" => external_id,
|
|
738
|
+
"locale" => locale,
|
|
739
|
+
"password" => password,
|
|
740
|
+
"password_hash" => password_hash,
|
|
741
|
+
"password_hash_type" => password_hash_type
|
|
742
|
+
}.compact
|
|
743
|
+
if password
|
|
744
|
+
case password[:type]
|
|
745
|
+
when "plaintext"
|
|
746
|
+
body["password"] = password[:password]
|
|
747
|
+
when "hashed"
|
|
748
|
+
body["password_hash"] = password[:password_hash]
|
|
749
|
+
body["password_hash_type"] = password[:password_hash_type]
|
|
784
750
|
end
|
|
785
|
-
|
|
786
|
-
WorkOS::Types::ListStruct.new(
|
|
787
|
-
data: sessions,
|
|
788
|
-
list_metadata: parsed_response['list_metadata'],
|
|
789
|
-
)
|
|
790
751
|
end
|
|
752
|
+
response = @client.request(
|
|
753
|
+
method: :put,
|
|
754
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}",
|
|
755
|
+
auth: true,
|
|
756
|
+
body: body,
|
|
757
|
+
request_options: request_options
|
|
758
|
+
)
|
|
759
|
+
result = WorkOS::User.new(response.body)
|
|
760
|
+
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"])
|
|
761
|
+
result
|
|
762
|
+
end
|
|
791
763
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
# Sends a verification email to the provided user.
|
|
809
|
-
#
|
|
810
|
-
# @param [String] user_id The unique ID of the User whose email address will be verified.
|
|
811
|
-
#
|
|
812
|
-
# @return WorkOS::UserResponse
|
|
813
|
-
def send_verification_email(user_id:)
|
|
814
|
-
response = execute_request(
|
|
815
|
-
request: post_request(
|
|
816
|
-
path: "/user_management/users/#{user_id}/email_verification/send",
|
|
817
|
-
auth: true,
|
|
818
|
-
),
|
|
819
|
-
)
|
|
820
|
-
|
|
821
|
-
WorkOS::UserResponse.new(response.body)
|
|
822
|
-
end
|
|
823
|
-
|
|
824
|
-
# Verifiy user email using one-time code that was sent to the user.
|
|
825
|
-
#
|
|
826
|
-
# @param [String] user_id The unique ID of the User whose email address will be verified.
|
|
827
|
-
# @param [String] code The one-time code emailed to the user.
|
|
828
|
-
#
|
|
829
|
-
# @return WorkOS::UserResponse
|
|
830
|
-
def verify_email(user_id:, code:)
|
|
831
|
-
response = execute_request(
|
|
832
|
-
request: post_request(
|
|
833
|
-
path: "/user_management/users/#{user_id}/email_verification/confirm",
|
|
834
|
-
body: {
|
|
835
|
-
code: code,
|
|
836
|
-
},
|
|
837
|
-
auth: true,
|
|
838
|
-
),
|
|
839
|
-
)
|
|
840
|
-
|
|
841
|
-
WorkOS::UserResponse.new(response.body)
|
|
842
|
-
end
|
|
843
|
-
|
|
844
|
-
# Gets a password reset object
|
|
845
|
-
#
|
|
846
|
-
# @param [String] id The unique ID of the PasswordReset object.
|
|
847
|
-
#
|
|
848
|
-
# @return WorkOS::PasswordReset
|
|
849
|
-
def get_password_reset(id:)
|
|
850
|
-
response = execute_request(
|
|
851
|
-
request: get_request(
|
|
852
|
-
path: "/user_management/password_reset/#{id}",
|
|
853
|
-
auth: true,
|
|
854
|
-
),
|
|
855
|
-
)
|
|
856
|
-
|
|
857
|
-
WorkOS::PasswordReset.new(response.body)
|
|
858
|
-
end
|
|
859
|
-
|
|
860
|
-
# Creates a password reset token
|
|
861
|
-
#
|
|
862
|
-
# @param [String] email The email address of the user.
|
|
863
|
-
#
|
|
864
|
-
# @return WorkOS::PasswordReset
|
|
865
|
-
def create_password_reset(email:)
|
|
866
|
-
response = execute_request(
|
|
867
|
-
request: post_request(
|
|
868
|
-
path: '/user_management/password_reset',
|
|
869
|
-
body: {
|
|
870
|
-
email: email,
|
|
871
|
-
},
|
|
872
|
-
auth: true,
|
|
873
|
-
),
|
|
874
|
-
)
|
|
875
|
-
|
|
876
|
-
WorkOS::PasswordReset.new(response.body)
|
|
877
|
-
end
|
|
878
|
-
|
|
879
|
-
# Create a password reset challenge and emails a password reset link to a user.
|
|
880
|
-
#
|
|
881
|
-
# @param [String] email The email of the user that wishes to reset their password.
|
|
882
|
-
# @param [String] password_reset_url The URL that will be linked to in the email.
|
|
883
|
-
#
|
|
884
|
-
# @return [Bool] - returns `true` if successful
|
|
885
|
-
def send_password_reset_email(email:, password_reset_url:)
|
|
886
|
-
warn_deprecation '`send_password_reset_email` is deprecated.
|
|
887
|
-
Please use `create_password_reset` instead. This method will be removed in a future major version.'
|
|
888
|
-
|
|
889
|
-
request = post_request(
|
|
890
|
-
path: '/user_management/password_reset/send',
|
|
891
|
-
body: {
|
|
892
|
-
email: email,
|
|
893
|
-
password_reset_url: password_reset_url,
|
|
894
|
-
},
|
|
895
|
-
auth: true,
|
|
896
|
-
)
|
|
897
|
-
|
|
898
|
-
response = execute_request(request: request)
|
|
899
|
-
|
|
900
|
-
response.is_a? Net::HTTPSuccess
|
|
901
|
-
end
|
|
902
|
-
|
|
903
|
-
# Reset user password using token that was sent to the user.
|
|
904
|
-
#
|
|
905
|
-
# @param [String] token The token that was sent to the user.
|
|
906
|
-
# @param [String] new_password The new password to set for the user.
|
|
907
|
-
#
|
|
908
|
-
# @return WorkOS::User
|
|
909
|
-
def reset_password(token:, new_password:)
|
|
910
|
-
response = execute_request(
|
|
911
|
-
request: post_request(
|
|
912
|
-
path: '/user_management/password_reset/confirm',
|
|
913
|
-
body: {
|
|
914
|
-
token: token,
|
|
915
|
-
new_password: new_password,
|
|
916
|
-
},
|
|
917
|
-
auth: true,
|
|
918
|
-
),
|
|
919
|
-
)
|
|
920
|
-
|
|
921
|
-
WorkOS::UserResponse.new(response.body).user
|
|
922
|
-
end
|
|
764
|
+
# Delete a user
|
|
765
|
+
# @param id [String] The unique ID of the user.
|
|
766
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
767
|
+
# @return [void]
|
|
768
|
+
def delete_user(
|
|
769
|
+
id:,
|
|
770
|
+
request_options: {}
|
|
771
|
+
)
|
|
772
|
+
@client.request(
|
|
773
|
+
method: :delete,
|
|
774
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}",
|
|
775
|
+
auth: true,
|
|
776
|
+
request_options: request_options
|
|
777
|
+
)
|
|
778
|
+
nil
|
|
779
|
+
end
|
|
923
780
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
781
|
+
# Confirm email change
|
|
782
|
+
# @param id [String] The unique ID of the user.
|
|
783
|
+
# @param code [String] The one-time code used to confirm the email change.
|
|
784
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
785
|
+
# @return [WorkOS::EmailChangeConfirmation]
|
|
786
|
+
def confirm_email_change(
|
|
787
|
+
id:,
|
|
788
|
+
code:,
|
|
789
|
+
request_options: {}
|
|
790
|
+
)
|
|
791
|
+
body = {
|
|
792
|
+
"code" => code
|
|
793
|
+
}.compact
|
|
794
|
+
response = @client.request(
|
|
795
|
+
method: :post,
|
|
796
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_change/confirm",
|
|
797
|
+
auth: true,
|
|
798
|
+
body: body,
|
|
799
|
+
request_options: request_options
|
|
800
|
+
)
|
|
801
|
+
result = WorkOS::EmailChangeConfirmation.new(response.body)
|
|
802
|
+
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"])
|
|
803
|
+
result
|
|
804
|
+
end
|
|
936
805
|
|
|
937
|
-
|
|
938
|
-
|
|
806
|
+
# Send email change code
|
|
807
|
+
# @param id [String] The unique ID of the user.
|
|
808
|
+
# @param new_email [String] The new email address to change to.
|
|
809
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
810
|
+
# @return [WorkOS::EmailChange]
|
|
811
|
+
def send_email_change(
|
|
812
|
+
id:,
|
|
813
|
+
new_email:,
|
|
814
|
+
request_options: {}
|
|
815
|
+
)
|
|
816
|
+
body = {
|
|
817
|
+
"new_email" => new_email
|
|
818
|
+
}.compact
|
|
819
|
+
response = @client.request(
|
|
820
|
+
method: :post,
|
|
821
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_change/send",
|
|
822
|
+
auth: true,
|
|
823
|
+
body: body,
|
|
824
|
+
request_options: request_options
|
|
825
|
+
)
|
|
826
|
+
result = WorkOS::EmailChange.new(response.body)
|
|
827
|
+
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"])
|
|
828
|
+
result
|
|
829
|
+
end
|
|
939
830
|
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
831
|
+
# Verify email
|
|
832
|
+
# @param id [String] The ID of the user.
|
|
833
|
+
# @param code [String] The one-time email verification code.
|
|
834
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
835
|
+
# @return [WorkOS::VerifyEmailResponse]
|
|
836
|
+
def verify_email(
|
|
837
|
+
id:,
|
|
838
|
+
code:,
|
|
839
|
+
request_options: {}
|
|
840
|
+
)
|
|
841
|
+
body = {
|
|
842
|
+
"code" => code
|
|
843
|
+
}.compact
|
|
844
|
+
response = @client.request(
|
|
845
|
+
method: :post,
|
|
846
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_verification/confirm",
|
|
847
|
+
auth: true,
|
|
848
|
+
body: body,
|
|
849
|
+
request_options: request_options
|
|
850
|
+
)
|
|
851
|
+
result = WorkOS::VerifyEmailResponse.new(response.body)
|
|
852
|
+
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"])
|
|
853
|
+
result
|
|
854
|
+
end
|
|
963
855
|
|
|
964
|
-
|
|
856
|
+
# Send verification email
|
|
857
|
+
# @param id [String] The ID of the user.
|
|
858
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
859
|
+
# @return [WorkOS::SendVerificationEmailResponse]
|
|
860
|
+
def send_verification_email(
|
|
861
|
+
id:,
|
|
862
|
+
request_options: {}
|
|
863
|
+
)
|
|
864
|
+
response = @client.request(
|
|
865
|
+
method: :post,
|
|
866
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_verification/send",
|
|
867
|
+
auth: true,
|
|
868
|
+
request_options: request_options
|
|
869
|
+
)
|
|
870
|
+
result = WorkOS::SendVerificationEmailResponse.new(response.body)
|
|
871
|
+
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"])
|
|
872
|
+
result
|
|
873
|
+
end
|
|
965
874
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
875
|
+
# Get user identities
|
|
876
|
+
# @param id [String] The unique ID of the user.
|
|
877
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
878
|
+
# @return [Array<WorkOS::UserIdentitiesGetItem>]
|
|
879
|
+
def get_user_identities(
|
|
880
|
+
id:,
|
|
881
|
+
request_options: {}
|
|
882
|
+
)
|
|
883
|
+
response = @client.request(
|
|
884
|
+
method: :get,
|
|
885
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/identities",
|
|
886
|
+
auth: true,
|
|
887
|
+
request_options: request_options
|
|
888
|
+
)
|
|
889
|
+
parsed = JSON.parse(response.body)
|
|
890
|
+
(parsed || []).map { |item| WorkOS::UserIdentitiesGetItem.new(item) }
|
|
891
|
+
end
|
|
969
892
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
893
|
+
# List sessions
|
|
894
|
+
# @param id [String] The ID of the user.
|
|
895
|
+
# @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"`.
|
|
896
|
+
# @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"`.
|
|
897
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
898
|
+
# @param order [WorkOS::Types::UserManagementUsersOrder, 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). Defaults to descending.
|
|
899
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
900
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserSessionsListItem>]
|
|
901
|
+
def list_sessions(
|
|
902
|
+
id:,
|
|
903
|
+
before: nil,
|
|
904
|
+
after: nil,
|
|
905
|
+
limit: nil,
|
|
906
|
+
order: "desc",
|
|
907
|
+
request_options: {}
|
|
908
|
+
)
|
|
909
|
+
params = {
|
|
910
|
+
"before" => before,
|
|
911
|
+
"after" => after,
|
|
912
|
+
"limit" => limit,
|
|
913
|
+
"order" => order
|
|
914
|
+
}.compact
|
|
915
|
+
response = @client.request(
|
|
916
|
+
method: :get,
|
|
917
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/sessions",
|
|
918
|
+
auth: true,
|
|
919
|
+
params: params,
|
|
920
|
+
request_options: request_options
|
|
921
|
+
)
|
|
922
|
+
fetch_next = ->(cursor) {
|
|
923
|
+
list_sessions(
|
|
924
|
+
id: id,
|
|
925
|
+
before: before,
|
|
926
|
+
after: cursor,
|
|
927
|
+
limit: limit,
|
|
928
|
+
order: order,
|
|
929
|
+
request_options: request_options
|
|
973
930
|
)
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
#
|
|
983
|
-
# @return [WorkOS::OrganizationMembership]
|
|
984
|
-
def create_organization_membership(user_id:, organization_id:, role_slug: nil, role_slugs: nil)
|
|
985
|
-
raise ArgumentError, 'Cannot specify both role_slug and role_slugs' if role_slug && role_slugs
|
|
931
|
+
}
|
|
932
|
+
WorkOS::Types::ListStruct.from_response(
|
|
933
|
+
response,
|
|
934
|
+
model: WorkOS::UserSessionsListItem,
|
|
935
|
+
filters: {id: id, before: before, limit: limit, order: order},
|
|
936
|
+
fetch_next: fetch_next
|
|
937
|
+
)
|
|
938
|
+
end
|
|
986
939
|
|
|
987
|
-
|
|
988
|
-
|
|
940
|
+
# List invitations
|
|
941
|
+
# @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"`.
|
|
942
|
+
# @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"`.
|
|
943
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
944
|
+
# @param order [WorkOS::Types::UserManagementInvitationsOrder, 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). Defaults to descending.
|
|
945
|
+
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join.
|
|
946
|
+
# @param email [String, nil] The email address of the recipient.
|
|
947
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
948
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserInvite>]
|
|
949
|
+
def list_invitations(
|
|
950
|
+
before: nil,
|
|
951
|
+
after: nil,
|
|
952
|
+
limit: nil,
|
|
953
|
+
order: "desc",
|
|
954
|
+
organization_id: nil,
|
|
955
|
+
email: nil,
|
|
956
|
+
request_options: {}
|
|
957
|
+
)
|
|
958
|
+
params = {
|
|
959
|
+
"before" => before,
|
|
960
|
+
"after" => after,
|
|
961
|
+
"limit" => limit,
|
|
962
|
+
"order" => order,
|
|
963
|
+
"organization_id" => organization_id,
|
|
964
|
+
"email" => email
|
|
965
|
+
}.compact
|
|
966
|
+
response = @client.request(
|
|
967
|
+
method: :get,
|
|
968
|
+
path: "/user_management/invitations",
|
|
969
|
+
auth: true,
|
|
970
|
+
params: params,
|
|
971
|
+
request_options: request_options
|
|
972
|
+
)
|
|
973
|
+
fetch_next = ->(cursor) {
|
|
974
|
+
list_invitations(
|
|
975
|
+
before: before,
|
|
976
|
+
after: cursor,
|
|
977
|
+
limit: limit,
|
|
978
|
+
order: order,
|
|
989
979
|
organization_id: organization_id,
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
body[:role_slugs] = role_slugs if role_slugs
|
|
993
|
-
body[:role_slug] = role_slug if role_slug
|
|
994
|
-
|
|
995
|
-
request = post_request(
|
|
996
|
-
path: '/user_management/organization_memberships',
|
|
997
|
-
body: body.compact,
|
|
998
|
-
auth: true,
|
|
999
|
-
)
|
|
1000
|
-
|
|
1001
|
-
response = execute_request(request: request)
|
|
1002
|
-
|
|
1003
|
-
WorkOS::OrganizationMembership.new(response.body)
|
|
1004
|
-
end
|
|
1005
|
-
|
|
1006
|
-
# Update an Organization Membership
|
|
1007
|
-
#
|
|
1008
|
-
# @param [String] id The ID of the Organization Membership.
|
|
1009
|
-
# @param [String] role_slug The slug of the role to grant to this membership. (Optional)
|
|
1010
|
-
# @param [Array<String>] role_slugs Array of role slugs to assign to this membership. (Optional)
|
|
1011
|
-
#
|
|
1012
|
-
# @return [WorkOS::OrganizationMembership]
|
|
1013
|
-
def update_organization_membership(id:, role_slug: nil, role_slugs: nil)
|
|
1014
|
-
raise ArgumentError, 'Cannot specify both role_slug and role_slugs' if role_slug && role_slugs
|
|
1015
|
-
|
|
1016
|
-
body = { id: id }
|
|
1017
|
-
|
|
1018
|
-
body[:role_slugs] = role_slugs if role_slugs
|
|
1019
|
-
body[:role_slug] = role_slug if role_slug
|
|
1020
|
-
|
|
1021
|
-
request = put_request(
|
|
1022
|
-
path: "/user_management/organization_memberships/#{id}",
|
|
1023
|
-
body: body.compact,
|
|
1024
|
-
auth: true,
|
|
1025
|
-
)
|
|
1026
|
-
|
|
1027
|
-
response = execute_request(request: request)
|
|
1028
|
-
|
|
1029
|
-
WorkOS::OrganizationMembership.new(response.body)
|
|
1030
|
-
end
|
|
1031
|
-
|
|
1032
|
-
# Delete an Organization Membership
|
|
1033
|
-
#
|
|
1034
|
-
# @param [String] id The unique ID of the Organization Membership.
|
|
1035
|
-
#
|
|
1036
|
-
# @return [Bool] - returns `true` if successful
|
|
1037
|
-
def delete_organization_membership(id:)
|
|
1038
|
-
response = execute_request(
|
|
1039
|
-
request: delete_request(
|
|
1040
|
-
path: "/user_management/organization_memberships/#{id}",
|
|
1041
|
-
auth: true,
|
|
1042
|
-
),
|
|
980
|
+
email: email,
|
|
981
|
+
request_options: request_options
|
|
1043
982
|
)
|
|
983
|
+
}
|
|
984
|
+
WorkOS::Types::ListStruct.from_response(
|
|
985
|
+
response,
|
|
986
|
+
model: WorkOS::UserInvite,
|
|
987
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, email: email},
|
|
988
|
+
fetch_next: fetch_next
|
|
989
|
+
)
|
|
990
|
+
end
|
|
1044
991
|
|
|
1045
|
-
|
|
1046
|
-
|
|
992
|
+
# Send an invitation
|
|
993
|
+
# @param email [String] The email address of the recipient.
|
|
994
|
+
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join.
|
|
995
|
+
# @param role_slug [String, nil] The [role](https://workos.com/docs/authkit/roles) that the recipient will receive when they join the organization in the invitation.
|
|
996
|
+
# @param expires_in_days [Integer, nil] How many days the invitations will be valid for. Must be between 1 and 30 days. Defaults to 7 days if not specified.
|
|
997
|
+
# @param inviter_user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user) who invites the recipient. The invitation email will mention the name of this user.
|
|
998
|
+
# @param locale [WorkOS::Types::CreateUserInviteOptionsLocale, nil] The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization).
|
|
999
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1000
|
+
# @return [WorkOS::UserInvite]
|
|
1001
|
+
def send_invitation(
|
|
1002
|
+
email:,
|
|
1003
|
+
organization_id: nil,
|
|
1004
|
+
role_slug: nil,
|
|
1005
|
+
expires_in_days: nil,
|
|
1006
|
+
inviter_user_id: nil,
|
|
1007
|
+
locale: nil,
|
|
1008
|
+
request_options: {}
|
|
1009
|
+
)
|
|
1010
|
+
body = {
|
|
1011
|
+
"email" => email,
|
|
1012
|
+
"organization_id" => organization_id,
|
|
1013
|
+
"role_slug" => role_slug,
|
|
1014
|
+
"expires_in_days" => expires_in_days,
|
|
1015
|
+
"inviter_user_id" => inviter_user_id,
|
|
1016
|
+
"locale" => locale
|
|
1017
|
+
}.compact
|
|
1018
|
+
response = @client.request(
|
|
1019
|
+
method: :post,
|
|
1020
|
+
path: "/user_management/invitations",
|
|
1021
|
+
auth: true,
|
|
1022
|
+
body: body,
|
|
1023
|
+
request_options: request_options
|
|
1024
|
+
)
|
|
1025
|
+
result = WorkOS::UserInvite.new(response.body)
|
|
1026
|
+
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"])
|
|
1027
|
+
result
|
|
1028
|
+
end
|
|
1047
1029
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1030
|
+
# Find an invitation by token
|
|
1031
|
+
# @param token [String] The token used to accept the invitation.
|
|
1032
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1033
|
+
# @return [WorkOS::UserInvite]
|
|
1034
|
+
def find_invitation_by_token(
|
|
1035
|
+
token:,
|
|
1036
|
+
request_options: {}
|
|
1037
|
+
)
|
|
1038
|
+
response = @client.request(
|
|
1039
|
+
method: :get,
|
|
1040
|
+
path: "/user_management/invitations/by_token/#{WorkOS::Util.encode_path(token)}",
|
|
1041
|
+
auth: true,
|
|
1042
|
+
request_options: request_options
|
|
1043
|
+
)
|
|
1044
|
+
result = WorkOS::UserInvite.new(response.body)
|
|
1045
|
+
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"])
|
|
1046
|
+
result
|
|
1047
|
+
end
|
|
1060
1048
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1049
|
+
# Get an invitation
|
|
1050
|
+
# @param id [String] The unique ID of the invitation.
|
|
1051
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1052
|
+
# @return [WorkOS::UserInvite]
|
|
1053
|
+
def get_invitation(
|
|
1054
|
+
id:,
|
|
1055
|
+
request_options: {}
|
|
1056
|
+
)
|
|
1057
|
+
response = @client.request(
|
|
1058
|
+
method: :get,
|
|
1059
|
+
path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}",
|
|
1060
|
+
auth: true,
|
|
1061
|
+
request_options: request_options
|
|
1062
|
+
)
|
|
1063
|
+
result = WorkOS::UserInvite.new(response.body)
|
|
1064
|
+
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"])
|
|
1065
|
+
result
|
|
1066
|
+
end
|
|
1063
1067
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1068
|
+
# Accept an invitation
|
|
1069
|
+
# @param id [String] The unique ID of the invitation.
|
|
1070
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1071
|
+
# @return [WorkOS::Invitation]
|
|
1072
|
+
def accept_invitation(
|
|
1073
|
+
id:,
|
|
1074
|
+
request_options: {}
|
|
1075
|
+
)
|
|
1076
|
+
response = @client.request(
|
|
1077
|
+
method: :post,
|
|
1078
|
+
path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/accept",
|
|
1079
|
+
auth: true,
|
|
1080
|
+
request_options: request_options
|
|
1081
|
+
)
|
|
1082
|
+
result = WorkOS::Invitation.new(response.body)
|
|
1083
|
+
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"])
|
|
1084
|
+
result
|
|
1085
|
+
end
|
|
1076
1086
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1087
|
+
# Resend an invitation
|
|
1088
|
+
# @param id [String] The unique ID of the invitation.
|
|
1089
|
+
# @param locale [WorkOS::Types::ResendUserInviteOptionsLocale, nil] The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization).
|
|
1090
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1091
|
+
# @return [WorkOS::UserInvite]
|
|
1092
|
+
def resend_invitation(
|
|
1093
|
+
id:,
|
|
1094
|
+
locale: nil,
|
|
1095
|
+
request_options: {}
|
|
1096
|
+
)
|
|
1097
|
+
body = {
|
|
1098
|
+
"locale" => locale
|
|
1099
|
+
}.compact
|
|
1100
|
+
response = @client.request(
|
|
1101
|
+
method: :post,
|
|
1102
|
+
path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/resend",
|
|
1103
|
+
auth: true,
|
|
1104
|
+
body: body,
|
|
1105
|
+
request_options: request_options
|
|
1106
|
+
)
|
|
1107
|
+
result = WorkOS::UserInvite.new(response.body)
|
|
1108
|
+
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"])
|
|
1109
|
+
result
|
|
1110
|
+
end
|
|
1079
1111
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1112
|
+
# Revoke an invitation
|
|
1113
|
+
# @param id [String] The unique ID of the invitation.
|
|
1114
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1115
|
+
# @return [WorkOS::Invitation]
|
|
1116
|
+
def revoke_invitation(
|
|
1117
|
+
id:,
|
|
1118
|
+
request_options: {}
|
|
1119
|
+
)
|
|
1120
|
+
response = @client.request(
|
|
1121
|
+
method: :post,
|
|
1122
|
+
path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/revoke",
|
|
1123
|
+
auth: true,
|
|
1124
|
+
request_options: request_options
|
|
1125
|
+
)
|
|
1126
|
+
result = WorkOS::Invitation.new(response.body)
|
|
1127
|
+
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"])
|
|
1128
|
+
result
|
|
1129
|
+
end
|
|
1092
1130
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1131
|
+
# Update JWT template
|
|
1132
|
+
# @param content [String] The JWT template content as a Liquid template string.
|
|
1133
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1134
|
+
# @return [WorkOS::JWTTemplateResponse]
|
|
1135
|
+
def update_jwt_template(
|
|
1136
|
+
content:,
|
|
1137
|
+
request_options: {}
|
|
1138
|
+
)
|
|
1139
|
+
body = {
|
|
1140
|
+
"content" => content
|
|
1141
|
+
}.compact
|
|
1142
|
+
response = @client.request(
|
|
1143
|
+
method: :put,
|
|
1144
|
+
path: "/user_management/jwt_template",
|
|
1145
|
+
auth: true,
|
|
1146
|
+
body: body,
|
|
1147
|
+
request_options: request_options
|
|
1148
|
+
)
|
|
1149
|
+
result = WorkOS::JWTTemplateResponse.new(response.body)
|
|
1150
|
+
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"])
|
|
1151
|
+
result
|
|
1152
|
+
end
|
|
1095
1153
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1154
|
+
# Create a Magic Auth code
|
|
1155
|
+
# @param email [String] The email address to send the magic code to.
|
|
1156
|
+
# @param invitation_token [String, nil] The invitation token to associate with this magic code.
|
|
1157
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1158
|
+
# @return [WorkOS::MagicAuth]
|
|
1159
|
+
def create_magic_auth(
|
|
1160
|
+
email:,
|
|
1161
|
+
invitation_token: nil,
|
|
1162
|
+
request_options: {}
|
|
1163
|
+
)
|
|
1164
|
+
body = {
|
|
1165
|
+
"email" => email,
|
|
1166
|
+
"invitation_token" => invitation_token
|
|
1167
|
+
}.compact
|
|
1168
|
+
response = @client.request(
|
|
1169
|
+
method: :post,
|
|
1170
|
+
path: "/user_management/magic_auth",
|
|
1171
|
+
auth: true,
|
|
1172
|
+
body: body,
|
|
1173
|
+
request_options: request_options
|
|
1174
|
+
)
|
|
1175
|
+
result = WorkOS::MagicAuth.new(response.body)
|
|
1176
|
+
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"])
|
|
1177
|
+
result
|
|
1178
|
+
end
|
|
1108
1179
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1180
|
+
# Get Magic Auth code details
|
|
1181
|
+
# @param id [String] The unique ID of the Magic Auth code.
|
|
1182
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1183
|
+
# @return [WorkOS::MagicAuth]
|
|
1184
|
+
def get_magic_auth(
|
|
1185
|
+
id:,
|
|
1186
|
+
request_options: {}
|
|
1187
|
+
)
|
|
1188
|
+
response = @client.request(
|
|
1189
|
+
method: :get,
|
|
1190
|
+
path: "/user_management/magic_auth/#{WorkOS::Util.encode_path(id)}",
|
|
1191
|
+
auth: true,
|
|
1192
|
+
request_options: request_options
|
|
1193
|
+
)
|
|
1194
|
+
result = WorkOS::MagicAuth.new(response.body)
|
|
1195
|
+
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"])
|
|
1196
|
+
result
|
|
1197
|
+
end
|
|
1111
1198
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1199
|
+
# List organization memberships
|
|
1200
|
+
# @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"`.
|
|
1201
|
+
# @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"`.
|
|
1202
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1203
|
+
# @param order [WorkOS::Types::UserManagementOrganizationMembershipOrder, 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). Defaults to descending.
|
|
1204
|
+
# @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
1205
|
+
# @param statuses [Array<WorkOS::Types::UserManagementOrganizationMembershipStatuses>, nil] Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`.
|
|
1206
|
+
# @param user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
1207
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1208
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembership>]
|
|
1209
|
+
def list_organization_memberships(
|
|
1210
|
+
before: nil,
|
|
1211
|
+
after: nil,
|
|
1212
|
+
limit: nil,
|
|
1213
|
+
order: "desc",
|
|
1214
|
+
organization_id: nil,
|
|
1215
|
+
statuses: nil,
|
|
1216
|
+
user_id: nil,
|
|
1217
|
+
request_options: {}
|
|
1218
|
+
)
|
|
1219
|
+
params = {
|
|
1220
|
+
"before" => before,
|
|
1221
|
+
"after" => after,
|
|
1222
|
+
"limit" => limit,
|
|
1223
|
+
"order" => order,
|
|
1224
|
+
"organization_id" => organization_id,
|
|
1225
|
+
"statuses" => statuses,
|
|
1226
|
+
"user_id" => user_id
|
|
1227
|
+
}.compact
|
|
1228
|
+
response = @client.request(
|
|
1229
|
+
method: :get,
|
|
1230
|
+
path: "/user_management/organization_memberships",
|
|
1231
|
+
auth: true,
|
|
1232
|
+
params: params,
|
|
1233
|
+
request_options: request_options
|
|
1234
|
+
)
|
|
1235
|
+
fetch_next = ->(cursor) {
|
|
1236
|
+
list_organization_memberships(
|
|
1237
|
+
before: before,
|
|
1238
|
+
after: cursor,
|
|
1239
|
+
limit: limit,
|
|
1240
|
+
order: order,
|
|
1241
|
+
organization_id: organization_id,
|
|
1242
|
+
statuses: statuses,
|
|
1243
|
+
user_id: user_id,
|
|
1244
|
+
request_options: request_options
|
|
1133
1245
|
)
|
|
1246
|
+
}
|
|
1247
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1248
|
+
response,
|
|
1249
|
+
model: WorkOS::UserOrganizationMembership,
|
|
1250
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, statuses: statuses, user_id: user_id},
|
|
1251
|
+
fetch_next: fetch_next
|
|
1252
|
+
)
|
|
1253
|
+
end
|
|
1134
1254
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1255
|
+
# Create an organization membership
|
|
1256
|
+
# @param user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user).
|
|
1257
|
+
# @param organization_id [String] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to.
|
|
1258
|
+
# @param role_slug [String, nil] A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`.
|
|
1259
|
+
# @param role_slugs [Array<String>, nil] An array of role identifiers. Limited to one role when Multiple Roles is disabled. Mutually exclusive with `role_slug`.
|
|
1260
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1261
|
+
# @return [WorkOS::OrganizationMembership]
|
|
1262
|
+
def create_organization_membership(
|
|
1263
|
+
user_id:,
|
|
1264
|
+
organization_id:,
|
|
1265
|
+
role_slug: nil,
|
|
1266
|
+
role_slugs: nil,
|
|
1267
|
+
role: nil,
|
|
1268
|
+
request_options: {}
|
|
1269
|
+
)
|
|
1270
|
+
body = {
|
|
1271
|
+
"user_id" => user_id,
|
|
1272
|
+
"organization_id" => organization_id,
|
|
1273
|
+
"role_slug" => role_slug,
|
|
1274
|
+
"role_slugs" => role_slugs
|
|
1275
|
+
}.compact
|
|
1276
|
+
if role
|
|
1277
|
+
case role[:type]
|
|
1278
|
+
when "single"
|
|
1279
|
+
body["role_slug"] = role[:role_slug]
|
|
1280
|
+
when "multiple"
|
|
1281
|
+
body["role_slugs"] = role[:role_slugs]
|
|
1139
1282
|
end
|
|
1140
|
-
|
|
1141
|
-
WorkOS::Types::ListStruct.new(
|
|
1142
|
-
data: invitations,
|
|
1143
|
-
list_metadata: parsed_response['list_metadata'],
|
|
1144
|
-
)
|
|
1145
1283
|
end
|
|
1284
|
+
response = @client.request(
|
|
1285
|
+
method: :post,
|
|
1286
|
+
path: "/user_management/organization_memberships",
|
|
1287
|
+
auth: true,
|
|
1288
|
+
body: body,
|
|
1289
|
+
request_options: request_options
|
|
1290
|
+
)
|
|
1291
|
+
result = WorkOS::OrganizationMembership.new(response.body)
|
|
1292
|
+
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"])
|
|
1293
|
+
result
|
|
1294
|
+
end
|
|
1146
1295
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
inviter_user_id: inviter_user_id,
|
|
1166
|
-
role_slug: role_slug,
|
|
1167
|
-
}.compact,
|
|
1168
|
-
auth: true,
|
|
1169
|
-
),
|
|
1170
|
-
)
|
|
1296
|
+
# Get an organization membership
|
|
1297
|
+
# @param id [String] The unique ID of the organization membership.
|
|
1298
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1299
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
1300
|
+
def get_organization_membership(
|
|
1301
|
+
id:,
|
|
1302
|
+
request_options: {}
|
|
1303
|
+
)
|
|
1304
|
+
response = @client.request(
|
|
1305
|
+
method: :get,
|
|
1306
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1307
|
+
auth: true,
|
|
1308
|
+
request_options: request_options
|
|
1309
|
+
)
|
|
1310
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1311
|
+
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"])
|
|
1312
|
+
result
|
|
1313
|
+
end
|
|
1171
1314
|
|
|
1172
|
-
|
|
1315
|
+
# Update an organization membership
|
|
1316
|
+
# @param id [String] The unique ID of the organization membership.
|
|
1317
|
+
# @param role_slug [String, nil] A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`.
|
|
1318
|
+
# @param role_slugs [Array<String>, nil] An array of role identifiers. Limited to one role when Multiple Roles is disabled. Mutually exclusive with `role_slug`.
|
|
1319
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1320
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
1321
|
+
def update_organization_membership(
|
|
1322
|
+
id:,
|
|
1323
|
+
role_slug: nil,
|
|
1324
|
+
role_slugs: nil,
|
|
1325
|
+
role: nil,
|
|
1326
|
+
request_options: {}
|
|
1327
|
+
)
|
|
1328
|
+
body = {
|
|
1329
|
+
"role_slug" => role_slug,
|
|
1330
|
+
"role_slugs" => role_slugs
|
|
1331
|
+
}.compact
|
|
1332
|
+
if role
|
|
1333
|
+
case role[:type]
|
|
1334
|
+
when "single"
|
|
1335
|
+
body["role_slug"] = role[:role_slug]
|
|
1336
|
+
when "multiple"
|
|
1337
|
+
body["role_slugs"] = role[:role_slugs]
|
|
1338
|
+
end
|
|
1173
1339
|
end
|
|
1340
|
+
response = @client.request(
|
|
1341
|
+
method: :put,
|
|
1342
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1343
|
+
auth: true,
|
|
1344
|
+
body: body,
|
|
1345
|
+
request_options: request_options
|
|
1346
|
+
)
|
|
1347
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1348
|
+
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"])
|
|
1349
|
+
result
|
|
1350
|
+
end
|
|
1174
1351
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1352
|
+
# Delete an organization membership
|
|
1353
|
+
# @param id [String] The unique ID of the organization membership.
|
|
1354
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1355
|
+
# @return [void]
|
|
1356
|
+
def delete_organization_membership(
|
|
1357
|
+
id:,
|
|
1358
|
+
request_options: {}
|
|
1359
|
+
)
|
|
1360
|
+
@client.request(
|
|
1361
|
+
method: :delete,
|
|
1362
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}",
|
|
1363
|
+
auth: true,
|
|
1364
|
+
request_options: request_options
|
|
1365
|
+
)
|
|
1366
|
+
nil
|
|
1367
|
+
end
|
|
1190
1368
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1369
|
+
# Deactivate an organization membership
|
|
1370
|
+
# @param id [String] The unique ID of the organization membership.
|
|
1371
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1372
|
+
# @return [WorkOS::OrganizationMembership]
|
|
1373
|
+
def deactivate_organization_membership(
|
|
1374
|
+
id:,
|
|
1375
|
+
request_options: {}
|
|
1376
|
+
)
|
|
1377
|
+
response = @client.request(
|
|
1378
|
+
method: :put,
|
|
1379
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/deactivate",
|
|
1380
|
+
auth: true,
|
|
1381
|
+
request_options: request_options
|
|
1382
|
+
)
|
|
1383
|
+
result = WorkOS::OrganizationMembership.new(response.body)
|
|
1384
|
+
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"])
|
|
1385
|
+
result
|
|
1386
|
+
end
|
|
1201
1387
|
|
|
1202
|
-
|
|
1388
|
+
# Reactivate an organization membership
|
|
1389
|
+
# @param id [String] The unique ID of the organization membership.
|
|
1390
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1391
|
+
# @return [WorkOS::UserOrganizationMembership]
|
|
1392
|
+
def reactivate_organization_membership(
|
|
1393
|
+
id:,
|
|
1394
|
+
request_options: {}
|
|
1395
|
+
)
|
|
1396
|
+
response = @client.request(
|
|
1397
|
+
method: :put,
|
|
1398
|
+
path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/reactivate",
|
|
1399
|
+
auth: true,
|
|
1400
|
+
request_options: request_options
|
|
1401
|
+
)
|
|
1402
|
+
result = WorkOS::UserOrganizationMembership.new(response.body)
|
|
1403
|
+
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"])
|
|
1404
|
+
result
|
|
1405
|
+
end
|
|
1203
1406
|
|
|
1204
|
-
|
|
1205
|
-
|
|
1407
|
+
# Create a redirect URI
|
|
1408
|
+
# @param uri [String] The redirect URI to create.
|
|
1409
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1410
|
+
# @return [WorkOS::RedirectUri]
|
|
1411
|
+
def create_redirect_uri(
|
|
1412
|
+
uri:,
|
|
1413
|
+
request_options: {}
|
|
1414
|
+
)
|
|
1415
|
+
body = {
|
|
1416
|
+
"uri" => uri
|
|
1417
|
+
}.compact
|
|
1418
|
+
response = @client.request(
|
|
1419
|
+
method: :post,
|
|
1420
|
+
path: "/user_management/redirect_uris",
|
|
1421
|
+
auth: true,
|
|
1422
|
+
body: body,
|
|
1423
|
+
request_options: request_options
|
|
1424
|
+
)
|
|
1425
|
+
result = WorkOS::RedirectUri.new(response.body)
|
|
1426
|
+
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"])
|
|
1427
|
+
result
|
|
1428
|
+
end
|
|
1206
1429
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1430
|
+
# List authorized applications
|
|
1431
|
+
# @param user_id [String] The ID of the user.
|
|
1432
|
+
# @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"`.
|
|
1433
|
+
# @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"`.
|
|
1434
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1435
|
+
# @param order [WorkOS::Types::UserManagementUsersAuthorizedApplicationsOrder, 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). Defaults to descending.
|
|
1436
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1437
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizedConnectApplicationListData>]
|
|
1438
|
+
def list_user_authorized_applications(
|
|
1439
|
+
user_id:,
|
|
1440
|
+
before: nil,
|
|
1441
|
+
after: nil,
|
|
1442
|
+
limit: nil,
|
|
1443
|
+
order: "desc",
|
|
1444
|
+
request_options: {}
|
|
1445
|
+
)
|
|
1446
|
+
params = {
|
|
1447
|
+
"before" => before,
|
|
1448
|
+
"after" => after,
|
|
1449
|
+
"limit" => limit,
|
|
1450
|
+
"order" => order
|
|
1451
|
+
}.compact
|
|
1452
|
+
response = @client.request(
|
|
1453
|
+
method: :get,
|
|
1454
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/authorized_applications",
|
|
1455
|
+
auth: true,
|
|
1456
|
+
params: params,
|
|
1457
|
+
request_options: request_options
|
|
1458
|
+
)
|
|
1459
|
+
fetch_next = ->(cursor) {
|
|
1460
|
+
list_user_authorized_applications(
|
|
1461
|
+
user_id: user_id,
|
|
1462
|
+
before: before,
|
|
1463
|
+
after: cursor,
|
|
1464
|
+
limit: limit,
|
|
1465
|
+
order: order,
|
|
1466
|
+
request_options: request_options
|
|
1216
1467
|
)
|
|
1468
|
+
}
|
|
1469
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1470
|
+
response,
|
|
1471
|
+
model: WorkOS::AuthorizedConnectApplicationListData,
|
|
1472
|
+
filters: {user_id: user_id, before: before, limit: limit, order: order},
|
|
1473
|
+
fetch_next: fetch_next
|
|
1474
|
+
)
|
|
1475
|
+
end
|
|
1217
1476
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1477
|
+
# Delete an authorized application
|
|
1478
|
+
# @param application_id [String] The ID or client ID of the application.
|
|
1479
|
+
# @param user_id [String] The ID of the user.
|
|
1480
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1481
|
+
# @return [void]
|
|
1482
|
+
def delete_user_authorized_application(
|
|
1483
|
+
application_id:,
|
|
1484
|
+
user_id:,
|
|
1485
|
+
request_options: {}
|
|
1486
|
+
)
|
|
1487
|
+
@client.request(
|
|
1488
|
+
method: :delete,
|
|
1489
|
+
path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/authorized_applications/#{WorkOS::Util.encode_path(application_id)}",
|
|
1490
|
+
auth: true,
|
|
1491
|
+
request_options: request_options
|
|
1492
|
+
)
|
|
1493
|
+
nil
|
|
1494
|
+
end
|
|
1224
1495
|
|
|
1225
|
-
|
|
1226
|
-
|
|
1496
|
+
# @oagen-ignore-start — non-spec helpers (hand-maintained)
|
|
1497
|
+
# H13 — Build the JWKS URL for a given client_id (no HTTP call).
|
|
1498
|
+
# Pair with #get_jwks (generated) to fetch the keyset.
|
|
1499
|
+
def get_jwks_url(client_id: nil)
|
|
1500
|
+
cid = client_id || @client.client_id
|
|
1501
|
+
raise ArgumentError, "client_id is required" if cid.nil? || cid.empty?
|
|
1502
|
+
base = @client.base_url
|
|
1503
|
+
URI.join(base, "/sso/jwks/#{WorkOS::Util.encode_path(cid)}").to_s
|
|
1504
|
+
end
|
|
1227
1505
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1506
|
+
# H09 — Build an AuthKit authorization URL (client-side, no HTTP call).
|
|
1507
|
+
# Overrides the generated get_authorization_url which hits the API.
|
|
1508
|
+
def get_authorization_url(redirect_uri:, client_id: nil, provider: nil, connection_id: nil,
|
|
1509
|
+
organization_id: nil, domain_hint: nil, login_hint: nil,
|
|
1510
|
+
state: nil, screen_hint: nil, code_challenge: nil,
|
|
1511
|
+
code_challenge_method: nil, prompt: nil, **)
|
|
1512
|
+
cid = client_id || @client.client_id
|
|
1513
|
+
raise ArgumentError, "client_id is required (set on Client or pass explicitly)" if cid.nil? || cid.empty?
|
|
1514
|
+
raise ArgumentError, "provider, connection_id, or organization_id required" if provider.nil? && connection_id.nil? && organization_id.nil?
|
|
1515
|
+
params = {
|
|
1516
|
+
"client_id" => cid,
|
|
1517
|
+
"redirect_uri" => redirect_uri,
|
|
1518
|
+
"response_type" => "code",
|
|
1519
|
+
"provider" => provider,
|
|
1520
|
+
"connection_id" => connection_id,
|
|
1521
|
+
"organization_id" => organization_id,
|
|
1522
|
+
"domain_hint" => domain_hint,
|
|
1523
|
+
"login_hint" => login_hint,
|
|
1524
|
+
"state" => state,
|
|
1525
|
+
"screen_hint" => screen_hint,
|
|
1526
|
+
"code_challenge" => code_challenge,
|
|
1527
|
+
"code_challenge_method" => code_challenge_method,
|
|
1528
|
+
"prompt" => prompt
|
|
1529
|
+
}.compact
|
|
1530
|
+
build_url("/user_management/authorize", params)
|
|
1531
|
+
end
|
|
1230
1532
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1533
|
+
# H10 — AuthKit authorization URL with auto-generated PKCE + state.
|
|
1534
|
+
# Returns [url, code_verifier, state].
|
|
1535
|
+
def get_authorization_url_with_pkce(redirect_uri:, client_id: nil, **opts)
|
|
1536
|
+
pair = WorkOS::PKCE.generate_pair
|
|
1537
|
+
state = opts.delete(:state) || WorkOS::PKCE.generate_code_verifier
|
|
1538
|
+
url = get_authorization_url(
|
|
1539
|
+
redirect_uri: redirect_uri,
|
|
1540
|
+
client_id: client_id,
|
|
1541
|
+
state: state,
|
|
1542
|
+
code_challenge: pair[:code_challenge],
|
|
1543
|
+
code_challenge_method: "S256",
|
|
1544
|
+
**opts
|
|
1235
1545
|
)
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
' or provider is required.'
|
|
1239
|
-
end
|
|
1546
|
+
[url, pair[:code_verifier], state]
|
|
1547
|
+
end
|
|
1240
1548
|
|
|
1241
|
-
|
|
1549
|
+
# H11 — Exchange a code for tokens with PKCE support (public client; no secret).
|
|
1550
|
+
# NOTE: Unlike the other authenticate_with_* helpers, this does NOT delegate to
|
|
1551
|
+
# create_authenticate because PKCE is a public-client flow that requires
|
|
1552
|
+
# auth: false (no Bearer token / API key in the Authorization header).
|
|
1553
|
+
def authenticate_with_code_pkce(code:, code_verifier:, client_id: nil, ip_address: nil, user_agent: nil, request_options: {})
|
|
1554
|
+
cid = client_id || @client.client_id
|
|
1555
|
+
raise ArgumentError, "client_id is required" if cid.nil? || cid.empty?
|
|
1556
|
+
body = {
|
|
1557
|
+
"grant_type" => "authorization_code",
|
|
1558
|
+
"client_id" => cid,
|
|
1559
|
+
"code" => code,
|
|
1560
|
+
"code_verifier" => code_verifier,
|
|
1561
|
+
"ip_address" => ip_address,
|
|
1562
|
+
"user_agent" => user_agent
|
|
1563
|
+
}.compact
|
|
1564
|
+
response = @client.request(method: :post, path: "/user_management/authenticate", auth: false, body: body, request_options: request_options)
|
|
1565
|
+
WorkOS::AuthenticateResponse.new(response.body)
|
|
1566
|
+
end
|
|
1242
1567
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1568
|
+
# H12 — Initiate the OAuth 2.0 device authorization flow.
|
|
1569
|
+
# @return [WorkOS::DeviceAuthorizationResponse]
|
|
1570
|
+
def authorize_device(client_id: nil, request_options: {})
|
|
1571
|
+
cid = client_id || @client.client_id
|
|
1572
|
+
raise ArgumentError, "client_id is required" if cid.nil? || cid.empty?
|
|
1573
|
+
body = {"client_id" => cid}
|
|
1574
|
+
response = @client.request(method: :post, path: "/oauth2/device_authorization", auth: false, body: body, request_options: request_options)
|
|
1575
|
+
WorkOS::DeviceAuthorizationResponse.new(response.body)
|
|
1576
|
+
end
|
|
1246
1577
|
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1578
|
+
# H12 device-code → token exchange is provided by the generated
|
|
1579
|
+
# `authenticate_with_device_code` method (wraps /user_management/authenticate);
|
|
1580
|
+
# no hand-maintained override is needed here.
|
|
1581
|
+
|
|
1582
|
+
# Build the AuthKit logout redirect URL (client-side, no HTTP call).
|
|
1583
|
+
# @param session_id [String] The session ID (from the `sid` claim of the access token).
|
|
1584
|
+
# @param return_to [String, nil] URL to redirect the user to after session revocation.
|
|
1585
|
+
# @return [String]
|
|
1586
|
+
def get_logout_url(session_id:, return_to: nil)
|
|
1587
|
+
params = {"session_id" => session_id}
|
|
1588
|
+
params["return_to"] = return_to if return_to
|
|
1589
|
+
build_url("/user_management/sessions/logout", params)
|
|
1590
|
+
end
|
|
1251
1591
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1592
|
+
private
|
|
1593
|
+
|
|
1594
|
+
def build_url(path, params)
|
|
1595
|
+
base = @client.base_url
|
|
1596
|
+
uri = URI.join(base, path)
|
|
1597
|
+
uri.query = URI.encode_www_form(params)
|
|
1598
|
+
uri.to_s
|
|
1255
1599
|
end
|
|
1600
|
+
# @oagen-ignore-end
|
|
1256
1601
|
end
|
|
1257
|
-
# rubocop:enable Metrics/ModuleLength
|
|
1258
1602
|
end
|