Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
* [#686](https://github.com/workos/workos-python/pull/686) feat(generated)!: regenerate from spec (3 changes)

**Features**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Added model `SendRadarSmsChallenge`
* Added model `SendRadarSmsChallengeResponse`
* Added model `UrnWorkosOAuthGrantTypeRadarEmailChallengeCodeSessionAuthenticateRequest`
* Added model `UrnWorkosOAuthGrantTypeRadarSmsChallengeCodeSessionAuthenticateRequest`
* Added model `MagicAuthSendMagicAuthCodeAndReturnResponse`
* Added model `UserCreateResponse`
* Added `ip_address` to `CreateMagicCodeAndReturn`
* Added `user_agent` to `CreateMagicCodeAndReturn`
* Added `radar_auth_attempt_id` to `CreateMagicCodeAndReturn`
* Added `signals_id` to `CreateMagicCodeAndReturn`
* Added `ip_address` to `CreateUser`
* Added `user_agent` to `CreateUser`
* Added `signals_id` to `CreateUser`
* Added `signals_id` to `AuthorizationCodeSessionAuthenticateRequest`
* Added `signals_id` to `PasswordSessionAuthenticateRequest`
* Added `radar_auth_attempt_id` to `PasswordSessionAuthenticateRequest`
* Added `radar_auth_attempt_id` to `UrnWorkosOAuthGrantTypeMagicAuthCodeSessionAuthenticateRequest`
* Added endpoint `POST /user_management/radar_challenges`
* **[radar](https://workos.com/docs/reference/radar)**:
* Added `signals_id` to `RadarStandaloneAssessRequest`

**Fixes**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed request body for `UserManagementAuthentication.authenticate`
* Changed response of `UserManagementUsers.create` from `User` to `UserCreateResponse`
* Changed response of `UserManagementMagicAuth.sendMagicAuthCodeAndReturn` from `MagicAuth` to `MagicAuthSendMagicAuthCodeAndReturnResponse`
15 changes: 14 additions & 1 deletion .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"language": "python",
"generatedAt": "2026-07-02T14:58:45.916Z",
"generatedAt": "2026-07-02T17:29:55.736Z",
"files": [
"src/workos/_client.py",
"src/workos/admin_portal/__init__.py",
Expand Down Expand Up @@ -661,16 +661,21 @@
"src/workos/user_management/models/jwt_template_response.py",
"src/workos/user_management/models/magic_auth.py",
"src/workos/user_management/models/magic_auth_code_session_authenticate_request.py",
"src/workos/user_management/models/magic_auth_send_magic_auth_code_and_return_response.py",
"src/workos/user_management/models/mfa_totp_session_authenticate_request.py",
"src/workos/user_management/models/organization_selection_session_authenticate_request.py",
"src/workos/user_management/models/password_reset.py",
"src/workos/user_management/models/password_session_authenticate_request.py",
"src/workos/user_management/models/radar_email_challenge_code_session_authenticate_request.py",
"src/workos/user_management/models/radar_sms_challenge_code_session_authenticate_request.py",
"src/workos/user_management/models/redirect_uri.py",
"src/workos/user_management/models/refresh_token_session_authenticate_request.py",
"src/workos/user_management/models/resend_user_invite_options.py",
"src/workos/user_management/models/reset_password_response.py",
"src/workos/user_management/models/revoke_session.py",
"src/workos/user_management/models/send_email_change.py",
"src/workos/user_management/models/send_radar_sms_challenge.py",
"src/workos/user_management/models/send_radar_sms_challenge_response.py",
"src/workos/user_management/models/send_verification_email_response.py",
"src/workos/user_management/models/sso_device_authorization_request.py",
"src/workos/user_management/models/update_jwt_template.py",
Expand All @@ -679,6 +684,7 @@
"src/workos/user_management/models/user_api_key_owner.py",
"src/workos/user_management/models/user_api_key_with_value.py",
"src/workos/user_management/models/user_api_key_with_value_owner.py",
"src/workos/user_management/models/user_create_response.py",
"src/workos/user_management/models/user_identities_get_item.py",
"src/workos/user_management/models/user_invite.py",
"src/workos/user_management/models/user_management_authentication_provider.py",
Expand Down Expand Up @@ -1042,6 +1048,7 @@
"tests/fixtures/magic_auth_code_session_authenticate_request.json",
"tests/fixtures/magic_auth_created.json",
"tests/fixtures/magic_auth_created_data.json",
"tests/fixtures/magic_auth_send_magic_auth_code_and_return_response.json",
"tests/fixtures/mfa_totp_session_authenticate_request.json",
"tests/fixtures/new_connect_application_secret.json",
"tests/fixtures/object_metadata.json",
Expand Down Expand Up @@ -1110,7 +1117,9 @@
"tests/fixtures/pipes_connected_account_reauthorization_needed.json",
"tests/fixtures/portal_link_response.json",
"tests/fixtures/profile.json",
"tests/fixtures/radar_email_challenge_code_session_authenticate_request.json",
"tests/fixtures/radar_list_entry_already_present_response.json",
"tests/fixtures/radar_sms_challenge_code_session_authenticate_request.json",
"tests/fixtures/radar_standalone_assess_request.json",
"tests/fixtures/radar_standalone_delete_radar_list_entry_request.json",
"tests/fixtures/radar_standalone_response.json",
Expand All @@ -1135,6 +1144,8 @@
"tests/fixtures/role_updated.json",
"tests/fixtures/role_updated_data.json",
"tests/fixtures/send_email_change.json",
"tests/fixtures/send_radar_sms_challenge.json",
"tests/fixtures/send_radar_sms_challenge_response.json",
"tests/fixtures/send_verification_email_response.json",
"tests/fixtures/session_created.json",
"tests/fixtures/session_created_data.json",
Expand Down Expand Up @@ -1178,6 +1189,7 @@
"tests/fixtures/user_authentication_factor_enroll_response.json",
"tests/fixtures/user_consent_option.json",
"tests/fixtures/user_consent_option_choice.json",
"tests/fixtures/user_create_response.json",
"tests/fixtures/user_created.json",
"tests/fixtures/user_deleted.json",
"tests/fixtures/user_identities_get_item.json",
Expand Down Expand Up @@ -1252,6 +1264,7 @@
"tests/test_pipes_models_round_trip.py",
"tests/test_pipes_provider.py",
"tests/test_radar.py",
"tests/test_radar_models_round_trip.py",
"tests/test_sso.py",
"tests/test_user_management.py",
"tests/test_user_management_models_round_trip.py",
Expand Down
34 changes: 24 additions & 10 deletions src/workos/radar/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def create_attempt(
email: str,
auth_method: Union[RadarStandaloneAssessRequestAuthMethod, str],
action: Union[RadarStandaloneAssessRequestAction, str],
signals_id: Optional[str] = None,
request_options: Optional[RequestOptions] = None,
) -> RadarStandaloneResponse:
"""Create an attempt
Expand All @@ -44,6 +45,7 @@ def create_attempt(
email: The email address of the user making the request.
auth_method: The authentication method being used.
action: The action being performed.
signals_id: An optional Radar signals ID for the request.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
Expand All @@ -56,11 +58,16 @@ def create_attempt(
ServerError: If the server returns a 5xx error.
"""
body: Dict[str, Any] = {
"ip_address": ip_address,
"user_agent": user_agent,
"email": email,
"auth_method": enum_value(auth_method),
"action": enum_value(action),
k: v
for k, v in {
"ip_address": ip_address,
"user_agent": user_agent,
"email": email,
"auth_method": enum_value(auth_method),
"action": enum_value(action),
"signals_id": signals_id,
}.items()
if v is not None
}
return self._client.request(
method="post",
Expand Down Expand Up @@ -198,6 +205,7 @@ async def create_attempt(
email: str,
auth_method: Union[RadarStandaloneAssessRequestAuthMethod, str],
action: Union[RadarStandaloneAssessRequestAction, str],
signals_id: Optional[str] = None,
request_options: Optional[RequestOptions] = None,
) -> RadarStandaloneResponse:
"""Create an attempt
Expand All @@ -210,6 +218,7 @@ async def create_attempt(
email: The email address of the user making the request.
auth_method: The authentication method being used.
action: The action being performed.
signals_id: An optional Radar signals ID for the request.
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.

Returns:
Expand All @@ -222,11 +231,16 @@ async def create_attempt(
ServerError: If the server returns a 5xx error.
"""
body: Dict[str, Any] = {
"ip_address": ip_address,
"user_agent": user_agent,
"email": email,
"auth_method": enum_value(auth_method),
"action": enum_value(action),
k: v
for k, v in {
"ip_address": ip_address,
"user_agent": user_agent,
"email": email,
"auth_method": enum_value(auth_method),
"action": enum_value(action),
"signals_id": signals_id,
}.items()
if v is not None
}
return await self._client.request(
method="post",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict
from typing import Any, Dict, Optional
from workos._types import _raise_deserialize_error
from workos.common.models.radar_standalone_assess_request_action import (
RadarStandaloneAssessRequestAction,
Expand All @@ -28,6 +28,8 @@ class RadarStandaloneAssessRequest:
"""The authentication method being used."""
action: "RadarStandaloneAssessRequestAction"
"""The action being performed."""
signals_id: Optional[str] = None
"""An optional Radar signals ID for the request."""

@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "RadarStandaloneAssessRequest":
Expand All @@ -39,6 +41,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "RadarStandaloneAssessRequest":
email=data["email"],
auth_method=RadarStandaloneAssessRequestAuthMethod(data["auth_method"]),
action=RadarStandaloneAssessRequestAction(data["action"]),
signals_id=data.get("signals_id"),
)
except (KeyError, ValueError) as e:
_raise_deserialize_error("RadarStandaloneAssessRequest", e)
Expand All @@ -57,4 +60,6 @@ def to_dict(self) -> Dict[str, Any]:
result["action"] = (
self.action.value if isinstance(self.action, Enum) else self.action
)
if self.signals_id is not None:
result["signals_id"] = self.signals_id
return result
Loading