workos 1.5.1__py3-none-any.whl → 5.38.0__py3-none-any.whl
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/__about__.py +1 -1
- workos/__init__.py +3 -7
- workos/_base_client.py +138 -0
- workos/_client_configuration.py +10 -0
- workos/api_keys.py +53 -0
- workos/async_client.py +144 -0
- workos/audit_logs.py +125 -0
- workos/client.py +110 -18
- workos/directory_sync.py +379 -99
- workos/events.py +111 -0
- workos/exceptions.py +53 -26
- workos/fga.py +649 -0
- workos/mfa.py +205 -0
- workos/organization_domains.py +179 -0
- workos/organizations.py +403 -73
- workos/passwordless.py +67 -43
- workos/pipes.py +93 -0
- workos/portal.py +51 -28
- workos/session.py +337 -0
- workos/sso.py +311 -101
- workos/types/__init__.py +4 -0
- workos/types/api_keys/__init__.py +1 -0
- workos/types/api_keys/api_keys.py +20 -0
- workos/types/audit_logs/__init__.py +6 -0
- workos/types/audit_logs/audit_log_event.py +16 -0
- workos/types/audit_logs/audit_log_event_actor.py +12 -0
- workos/types/audit_logs/audit_log_event_context.py +8 -0
- workos/types/audit_logs/audit_log_event_target.py +12 -0
- workos/types/audit_logs/audit_log_export.py +18 -0
- workos/types/audit_logs/audit_log_metadata.py +4 -0
- workos/types/directory_sync/__init__.py +5 -0
- workos/types/directory_sync/directory.py +31 -0
- workos/types/directory_sync/directory_group.py +16 -0
- workos/types/directory_sync/directory_state.py +28 -0
- workos/types/directory_sync/directory_type.py +24 -0
- workos/types/directory_sync/directory_user.py +50 -0
- workos/types/directory_sync/list_filters.py +21 -0
- workos/types/events/__init__.py +13 -0
- workos/types/events/authentication_payload.py +70 -0
- workos/types/events/connection_payload_with_legacy_fields.py +5 -0
- workos/types/events/directory_group_membership_payload.py +9 -0
- workos/types/events/directory_group_with_previous_attributes.py +6 -0
- workos/types/events/directory_payload.py +16 -0
- workos/types/events/directory_payload_with_legacy_fields.py +29 -0
- workos/types/events/directory_user_with_previous_attributes.py +6 -0
- workos/types/events/event.py +324 -0
- workos/types/events/event_model.py +103 -0
- workos/types/events/event_type.py +59 -0
- workos/types/events/list_filters.py +10 -0
- workos/types/events/organization_domain_verification_failed_payload.py +14 -0
- workos/types/events/previous_attributes.py +3 -0
- workos/types/events/session_payload.py +27 -0
- workos/types/feature_flags/__init__.py +3 -0
- workos/types/feature_flags/feature_flag.py +12 -0
- workos/types/feature_flags/list_filters.py +5 -0
- workos/types/fga/__init__.py +5 -0
- workos/types/fga/authorization_resource_types.py +9 -0
- workos/types/fga/authorization_resources.py +10 -0
- workos/types/fga/check.py +51 -0
- workos/types/fga/list_filters.py +24 -0
- workos/types/fga/warnings.py +33 -0
- workos/types/fga/warrant.py +49 -0
- workos/types/list_resource.py +198 -0
- workos/types/metadata.py +4 -0
- workos/types/mfa/__init__.py +5 -0
- workos/types/mfa/authentication_challenge.py +14 -0
- workos/types/mfa/authentication_challenge_verification_response.py +9 -0
- workos/types/mfa/authentication_factor.py +70 -0
- workos/types/mfa/authentication_factor_totp_and_challenge_response.py +10 -0
- workos/types/mfa/enroll_authentication_factor_type.py +8 -0
- workos/types/organization_domains/__init__.py +1 -0
- workos/types/organization_domains/organization_domain.py +18 -0
- workos/types/organizations/__init__.py +6 -0
- workos/types/organizations/domain_data_input.py +7 -0
- workos/types/organizations/list_filters.py +6 -0
- workos/types/organizations/organization.py +13 -0
- workos/types/organizations/organization_common.py +12 -0
- workos/types/passwordless/__init__.py +2 -0
- workos/types/passwordless/passwordless_session.py +12 -0
- workos/types/passwordless/passwordless_session_type.py +3 -0
- workos/types/pipes/__init__.py +6 -0
- workos/types/pipes/pipes.py +34 -0
- workos/types/portal/__init__.py +2 -0
- workos/types/portal/portal_link.py +7 -0
- workos/types/portal/portal_link_intent.py +11 -0
- workos/types/portal/portal_link_intent_options.py +9 -0
- workos/types/roles/__init__.py +0 -0
- workos/types/roles/role.py +27 -0
- workos/types/sso/__init__.py +4 -0
- workos/types/sso/connection.py +70 -0
- workos/types/sso/connection_domain.py +8 -0
- workos/types/sso/profile.py +35 -0
- workos/types/sso/sso_provider_type.py +10 -0
- workos/types/user_management/__init__.py +12 -0
- workos/types/user_management/authenticate_with_common.py +66 -0
- workos/types/user_management/authentication_response.py +53 -0
- workos/types/user_management/email_verification.py +18 -0
- workos/types/user_management/impersonator.py +8 -0
- workos/types/user_management/invitation.py +26 -0
- workos/types/user_management/list_filters.py +29 -0
- workos/types/user_management/magic_auth.py +18 -0
- workos/types/user_management/oauth_tokens.py +21 -0
- workos/types/user_management/organization_membership.py +25 -0
- workos/types/user_management/password_hash_type.py +4 -0
- workos/types/user_management/password_reset.py +18 -0
- workos/types/user_management/screen_hint.py +3 -0
- workos/types/user_management/session.py +79 -0
- workos/types/user_management/user.py +22 -0
- workos/types/user_management/user_management_provider_type.py +11 -0
- workos/types/vault/__init__.py +2 -0
- workos/types/vault/key.py +25 -0
- workos/types/vault/object.py +38 -0
- workos/types/webhooks/__init__.py +0 -0
- workos/types/webhooks/webhook.py +330 -0
- workos/types/webhooks/webhook_model.py +14 -0
- workos/types/webhooks/webhook_payload.py +4 -0
- workos/types/widgets/__init__.py +2 -0
- workos/types/widgets/widget_scope.py +4 -0
- workos/types/widgets/widget_token_response.py +7 -0
- workos/types/workos_model.py +26 -0
- workos/typing/__init__.py +1 -0
- workos/typing/literals.py +32 -0
- workos/typing/sync_or_async.py +5 -0
- workos/typing/untyped_literal.py +37 -0
- workos/typing/webhooks.py +18 -0
- workos/user_management.py +2400 -0
- workos/utils/_base_http_client.py +252 -0
- workos/utils/crypto_provider.py +39 -0
- workos/utils/http_client.py +214 -0
- workos/utils/pagination_order.py +4 -0
- workos/utils/request_helper.py +27 -0
- workos/vault.py +544 -0
- workos/webhooks.py +96 -39
- workos/widgets.py +55 -0
- {workos-1.5.1.dist-info → workos-5.38.0.dist-info}/LICENSE +1 -1
- workos-5.38.0.dist-info/METADATA +107 -0
- workos-5.38.0.dist-info/RECORD +141 -0
- {workos-1.5.1.dist-info → workos-5.38.0.dist-info}/WHEEL +1 -1
- workos/audit_trail.py +0 -172
- workos/resources/base.py +0 -36
- workos/resources/event.py +0 -42
- workos/resources/event_action.py +0 -11
- workos/resources/sso.py +0 -53
- workos/utils/connection_types.py +0 -17
- workos/utils/request.py +0 -95
- workos/utils/validation.py +0 -45
- workos-1.5.1.dist-info/METADATA +0 -77
- workos-1.5.1.dist-info/RECORD +0 -25
- /workos/{resources/__init__.py → py.typed} +0 -0
- {workos-1.5.1.dist-info → workos-5.38.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import Literal, Sequence
|
|
2
|
+
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
|
|
5
|
+
OAuthTokensProvidersType = Literal[
|
|
6
|
+
"AppleOauth",
|
|
7
|
+
"GitHubOauth",
|
|
8
|
+
"GoogleOauth",
|
|
9
|
+
"MicrosoftOauth",
|
|
10
|
+
"SalesforceOauth",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class OAuthTokens(WorkOSModel):
|
|
15
|
+
"""Representation of a WorkOS Dashboard member impersonating a user"""
|
|
16
|
+
|
|
17
|
+
provider: OAuthTokensProvidersType
|
|
18
|
+
access_token: str
|
|
19
|
+
refresh_token: str
|
|
20
|
+
expires_at: int
|
|
21
|
+
scopes: Sequence[str]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from typing import Literal, Sequence, Optional
|
|
2
|
+
from typing_extensions import TypedDict
|
|
3
|
+
|
|
4
|
+
from workos.types.workos_model import WorkOSModel
|
|
5
|
+
from workos.typing.literals import LiteralOrUntyped
|
|
6
|
+
|
|
7
|
+
OrganizationMembershipStatus = Literal["active", "inactive", "pending"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class OrganizationMembershipRole(TypedDict):
|
|
11
|
+
slug: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class OrganizationMembership(WorkOSModel):
|
|
15
|
+
"""Representation of an WorkOS Organization Membership."""
|
|
16
|
+
|
|
17
|
+
object: Literal["organization_membership"]
|
|
18
|
+
id: str
|
|
19
|
+
user_id: str
|
|
20
|
+
organization_id: str
|
|
21
|
+
role: OrganizationMembershipRole
|
|
22
|
+
roles: Optional[Sequence[OrganizationMembershipRole]] = None
|
|
23
|
+
status: LiteralOrUntyped[OrganizationMembershipStatus]
|
|
24
|
+
created_at: str
|
|
25
|
+
updated_at: str
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PasswordResetCommon(WorkOSModel):
|
|
6
|
+
object: Literal["password_reset"]
|
|
7
|
+
id: str
|
|
8
|
+
user_id: str
|
|
9
|
+
email: str
|
|
10
|
+
expires_at: str
|
|
11
|
+
created_at: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PasswordReset(PasswordResetCommon):
|
|
15
|
+
"""Representation of a WorkOS PasswordReset object."""
|
|
16
|
+
|
|
17
|
+
password_reset_token: str
|
|
18
|
+
password_reset_url: str
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
from typing import Optional, Sequence, TypedDict, Union
|
|
3
|
+
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from workos.types.user_management.impersonator import Impersonator
|
|
7
|
+
from workos.types.user_management.user import User
|
|
8
|
+
from workos.types.workos_model import WorkOSModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AuthenticateWithSessionCookieFailureReason(Enum):
|
|
12
|
+
INVALID_JWT = "invalid_jwt"
|
|
13
|
+
INVALID_SESSION_COOKIE = "invalid_session_cookie"
|
|
14
|
+
NO_SESSION_COOKIE_PROVIDED = "no_session_cookie_provided"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AuthenticateWithSessionCookieSuccessResponse(WorkOSModel):
|
|
18
|
+
authenticated: Literal[True]
|
|
19
|
+
session_id: str
|
|
20
|
+
organization_id: Optional[str] = None
|
|
21
|
+
role: Optional[str] = None
|
|
22
|
+
roles: Optional[Sequence[str]] = None
|
|
23
|
+
permissions: Optional[Sequence[str]] = None
|
|
24
|
+
user: User
|
|
25
|
+
impersonator: Optional[Impersonator] = None
|
|
26
|
+
entitlements: Optional[Sequence[str]] = None
|
|
27
|
+
feature_flags: Optional[Sequence[str]] = None
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AuthenticateWithSessionCookieErrorResponse(WorkOSModel):
|
|
31
|
+
authenticated: Literal[False]
|
|
32
|
+
reason: Union[AuthenticateWithSessionCookieFailureReason, str]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class RefreshWithSessionCookieSuccessResponse(
|
|
36
|
+
AuthenticateWithSessionCookieSuccessResponse
|
|
37
|
+
):
|
|
38
|
+
sealed_session: str
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class RefreshWithSessionCookieErrorResponse(WorkOSModel):
|
|
42
|
+
authenticated: Literal[False]
|
|
43
|
+
reason: Union[AuthenticateWithSessionCookieFailureReason, str]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SessionConfig(TypedDict, total=False):
|
|
47
|
+
seal_session: bool
|
|
48
|
+
cookie_password: str
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
AuthMethodType = Literal[
|
|
52
|
+
"external_auth",
|
|
53
|
+
"impersonation",
|
|
54
|
+
"magic_code",
|
|
55
|
+
"migrated_session",
|
|
56
|
+
"oauth",
|
|
57
|
+
"passkey",
|
|
58
|
+
"password",
|
|
59
|
+
"sso",
|
|
60
|
+
"unknown",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class Session(WorkOSModel):
|
|
65
|
+
"""Representation of a WorkOS User Management Session."""
|
|
66
|
+
|
|
67
|
+
object: Literal["session"]
|
|
68
|
+
id: str
|
|
69
|
+
user_id: str
|
|
70
|
+
organization_id: Optional[str] = None
|
|
71
|
+
status: str
|
|
72
|
+
auth_method: AuthMethodType
|
|
73
|
+
impersonator: Optional[Impersonator] = None
|
|
74
|
+
ip_address: Optional[str] = None
|
|
75
|
+
user_agent: Optional[str] = None
|
|
76
|
+
expires_at: str
|
|
77
|
+
ended_at: Optional[str] = None
|
|
78
|
+
created_at: str
|
|
79
|
+
updated_at: str
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from dataclasses import field
|
|
2
|
+
from typing import Literal, Optional
|
|
3
|
+
from workos.types.metadata import Metadata
|
|
4
|
+
from workos.types.workos_model import WorkOSModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class User(WorkOSModel):
|
|
8
|
+
"""Representation of a WorkOS User."""
|
|
9
|
+
|
|
10
|
+
object: Literal["user"]
|
|
11
|
+
id: str
|
|
12
|
+
email: str
|
|
13
|
+
first_name: Optional[str] = None
|
|
14
|
+
last_name: Optional[str] = None
|
|
15
|
+
email_verified: bool
|
|
16
|
+
profile_picture_url: Optional[str] = None
|
|
17
|
+
last_sign_in_at: Optional[str] = None
|
|
18
|
+
locale: Optional[str] = None
|
|
19
|
+
created_at: str
|
|
20
|
+
updated_at: str
|
|
21
|
+
external_id: Optional[str] = None
|
|
22
|
+
metadata: Metadata = field(default_factory=dict)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
from pydantic import BaseModel, RootModel
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class KeyContext(RootModel[Dict[str, str]]):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DataKey(WorkOSModel):
|
|
11
|
+
id: str
|
|
12
|
+
key: str
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class DataKeyPair(WorkOSModel):
|
|
16
|
+
context: KeyContext
|
|
17
|
+
data_key: DataKey
|
|
18
|
+
encrypted_keys: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DecodedKeys(BaseModel):
|
|
22
|
+
iv: bytes
|
|
23
|
+
tag: bytes
|
|
24
|
+
keys: str # Base64-encoded string
|
|
25
|
+
ciphertext: bytes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
from workos.types.vault import KeyContext
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ObjectDigest(WorkOSModel):
|
|
8
|
+
id: str
|
|
9
|
+
name: str
|
|
10
|
+
updated_at: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ObjectUpdateBy(WorkOSModel):
|
|
14
|
+
id: str
|
|
15
|
+
name: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ObjectMetadata(WorkOSModel):
|
|
19
|
+
context: KeyContext
|
|
20
|
+
environment_id: str
|
|
21
|
+
id: str
|
|
22
|
+
key_id: str
|
|
23
|
+
updated_at: str
|
|
24
|
+
updated_by: ObjectUpdateBy
|
|
25
|
+
version_id: str
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class VaultObject(WorkOSModel):
|
|
29
|
+
id: str
|
|
30
|
+
metadata: ObjectMetadata
|
|
31
|
+
name: str
|
|
32
|
+
value: Optional[str] = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ObjectVersion(WorkOSModel):
|
|
36
|
+
created_at: str
|
|
37
|
+
current_version: bool
|
|
38
|
+
id: str
|
|
File without changes
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
from typing import Literal, Union
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
from typing_extensions import Annotated
|
|
5
|
+
|
|
6
|
+
from workos.types.directory_sync import DirectoryGroup
|
|
7
|
+
from workos.types.directory_sync.directory_user import DirectoryUser
|
|
8
|
+
from workos.types.events.authentication_payload import (
|
|
9
|
+
AuthenticationEmailVerificationSucceededPayload,
|
|
10
|
+
AuthenticationMagicAuthFailedPayload,
|
|
11
|
+
AuthenticationMagicAuthSucceededPayload,
|
|
12
|
+
AuthenticationMfaSucceededPayload,
|
|
13
|
+
AuthenticationOauthFailedPayload,
|
|
14
|
+
AuthenticationOauthSucceededPayload,
|
|
15
|
+
AuthenticationPasswordFailedPayload,
|
|
16
|
+
AuthenticationPasswordSucceededPayload,
|
|
17
|
+
AuthenticationSsoFailedPayload,
|
|
18
|
+
AuthenticationSsoSucceededPayload,
|
|
19
|
+
)
|
|
20
|
+
from workos.types.events.connection_payload_with_legacy_fields import (
|
|
21
|
+
ConnectionPayloadWithLegacyFields,
|
|
22
|
+
)
|
|
23
|
+
from workos.types.events.directory_group_membership_payload import (
|
|
24
|
+
DirectoryGroupMembershipPayload,
|
|
25
|
+
)
|
|
26
|
+
from workos.types.events.directory_group_with_previous_attributes import (
|
|
27
|
+
DirectoryGroupWithPreviousAttributes,
|
|
28
|
+
)
|
|
29
|
+
from workos.types.events.directory_payload import DirectoryPayload
|
|
30
|
+
from workos.types.events.directory_payload_with_legacy_fields import (
|
|
31
|
+
DirectoryPayloadWithLegacyFields,
|
|
32
|
+
)
|
|
33
|
+
from workos.types.events.directory_user_with_previous_attributes import (
|
|
34
|
+
DirectoryUserWithPreviousAttributes,
|
|
35
|
+
)
|
|
36
|
+
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
|
+
OrganizationDomainVerificationFailedPayload,
|
|
38
|
+
)
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
43
|
+
from workos.types.organization_domains import OrganizationDomain
|
|
44
|
+
from workos.types.organizations.organization_common import OrganizationCommon
|
|
45
|
+
from workos.types.roles.role import EventRole
|
|
46
|
+
from workos.types.sso.connection import Connection
|
|
47
|
+
from workos.types.user_management import OrganizationMembership, User
|
|
48
|
+
from workos.types.user_management.email_verification import (
|
|
49
|
+
EmailVerificationCommon,
|
|
50
|
+
)
|
|
51
|
+
from workos.types.user_management.invitation import InvitationCommon
|
|
52
|
+
from workos.types.user_management.magic_auth import MagicAuthCommon
|
|
53
|
+
from workos.types.user_management.password_reset import PasswordResetCommon
|
|
54
|
+
from workos.types.webhooks.webhook_model import WebhookModel
|
|
55
|
+
|
|
56
|
+
# README
|
|
57
|
+
# When adding a new webhook event type, ensure the new webhook class is
|
|
58
|
+
# added to the Webhook union type at the bottom of this file.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class AuthenticationEmailVerificationSucceededWebhook(
|
|
62
|
+
WebhookModel[AuthenticationEmailVerificationSucceededPayload,]
|
|
63
|
+
):
|
|
64
|
+
event: Literal["authentication.email_verification_succeeded"]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AuthenticationMagicAuthFailedWebhook(
|
|
68
|
+
WebhookModel[AuthenticationMagicAuthFailedPayload,]
|
|
69
|
+
):
|
|
70
|
+
event: Literal["authentication.magic_auth_failed"]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AuthenticationMagicAuthSucceededWebhook(
|
|
74
|
+
WebhookModel[AuthenticationMagicAuthSucceededPayload,]
|
|
75
|
+
):
|
|
76
|
+
event: Literal["authentication.magic_auth_succeeded"]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AuthenticationMfaSucceededWebhook(
|
|
80
|
+
WebhookModel[AuthenticationMfaSucceededPayload]
|
|
81
|
+
):
|
|
82
|
+
event: Literal["authentication.mfa_succeeded"]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class AuthenticationOauthFailedWebhook(WebhookModel[AuthenticationOauthFailedPayload]):
|
|
86
|
+
event: Literal["authentication.oauth_failed"]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class AuthenticationOauthSucceededWebhook(
|
|
90
|
+
WebhookModel[AuthenticationOauthSucceededPayload]
|
|
91
|
+
):
|
|
92
|
+
event: Literal["authentication.oauth_succeeded"]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class AuthenticationPasswordFailedWebhook(
|
|
96
|
+
WebhookModel[AuthenticationPasswordFailedPayload]
|
|
97
|
+
):
|
|
98
|
+
event: Literal["authentication.password_failed"]
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class AuthenticationPasswordSucceededWebhook(
|
|
102
|
+
WebhookModel[AuthenticationPasswordSucceededPayload,]
|
|
103
|
+
):
|
|
104
|
+
event: Literal["authentication.password_succeeded"]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class AuthenticationSsoFailedWebhook(WebhookModel[AuthenticationSsoFailedPayload]):
|
|
108
|
+
event: Literal["authentication.sso_failed"]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class AuthenticationSsoSucceededWebhook(
|
|
112
|
+
WebhookModel[AuthenticationSsoSucceededPayload]
|
|
113
|
+
):
|
|
114
|
+
event: Literal["authentication.sso_succeeded"]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ConnectionActivatedWebhook(WebhookModel[ConnectionPayloadWithLegacyFields]):
|
|
118
|
+
event: Literal["connection.activated"]
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class ConnectionDeactivatedWebhook(WebhookModel[ConnectionPayloadWithLegacyFields]):
|
|
122
|
+
event: Literal["connection.deactivated"]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class ConnectionDeletedWebhook(WebhookModel[Connection]):
|
|
126
|
+
event: Literal["connection.deleted"]
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class DirectoryActivatedWebhook(WebhookModel[DirectoryPayloadWithLegacyFields]):
|
|
130
|
+
event: Literal["dsync.activated"]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class DirectoryDeletedWebhook(WebhookModel[DirectoryPayload]):
|
|
134
|
+
event: Literal["dsync.deleted"]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class DirectoryGroupCreatedWebhook(WebhookModel[DirectoryGroup]):
|
|
138
|
+
event: Literal["dsync.group.created"]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class DirectoryGroupDeletedWebhook(WebhookModel[DirectoryGroup]):
|
|
142
|
+
event: Literal["dsync.group.deleted"]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class DirectoryGroupUpdatedWebhook(WebhookModel[DirectoryGroupWithPreviousAttributes]):
|
|
146
|
+
event: Literal["dsync.group.updated"]
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class DirectoryUserCreatedWebhook(WebhookModel[DirectoryUser]):
|
|
150
|
+
event: Literal["dsync.user.created"]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class DirectoryUserDeletedWebhook(WebhookModel[DirectoryUser]):
|
|
154
|
+
event: Literal["dsync.user.deleted"]
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class DirectoryUserUpdatedWebhook(WebhookModel[DirectoryUserWithPreviousAttributes]):
|
|
158
|
+
event: Literal["dsync.user.updated"]
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class DirectoryUserAddedToGroupWebhook(WebhookModel[DirectoryGroupMembershipPayload]):
|
|
162
|
+
event: Literal["dsync.group.user_added"]
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class DirectoryUserRemovedFromGroupWebhook(
|
|
166
|
+
WebhookModel[DirectoryGroupMembershipPayload]
|
|
167
|
+
):
|
|
168
|
+
event: Literal["dsync.group.user_removed"]
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class EmailVerificationCreatedWebhook(WebhookModel[EmailVerificationCommon]):
|
|
172
|
+
event: Literal["email_verification.created"]
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class InvitationAcceptedWebhook(WebhookModel[InvitationCommon]):
|
|
176
|
+
event: Literal["invitation.accepted"]
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class InvitationCreatedWebhook(WebhookModel[InvitationCommon]):
|
|
180
|
+
event: Literal["invitation.created"]
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class InvitationRevokedWebhook(WebhookModel[InvitationCommon]):
|
|
184
|
+
event: Literal["invitation.revoked"]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class MagicAuthCreatedWebhook(WebhookModel[MagicAuthCommon]):
|
|
188
|
+
event: Literal["magic_auth.created"]
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class OrganizationCreatedWebhook(WebhookModel[OrganizationCommon]):
|
|
192
|
+
event: Literal["organization.created"]
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class OrganizationDeletedWebhook(WebhookModel[OrganizationCommon]):
|
|
196
|
+
event: Literal["organization.deleted"]
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class OrganizationUpdatedWebhook(WebhookModel[OrganizationCommon]):
|
|
200
|
+
event: Literal["organization.updated"]
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class OrganizationDomainVerificationFailedWebhook(
|
|
204
|
+
WebhookModel[OrganizationDomainVerificationFailedPayload,]
|
|
205
|
+
):
|
|
206
|
+
event: Literal["organization_domain.verification_failed"]
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class OrganizationDomainVerifiedWebhook(WebhookModel[OrganizationDomain]):
|
|
210
|
+
event: Literal["organization_domain.verified"]
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class OrganizationDomainCreatedWebhook(WebhookModel[OrganizationDomain]):
|
|
214
|
+
event: Literal["organization_domain.created"]
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class OrganizationDomainUpdatedWebhook(WebhookModel[OrganizationDomain]):
|
|
218
|
+
event: Literal["organization_domain.updated"]
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class OrganizationDomainDeletedWebhook(WebhookModel[OrganizationDomain]):
|
|
222
|
+
event: Literal["organization_domain.deleted"]
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class OrganizationMembershipCreatedWebhook(WebhookModel[OrganizationMembership]):
|
|
226
|
+
event: Literal["organization_membership.created"]
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class OrganizationMembershipDeletedWebhook(WebhookModel[OrganizationMembership]):
|
|
230
|
+
event: Literal["organization_membership.deleted"]
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class OrganizationMembershipUpdatedWebhook(WebhookModel[OrganizationMembership]):
|
|
234
|
+
event: Literal["organization_membership.updated"]
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class PasswordResetCreatedWebhook(WebhookModel[PasswordResetCommon]):
|
|
238
|
+
event: Literal["password_reset.created"]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class PasswordResetSucceededWebhook(WebhookModel[PasswordResetCommon]):
|
|
242
|
+
event: Literal["password_reset.succeeded"]
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class RoleCreatedWebhook(WebhookModel[EventRole]):
|
|
246
|
+
event: Literal["role.created"]
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class RoleDeletedWebhook(WebhookModel[EventRole]):
|
|
250
|
+
event: Literal["role.deleted"]
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class RoleUpdatedWebhook(WebhookModel[EventRole]):
|
|
254
|
+
event: Literal["role.updated"]
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class SessionCreatedWebhook(WebhookModel[SessionCreatedPayload]):
|
|
258
|
+
event: Literal["session.created"]
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class SessionRevokedWebhook(WebhookModel[SessionRevokedPayload]):
|
|
262
|
+
event: Literal["session.revoked"]
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class UserCreatedWebhook(WebhookModel[User]):
|
|
266
|
+
event: Literal["user.created"]
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
class UserDeletedWebhook(WebhookModel[User]):
|
|
270
|
+
event: Literal["user.deleted"]
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
class UserUpdatedWebhook(WebhookModel[User]):
|
|
274
|
+
event: Literal["user.updated"]
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
Webhook = Annotated[
|
|
278
|
+
Union[
|
|
279
|
+
AuthenticationEmailVerificationSucceededWebhook,
|
|
280
|
+
AuthenticationMagicAuthFailedWebhook,
|
|
281
|
+
AuthenticationMagicAuthSucceededWebhook,
|
|
282
|
+
AuthenticationMfaSucceededWebhook,
|
|
283
|
+
AuthenticationOauthFailedWebhook,
|
|
284
|
+
AuthenticationOauthSucceededWebhook,
|
|
285
|
+
AuthenticationPasswordFailedWebhook,
|
|
286
|
+
AuthenticationPasswordSucceededWebhook,
|
|
287
|
+
AuthenticationSsoFailedWebhook,
|
|
288
|
+
AuthenticationSsoSucceededWebhook,
|
|
289
|
+
ConnectionActivatedWebhook,
|
|
290
|
+
ConnectionDeactivatedWebhook,
|
|
291
|
+
ConnectionDeletedWebhook,
|
|
292
|
+
DirectoryActivatedWebhook,
|
|
293
|
+
DirectoryDeletedWebhook,
|
|
294
|
+
DirectoryGroupCreatedWebhook,
|
|
295
|
+
DirectoryGroupDeletedWebhook,
|
|
296
|
+
DirectoryGroupUpdatedWebhook,
|
|
297
|
+
DirectoryUserCreatedWebhook,
|
|
298
|
+
DirectoryUserDeletedWebhook,
|
|
299
|
+
DirectoryUserUpdatedWebhook,
|
|
300
|
+
DirectoryUserAddedToGroupWebhook,
|
|
301
|
+
DirectoryUserRemovedFromGroupWebhook,
|
|
302
|
+
EmailVerificationCreatedWebhook,
|
|
303
|
+
InvitationAcceptedWebhook,
|
|
304
|
+
InvitationCreatedWebhook,
|
|
305
|
+
InvitationRevokedWebhook,
|
|
306
|
+
MagicAuthCreatedWebhook,
|
|
307
|
+
OrganizationCreatedWebhook,
|
|
308
|
+
OrganizationDeletedWebhook,
|
|
309
|
+
OrganizationUpdatedWebhook,
|
|
310
|
+
OrganizationDomainCreatedWebhook,
|
|
311
|
+
OrganizationDomainDeletedWebhook,
|
|
312
|
+
OrganizationDomainUpdatedWebhook,
|
|
313
|
+
OrganizationDomainVerificationFailedWebhook,
|
|
314
|
+
OrganizationDomainVerifiedWebhook,
|
|
315
|
+
OrganizationMembershipCreatedWebhook,
|
|
316
|
+
OrganizationMembershipDeletedWebhook,
|
|
317
|
+
OrganizationMembershipUpdatedWebhook,
|
|
318
|
+
PasswordResetCreatedWebhook,
|
|
319
|
+
PasswordResetSucceededWebhook,
|
|
320
|
+
RoleCreatedWebhook,
|
|
321
|
+
RoleDeletedWebhook,
|
|
322
|
+
RoleUpdatedWebhook,
|
|
323
|
+
SessionCreatedWebhook,
|
|
324
|
+
SessionRevokedWebhook,
|
|
325
|
+
UserCreatedWebhook,
|
|
326
|
+
UserDeletedWebhook,
|
|
327
|
+
UserUpdatedWebhook,
|
|
328
|
+
],
|
|
329
|
+
Field(..., discriminator="event"),
|
|
330
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from typing import Generic
|
|
2
|
+
from workos.types.events.event_model import EventPayload
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WebhookModel(WorkOSModel, Generic[EventPayload]):
|
|
7
|
+
"""Representation of an Webhook delivered via Webhook.
|
|
8
|
+
Attributes:
|
|
9
|
+
OBJECT_FIELDS (list): List of fields an Webhook is comprised of.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
id: str
|
|
13
|
+
data: EventPayload
|
|
14
|
+
created_at: str
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional
|
|
2
|
+
from typing_extensions import override
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic.main import IncEx
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class WorkOSModel(BaseModel):
|
|
8
|
+
@override
|
|
9
|
+
def dict(
|
|
10
|
+
self,
|
|
11
|
+
*,
|
|
12
|
+
include: Optional[IncEx] = None,
|
|
13
|
+
exclude: Optional[IncEx] = None,
|
|
14
|
+
by_alias: bool = False,
|
|
15
|
+
exclude_unset: bool = False,
|
|
16
|
+
exclude_defaults: bool = False,
|
|
17
|
+
exclude_none: bool = False
|
|
18
|
+
) -> Dict[str, Any]:
|
|
19
|
+
return self.model_dump(
|
|
20
|
+
include=include,
|
|
21
|
+
exclude=exclude,
|
|
22
|
+
by_alias=by_alias,
|
|
23
|
+
exclude_unset=exclude_unset,
|
|
24
|
+
exclude_defaults=exclude_defaults,
|
|
25
|
+
exclude_none=exclude_none,
|
|
26
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from workos.typing.untyped_literal import is_untyped_literal
|