workos 5.31.0__tar.gz → 5.31.2__tar.gz
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.
- {workos-5.31.0 → workos-5.31.2}/PKG-INFO +1 -1
- {workos-5.31.0 → workos-5.31.2}/tests/test_sync_http_client.py +52 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_user_management_revoke_session.py +2 -23
- {workos-5.31.0 → workos-5.31.2}/workos/__about__.py +1 -1
- {workos-5.31.0 → workos-5.31.2}/workos/exceptions.py +18 -0
- {workos-5.31.0 → workos-5.31.2}/workos/user_management.py +5 -11
- {workos-5.31.0 → workos-5.31.2}/workos/utils/_base_http_client.py +6 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/PKG-INFO +1 -1
- {workos-5.31.0 → workos-5.31.2}/LICENSE +0 -0
- {workos-5.31.0 → workos-5.31.2}/README.md +0 -0
- {workos-5.31.0 → workos-5.31.2}/setup.cfg +0 -0
- {workos-5.31.0 → workos-5.31.2}/setup.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_async_http_client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_audit_logs.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_directory_sync.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_events.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_fga.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_mfa.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_organization_domains.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_organizations.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_passwordless.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_portal.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_session.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_sso.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_user_management.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_user_management_list_sessions.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_vault.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_webhooks.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/tests/test_widgets.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/_base_client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/_client_configuration.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/async_client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/audit_logs.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/directory_sync.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/events.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/fga.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/mfa.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/organization_domains.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/organizations.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/passwordless.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/portal.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/py.typed +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/session.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/sso.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_event.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_event_actor.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_event_context.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_event_target.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_export.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/audit_logs/audit_log_metadata.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/directory.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/directory_group.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/directory_state.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/directory_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/directory_user.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/directory_sync/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/authentication_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/connection_payload_with_legacy_fields.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_group_membership_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_group_with_previous_attributes.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_payload_with_legacy_fields.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_user_with_previous_attributes.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/event.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/event_model.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/event_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/organization_domain_verification_failed_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/previous_attributes.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/events/session_created_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/feature_flags/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/feature_flags/feature_flag.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/feature_flags/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/authorization_resource_types.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/authorization_resources.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/check.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/warnings.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/fga/warrant.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/list_resource.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/metadata.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/authentication_challenge.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/authentication_challenge_verification_response.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/authentication_factor.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/authentication_factor_totp_and_challenge_response.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/mfa/enroll_authentication_factor_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organization_domains/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organization_domains/organization_domain.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organizations/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organizations/domain_data_input.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organizations/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organizations/organization.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/organizations/organization_common.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/passwordless/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/passwordless/passwordless_session.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/passwordless/passwordless_session_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/portal/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/portal/portal_link.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/portal/portal_link_intent.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/portal/portal_link_intent_options.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/roles/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/roles/role.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/sso/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/sso/connection.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/sso/connection_domain.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/sso/profile.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/sso/sso_provider_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/authenticate_with_common.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/authentication_response.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/email_verification.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/impersonator.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/invitation.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/list_filters.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/magic_auth.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/oauth_tokens.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/organization_membership.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/password_hash_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/password_reset.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/screen_hint.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/session.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/user.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/user_management/user_management_provider_type.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/vault/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/vault/key.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/vault/object.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/webhooks/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/webhooks/webhook.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/webhooks/webhook_model.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/webhooks/webhook_payload.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/widgets/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/widgets/widget_scope.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/widgets/widget_token_response.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/types/workos_model.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/typing/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/typing/literals.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/typing/sync_or_async.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/typing/untyped_literal.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/typing/webhooks.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/utils/__init__.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/utils/crypto_provider.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/utils/http_client.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/utils/pagination_order.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/utils/request_helper.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/vault.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/webhooks.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos/widgets.py +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/SOURCES.txt +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/dependency_links.txt +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/not-zip-safe +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/requires.txt +0 -0
- {workos-5.31.0 → workos-5.31.2}/workos.egg-info/top_level.txt +0 -0
|
@@ -10,6 +10,7 @@ from workos.exceptions import (
|
|
|
10
10
|
BadRequestException,
|
|
11
11
|
BaseRequestException,
|
|
12
12
|
ConflictException,
|
|
13
|
+
EmailVerificationRequiredException,
|
|
13
14
|
ServerException,
|
|
14
15
|
)
|
|
15
16
|
from workos.utils.http_client import SyncHTTPClient
|
|
@@ -263,6 +264,57 @@ class TestSyncHTTPClient(object):
|
|
|
263
264
|
assert str(ex) == "(message=No message, request_id=request-123)"
|
|
264
265
|
assert ex.__class__ == ConflictException
|
|
265
266
|
|
|
267
|
+
def test_email_verification_required_exception(self):
|
|
268
|
+
request_id = "request-123"
|
|
269
|
+
email_verification_id = "email_verification_01J6K4PMSWQXVFGF5ZQJXC6VC8"
|
|
270
|
+
|
|
271
|
+
self.http_client._client.request = MagicMock(
|
|
272
|
+
return_value=httpx.Response(
|
|
273
|
+
status_code=403,
|
|
274
|
+
json={
|
|
275
|
+
"message": "Please verify your email to authenticate via password.",
|
|
276
|
+
"code": "email_verification_required",
|
|
277
|
+
"email_verification_id": email_verification_id,
|
|
278
|
+
},
|
|
279
|
+
headers={"X-Request-ID": request_id},
|
|
280
|
+
),
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
try:
|
|
284
|
+
self.http_client.request("bad_place")
|
|
285
|
+
except EmailVerificationRequiredException as ex:
|
|
286
|
+
assert (
|
|
287
|
+
ex.message == "Please verify your email to authenticate via password."
|
|
288
|
+
)
|
|
289
|
+
assert ex.code == "email_verification_required"
|
|
290
|
+
assert ex.email_verification_id == email_verification_id
|
|
291
|
+
assert ex.request_id == request_id
|
|
292
|
+
assert ex.__class__ == EmailVerificationRequiredException
|
|
293
|
+
assert isinstance(ex, AuthorizationException)
|
|
294
|
+
|
|
295
|
+
def test_regular_authorization_exception_still_raised(self):
|
|
296
|
+
request_id = "request-123"
|
|
297
|
+
|
|
298
|
+
self.http_client._client.request = MagicMock(
|
|
299
|
+
return_value=httpx.Response(
|
|
300
|
+
status_code=403,
|
|
301
|
+
json={
|
|
302
|
+
"message": "You do not have permission to access this resource.",
|
|
303
|
+
"code": "forbidden",
|
|
304
|
+
},
|
|
305
|
+
headers={"X-Request-ID": request_id},
|
|
306
|
+
),
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
try:
|
|
310
|
+
self.http_client.request("bad_place")
|
|
311
|
+
except AuthorizationException as ex:
|
|
312
|
+
assert ex.message == "You do not have permission to access this resource."
|
|
313
|
+
assert ex.code == "forbidden"
|
|
314
|
+
assert ex.request_id == request_id
|
|
315
|
+
assert ex.__class__ == AuthorizationException
|
|
316
|
+
assert not isinstance(ex, EmailVerificationRequiredException)
|
|
317
|
+
|
|
266
318
|
def test_request_includes_base_headers(self, capture_and_mock_http_client_request):
|
|
267
319
|
request_kwargs = capture_and_mock_http_client_request(self.http_client, {}, 200)
|
|
268
320
|
|
|
@@ -6,24 +6,6 @@ from tests.utils.syncify import syncify
|
|
|
6
6
|
from workos.user_management import AsyncUserManagement, UserManagement
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def _mock_session(id: str):
|
|
10
|
-
now = "2025-07-23T14:00:00.000Z"
|
|
11
|
-
return {
|
|
12
|
-
"object": "session",
|
|
13
|
-
"id": id,
|
|
14
|
-
"user_id": "user_123",
|
|
15
|
-
"organization_id": "org_123",
|
|
16
|
-
"status": "revoked",
|
|
17
|
-
"auth_method": "password",
|
|
18
|
-
"ip_address": "192.168.1.1",
|
|
19
|
-
"user_agent": "Mozilla/5.0",
|
|
20
|
-
"expires_at": "2025-07-23T15:00:00.000Z",
|
|
21
|
-
"ended_at": now,
|
|
22
|
-
"created_at": now,
|
|
23
|
-
"updated_at": now,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
9
|
@pytest.mark.sync_and_async(UserManagement, AsyncUserManagement)
|
|
28
10
|
class TestUserManagementRevokeSession:
|
|
29
11
|
@pytest.fixture(autouse=True)
|
|
@@ -32,10 +14,7 @@ class TestUserManagementRevokeSession:
|
|
|
32
14
|
self.user_management = module_instance
|
|
33
15
|
|
|
34
16
|
def test_revoke_session(self, capture_and_mock_http_client_request):
|
|
35
|
-
|
|
36
|
-
request_kwargs = capture_and_mock_http_client_request(
|
|
37
|
-
self.http_client, mock, 200
|
|
38
|
-
)
|
|
17
|
+
request_kwargs = capture_and_mock_http_client_request(self.http_client, {}, 200)
|
|
39
18
|
|
|
40
19
|
response = syncify(
|
|
41
20
|
self.user_management.revoke_session(session_id="session_abc")
|
|
@@ -44,4 +23,4 @@ class TestUserManagementRevokeSession:
|
|
|
44
23
|
assert request_kwargs["url"].endswith("user_management/sessions/revoke")
|
|
45
24
|
assert request_kwargs["method"] == "post"
|
|
46
25
|
assert request_kwargs["json"] == {"session_id": "session_abc"}
|
|
47
|
-
assert response
|
|
26
|
+
assert response is None
|
|
@@ -45,6 +45,24 @@ class AuthorizationException(BaseRequestException):
|
|
|
45
45
|
pass
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
class EmailVerificationRequiredException(AuthorizationException):
|
|
49
|
+
"""Raised when email verification is required before authentication.
|
|
50
|
+
|
|
51
|
+
This exception includes an email_verification_id field that can be used
|
|
52
|
+
to retrieve the email verification object or resend the verification email.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(
|
|
56
|
+
self,
|
|
57
|
+
response: httpx.Response,
|
|
58
|
+
response_json: Optional[Mapping[str, Any]],
|
|
59
|
+
) -> None:
|
|
60
|
+
super().__init__(response, response_json)
|
|
61
|
+
self.email_verification_id = self.extract_from_json(
|
|
62
|
+
"email_verification_id", None
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
48
66
|
class AuthenticationException(BaseRequestException):
|
|
49
67
|
pass
|
|
50
68
|
|
|
@@ -739,9 +739,7 @@ class UserManagementModule(Protocol):
|
|
|
739
739
|
order: Optional[PaginationOrder] = "desc",
|
|
740
740
|
) -> SyncOrAsync["SessionsListResource"]: ...
|
|
741
741
|
|
|
742
|
-
def revoke_session(
|
|
743
|
-
self, *, session_id: str
|
|
744
|
-
) -> SyncOrAsync[UserManagementSession]: ...
|
|
742
|
+
def revoke_session(self, *, session_id: str) -> SyncOrAsync[None]: ...
|
|
745
743
|
|
|
746
744
|
def get_magic_auth(self, magic_auth_id: str) -> SyncOrAsync[MagicAuth]:
|
|
747
745
|
"""Get the details of a Magic Auth object.
|
|
@@ -1439,15 +1437,13 @@ class UserManagement(UserManagementModule):
|
|
|
1439
1437
|
**ListPage[UserManagementSession](**response).model_dump(),
|
|
1440
1438
|
)
|
|
1441
1439
|
|
|
1442
|
-
def revoke_session(self, *, session_id: str) ->
|
|
1440
|
+
def revoke_session(self, *, session_id: str) -> None:
|
|
1443
1441
|
json = {"session_id": session_id}
|
|
1444
1442
|
|
|
1445
|
-
|
|
1443
|
+
self._http_client.request(
|
|
1446
1444
|
SESSIONS_REVOKE_PATH, method=REQUEST_METHOD_POST, json=json
|
|
1447
1445
|
)
|
|
1448
1446
|
|
|
1449
|
-
return UserManagementSession.model_validate(response)
|
|
1450
|
-
|
|
1451
1447
|
def enroll_auth_factor(
|
|
1452
1448
|
self,
|
|
1453
1449
|
*,
|
|
@@ -2143,15 +2139,13 @@ class AsyncUserManagement(UserManagementModule):
|
|
|
2143
2139
|
**ListPage[UserManagementSession](**response).model_dump(),
|
|
2144
2140
|
)
|
|
2145
2141
|
|
|
2146
|
-
async def revoke_session(self, *, session_id: str) ->
|
|
2142
|
+
async def revoke_session(self, *, session_id: str) -> None:
|
|
2147
2143
|
json = {"session_id": session_id}
|
|
2148
2144
|
|
|
2149
|
-
|
|
2145
|
+
await self._http_client.request(
|
|
2150
2146
|
SESSIONS_REVOKE_PATH, method=REQUEST_METHOD_POST, json=json
|
|
2151
2147
|
)
|
|
2152
2148
|
|
|
2153
|
-
return UserManagementSession.model_validate(response)
|
|
2154
|
-
|
|
2155
2149
|
async def enroll_auth_factor(
|
|
2156
2150
|
self,
|
|
2157
2151
|
*,
|
|
@@ -20,6 +20,7 @@ from workos.exceptions import (
|
|
|
20
20
|
ServerException,
|
|
21
21
|
AuthenticationException,
|
|
22
22
|
AuthorizationException,
|
|
23
|
+
EmailVerificationRequiredException,
|
|
23
24
|
NotFoundException,
|
|
24
25
|
BadRequestException,
|
|
25
26
|
)
|
|
@@ -99,6 +100,11 @@ class BaseHTTPClient(Generic[_HttpxClientT]):
|
|
|
99
100
|
if status_code == 401:
|
|
100
101
|
raise AuthenticationException(response, response_json)
|
|
101
102
|
elif status_code == 403:
|
|
103
|
+
if (
|
|
104
|
+
response_json is not None
|
|
105
|
+
and response_json.get("code") == "email_verification_required"
|
|
106
|
+
):
|
|
107
|
+
raise EmailVerificationRequiredException(response, response_json)
|
|
102
108
|
raise AuthorizationException(response, response_json)
|
|
103
109
|
elif status_code == 404:
|
|
104
110
|
raise NotFoundException(response, response_json)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.31.0 → workos-5.31.2}/workos/types/events/connection_payload_with_legacy_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
{workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_group_with_previous_attributes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.31.0 → workos-5.31.2}/workos/types/events/directory_user_with_previous_attributes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.31.0 → workos-5.31.2}/workos/types/mfa/authentication_challenge_verification_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{workos-5.31.0 → workos-5.31.2}/workos/types/user_management/user_management_provider_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|