Module supertokens_python.recipe.webauthn.interfaces.api

Expand source code
# Copyright (c) 2025, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from abc import abstractmethod
from typing import TYPE_CHECKING, List, Literal, Optional, TypedDict, Union

from typing_extensions import NotRequired, Unpack

from supertokens_python.framework.request import BaseRequest
from supertokens_python.framework.response import BaseResponse
from supertokens_python.ingredients.emaildelivery import EmailDeliveryIngredient
from supertokens_python.recipe.session.interfaces import SessionContainer
from supertokens_python.recipe.webauthn.interfaces.recipe import (
    AuthenticationPayload,
    CredentialNotFoundErrorResponse,
    EmailAlreadyExistsErrorResponse,
    InvalidAuthenticatorErrorResponse,
    InvalidCredentialsErrorResponse,
    InvalidOptionsErrorResponse,
    ListCredentialsResponse,
    OptionsNotFoundErrorResponse,
    RecipeInterface,
    RecoverAccountTokenInvalidErrorResponse,
    RegisterOptionsErrorResponse,
    RegistrationPayload,
    ResidentKey,
    SignInOptionsErrorResponse,
    UserVerification,
)
from supertokens_python.supertokens import AppInfo
from supertokens_python.types import RecipeUserId, User
from supertokens_python.types.base import UserContext
from supertokens_python.types.recipe import BaseAPIInterface
from supertokens_python.types.response import (
    CamelCaseBaseModel,
    GeneralErrorResponse,
    OkResponseBaseModel,
    StatusReasonResponseBaseModel,
)

if TYPE_CHECKING:
    from supertokens_python.recipe.webauthn.types.config import NormalisedWebauthnConfig


class SignUpNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["SIGN_UP_NOT_ALLOWED"], str]
):
    status: Literal["SIGN_UP_NOT_ALLOWED"] = "SIGN_UP_NOT_ALLOWED"


class SignInNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["SIGN_IN_NOT_ALLOWED"], str]
):
    status: Literal["SIGN_IN_NOT_ALLOWED"] = "SIGN_IN_NOT_ALLOWED"


class RecoverAccountNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["RECOVER_ACCOUNT_NOT_ALLOWED"], str]
):
    status: Literal["RECOVER_ACCOUNT_NOT_ALLOWED"] = "RECOVER_ACCOUNT_NOT_ALLOWED"


class RegisterCredentialNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["REGISTER_CREDENTIAL_NOT_ALLOWED"], str]
):
    status: Literal["REGISTER_CREDENTIAL_NOT_ALLOWED"] = (
        "REGISTER_CREDENTIAL_NOT_ALLOWED"
    )


class WebauthnRecoverAccountEmailDeliveryUser(CamelCaseBaseModel):
    id: str
    recipe_user_id: Optional[RecipeUserId]
    email: str


class TypeWebauthnRecoverAccountEmailDeliveryInput(CamelCaseBaseModel):
    type: Literal["RECOVER_ACCOUNT"] = "RECOVER_ACCOUNT"
    user: WebauthnRecoverAccountEmailDeliveryUser
    recover_account_link: str
    tenant_id: str


TypeWebauthnEmailDeliveryInput = TypeWebauthnRecoverAccountEmailDeliveryInput


class APIOptions(CamelCaseBaseModel):
    recipe_implementation: RecipeInterface
    app_info: AppInfo
    config: "NormalisedWebauthnConfig"
    recipe_id: str
    req: BaseRequest
    res: BaseResponse
    email_delivery: EmailDeliveryIngredient[TypeWebauthnEmailDeliveryInput]


class RegisterOptionsPOSTResponse(OkResponseBaseModel):
    class RelyingParty(CamelCaseBaseModel):
        id: str
        name: str

    class User(CamelCaseBaseModel):
        id: str
        name: str
        display_name: str

    class ExcludeCredentials(CamelCaseBaseModel):
        id: str
        type: Literal["public-key"]
        transports: List[Literal["ble", "hybrid", "internal", "nfc", "usb"]]

    class PubKeyCredParams(CamelCaseBaseModel):
        alg: int
        type: str

    class AuthenticatorSelection(CamelCaseBaseModel):
        require_resident_key: bool
        resident_key: ResidentKey
        user_verification: UserVerification

    webauthn_generated_options_id: str
    created_at: int
    expires_at: int
    rp: RelyingParty
    user: User
    challenge: str
    timeout: int
    exclude_credentials: List[ExcludeCredentials]
    attestation: Literal["none", "indirect", "direct", "enterprise"]
    pub_key_cred_params: List[PubKeyCredParams]
    authenticator_selection: AuthenticatorSelection


RegisterOptionsPOSTErrorResponse = RegisterOptionsErrorResponse


class SignInOptionsPOSTResponse(OkResponseBaseModel):
    webauthn_generated_options_id: str
    created_at: int
    expires_at: int
    rp_id: str
    challenge: str
    timeout: int
    user_verification: UserVerification


SignInOptionsPOSTErrorResponse = SignInOptionsErrorResponse

SignUpPOSTErrorResponse = Union[
    SignUpNotAllowedErrorResponse,
    InvalidAuthenticatorErrorResponse,
    EmailAlreadyExistsErrorResponse,
    InvalidCredentialsErrorResponse,
    OptionsNotFoundErrorResponse,
    InvalidOptionsErrorResponse,
]

SignInPOSTErrorResponse = Union[
    InvalidCredentialsErrorResponse,
    SignInNotAllowedErrorResponse,
]

GenerateRecoverAccountTokenPOSTErrorResponse = RecoverAccountNotAllowedErrorResponse

RecoverAccountPOSTErrorResponse = Union[
    RecoverAccountTokenInvalidErrorResponse,
    InvalidCredentialsErrorResponse,
    OptionsNotFoundErrorResponse,
    InvalidOptionsErrorResponse,
    InvalidAuthenticatorErrorResponse,
]

RegisterCredentialPOSTErrorResponse = Union[
    InvalidCredentialsErrorResponse,
    OptionsNotFoundErrorResponse,
    InvalidOptionsErrorResponse,
    RegisterCredentialNotAllowedErrorResponse,
    InvalidAuthenticatorErrorResponse,
]


class EmailExistsGetResponse(OkResponseBaseModel):
    exists: bool


class RecoverAccountPOSTResponse(OkResponseBaseModel):
    user: User
    email: str


ListCredentialsGETResponse = ListCredentialsResponse


RemoveCredentialPOSTErrorResponse = CredentialNotFoundErrorResponse


class SignUpPOSTResponse(OkResponseBaseModel):
    user: User
    session: SessionContainer


class SignInPOSTResponse(OkResponseBaseModel):
    user: User
    session: SessionContainer


class RecoverAccountTokenInput(TypedDict):
    recover_account_token: str


class DisplayNameEmailInput(TypedDict):
    display_name: Optional[str]
    email: str


class RegisterOptionsPOSTKwargsInput(TypedDict):
    recover_account_token: NotRequired[str]
    display_name: NotRequired[str]
    email: NotRequired[str]


class APIInterface(BaseAPIInterface):
    disable_register_options_post: bool = False
    disable_sign_in_options_post: bool = False
    disable_sign_up_post: bool = False
    disable_sign_in_post: bool = False
    disable_generate_recover_account_token_post: bool = False
    disable_recover_account_post: bool = False
    disable_register_credential_post: bool = False
    disable_email_exists_get: bool = False
    disable_list_credentials_get: bool = False
    disable_remove_credential_post: bool = False

    @abstractmethod
    async def register_options_post(
        self,
        *,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
        **kwargs: Unpack[RegisterOptionsPOSTKwargsInput],
    ) -> Union[
        RegisterOptionsPOSTResponse,
        GeneralErrorResponse,
        RegisterOptionsPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def sign_in_options_post(
        self,
        *,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        SignInOptionsPOSTResponse, GeneralErrorResponse, SignInOptionsPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def sign_up_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        session: Optional[SessionContainer],
        should_try_linking_with_session_user: Optional[bool],
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[SignUpPOSTResponse, GeneralErrorResponse, SignUpPOSTErrorResponse]: ...

    @abstractmethod
    async def sign_in_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: AuthenticationPayload,
        tenant_id: str,
        session: Optional[SessionContainer],
        should_try_linking_with_session_user: Optional[bool],
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[SignInPOSTResponse, GeneralErrorResponse, SignInPOSTErrorResponse]: ...

    @abstractmethod
    async def generate_recover_account_token_post(
        self,
        *,
        email: str,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel,
        GeneralErrorResponse,
        GenerateRecoverAccountTokenPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def recover_account_post(
        self,
        *,
        token: str,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        RecoverAccountPOSTResponse,
        GeneralErrorResponse,
        RecoverAccountPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def list_credentials_get(
        self,
        *,
        options: APIOptions,
        user_context: UserContext,
        session: SessionContainer,
    ) -> Union[ListCredentialsGETResponse, GeneralErrorResponse]: ...

    @abstractmethod
    async def register_credential_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        session: SessionContainer,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel, GeneralErrorResponse, RegisterCredentialPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def remove_credential_post(
        self,
        *,
        webauthn_credential_id: str,
        session: SessionContainer,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel, GeneralErrorResponse, RemoveCredentialPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def email_exists_get(
        self,
        *,
        email: str,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[EmailExistsGetResponse, GeneralErrorResponse]: ...

Classes

class APIInterface

Helper class that provides a standard way to create an ABC using inheritance.

Expand source code
class APIInterface(BaseAPIInterface):
    disable_register_options_post: bool = False
    disable_sign_in_options_post: bool = False
    disable_sign_up_post: bool = False
    disable_sign_in_post: bool = False
    disable_generate_recover_account_token_post: bool = False
    disable_recover_account_post: bool = False
    disable_register_credential_post: bool = False
    disable_email_exists_get: bool = False
    disable_list_credentials_get: bool = False
    disable_remove_credential_post: bool = False

    @abstractmethod
    async def register_options_post(
        self,
        *,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
        **kwargs: Unpack[RegisterOptionsPOSTKwargsInput],
    ) -> Union[
        RegisterOptionsPOSTResponse,
        GeneralErrorResponse,
        RegisterOptionsPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def sign_in_options_post(
        self,
        *,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        SignInOptionsPOSTResponse, GeneralErrorResponse, SignInOptionsPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def sign_up_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        session: Optional[SessionContainer],
        should_try_linking_with_session_user: Optional[bool],
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[SignUpPOSTResponse, GeneralErrorResponse, SignUpPOSTErrorResponse]: ...

    @abstractmethod
    async def sign_in_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: AuthenticationPayload,
        tenant_id: str,
        session: Optional[SessionContainer],
        should_try_linking_with_session_user: Optional[bool],
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[SignInPOSTResponse, GeneralErrorResponse, SignInPOSTErrorResponse]: ...

    @abstractmethod
    async def generate_recover_account_token_post(
        self,
        *,
        email: str,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel,
        GeneralErrorResponse,
        GenerateRecoverAccountTokenPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def recover_account_post(
        self,
        *,
        token: str,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        RecoverAccountPOSTResponse,
        GeneralErrorResponse,
        RecoverAccountPOSTErrorResponse,
    ]: ...

    @abstractmethod
    async def list_credentials_get(
        self,
        *,
        options: APIOptions,
        user_context: UserContext,
        session: SessionContainer,
    ) -> Union[ListCredentialsGETResponse, GeneralErrorResponse]: ...

    @abstractmethod
    async def register_credential_post(
        self,
        *,
        webauthn_generated_options_id: str,
        credential: RegistrationPayload,
        tenant_id: str,
        session: SessionContainer,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel, GeneralErrorResponse, RegisterCredentialPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def remove_credential_post(
        self,
        *,
        webauthn_credential_id: str,
        session: SessionContainer,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[
        OkResponseBaseModel, GeneralErrorResponse, RemoveCredentialPOSTErrorResponse
    ]: ...

    @abstractmethod
    async def email_exists_get(
        self,
        *,
        email: str,
        tenant_id: str,
        options: APIOptions,
        user_context: UserContext,
    ) -> Union[EmailExistsGetResponse, GeneralErrorResponse]: ...

Ancestors

Subclasses

Class variables

var disable_email_exists_get : bool

The type of the None singleton.

var disable_generate_recover_account_token_post : bool

The type of the None singleton.

var disable_list_credentials_get : bool

The type of the None singleton.

var disable_recover_account_post : bool

The type of the None singleton.

var disable_register_credential_post : bool

The type of the None singleton.

var disable_register_options_post : bool

The type of the None singleton.

var disable_remove_credential_post : bool

The type of the None singleton.

var disable_sign_in_options_post : bool

The type of the None singleton.

var disable_sign_in_post : bool

The type of the None singleton.

var disable_sign_up_post : bool

The type of the None singleton.

Methods

async def email_exists_get(self, *, email: str, tenant_id: str, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[EmailExistsGetResponseGeneralErrorResponse]
async def generate_recover_account_token_post(self, *, email: str, tenant_id: str, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[OkResponseBaseModelGeneralErrorResponseRecoverAccountNotAllowedErrorResponse]
async def list_credentials_get(self, *, options: APIOptions, user_context: Dict[str, Any], session: SessionContainer) ‑> Union[ListCredentialsResponseGeneralErrorResponse]
async def recover_account_post(self, *, token: str, webauthn_generated_options_id: str, credential: RegistrationPayload, tenant_id: str, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[RecoverAccountPOSTResponseGeneralErrorResponseRecoverAccountTokenInvalidErrorResponseInvalidCredentialsErrorResponseOptionsNotFoundErrorResponseInvalidOptionsErrorResponseInvalidAuthenticatorErrorResponse]
async def register_credential_post(self, *, webauthn_generated_options_id: str, credential: RegistrationPayload, tenant_id: str, session: SessionContainer, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[OkResponseBaseModelGeneralErrorResponseInvalidCredentialsErrorResponseOptionsNotFoundErrorResponseInvalidOptionsErrorResponseRegisterCredentialNotAllowedErrorResponseInvalidAuthenticatorErrorResponse]
async def register_options_post(self, *, tenant_id: str, options: APIOptions, user_context: Dict[str, Any], **kwargs: Unpack[RegisterOptionsPOSTKwargsInput]) ‑> Union[RegisterOptionsPOSTResponseGeneralErrorResponseRecoverAccountTokenInvalidErrorResponseInvalidOptionsErrorResponseInvalidEmailErrorResponse]
async def remove_credential_post(self, *, webauthn_credential_id: str, session: SessionContainer, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[OkResponseBaseModelGeneralErrorResponseCredentialNotFoundErrorResponse]
async def sign_in_options_post(self, *, tenant_id: str, options: APIOptions, user_context: Dict[str, Any]) ‑> Union[SignInOptionsPOSTResponseGeneralErrorResponseInvalidOptionsErrorResponse]
async def sign_in_post(self, *, webauthn_generated_options_id: str, credential: AuthenticationPayload, tenant_id: str, session: Optional[SessionContainer], should_try_linking_with_session_user: Optional[bool], options: APIOptions, user_context: Dict[str, Any]) ‑> Union[SignInPOSTResponseGeneralErrorResponseInvalidCredentialsErrorResponseSignInNotAllowedErrorResponse]
async def sign_up_post(self, *, webauthn_generated_options_id: str, credential: RegistrationPayload, tenant_id: str, session: Optional[SessionContainer], should_try_linking_with_session_user: Optional[bool], options: APIOptions, user_context: Dict[str, Any]) ‑> Union[SignUpPOSTResponseGeneralErrorResponseSignUpNotAllowedErrorResponseInvalidAuthenticatorErrorResponseEmailAlreadyExistsErrorResponseInvalidCredentialsErrorResponseOptionsNotFoundErrorResponseInvalidOptionsErrorResponse]
class APIOptions (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class APIOptions(CamelCaseBaseModel):
    recipe_implementation: RecipeInterface
    app_info: AppInfo
    config: "NormalisedWebauthnConfig"
    recipe_id: str
    req: BaseRequest
    res: BaseResponse
    email_delivery: EmailDeliveryIngredient[TypeWebauthnEmailDeliveryInput]

Ancestors

Class variables

var app_infoAppInfo

The type of the None singleton.

var config : NormalisedWebauthnConfig

The type of the None singleton.

var email_deliveryEmailDeliveryIngredient[TypeWebauthnRecoverAccountEmailDeliveryInput]

The type of the None singleton.

var recipe_id : str

The type of the None singleton.

var recipe_implementationRecipeInterface

The type of the None singleton.

var reqBaseRequest

The type of the None singleton.

var resBaseResponse

The type of the None singleton.

Inherited members

class DisplayNameEmailInput (*args, **kwargs)

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Expand source code
class DisplayNameEmailInput(TypedDict):
    display_name: Optional[str]
    email: str

Ancestors

  • builtins.dict

Class variables

var display_name : Optional[str]

The type of the None singleton.

var email : str

The type of the None singleton.

class EmailExistsGetResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class EmailExistsGetResponse(OkResponseBaseModel):
    exists: bool

Ancestors

Class variables

var exists : bool

The type of the None singleton.

Inherited members

class RecoverAccountNotAllowedErrorResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class RecoverAccountNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["RECOVER_ACCOUNT_NOT_ALLOWED"], str]
):
    status: Literal["RECOVER_ACCOUNT_NOT_ALLOWED"] = "RECOVER_ACCOUNT_NOT_ALLOWED"

Ancestors

Class variables

var model_config

The type of the None singleton.

var status : Literal['RECOVER_ACCOUNT_NOT_ALLOWED']

The type of the None singleton.

class GenerateRecoverAccountTokenPOSTErrorResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class RecoverAccountNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["RECOVER_ACCOUNT_NOT_ALLOWED"], str]
):
    status: Literal["RECOVER_ACCOUNT_NOT_ALLOWED"] = "RECOVER_ACCOUNT_NOT_ALLOWED"

Ancestors

Inherited members

class RecoverAccountPOSTResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class RecoverAccountPOSTResponse(OkResponseBaseModel):
    user: User
    email: str

Ancestors

Class variables

var email : str

The type of the None singleton.

var userUser

The type of the None singleton.

Inherited members

class RecoverAccountTokenInput (*args, **kwargs)

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Expand source code
class RecoverAccountTokenInput(TypedDict):
    recover_account_token: str

Ancestors

  • builtins.dict

Class variables

var recover_account_token : str

The type of the None singleton.

class RegisterCredentialNotAllowedErrorResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class RegisterCredentialNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["REGISTER_CREDENTIAL_NOT_ALLOWED"], str]
):
    status: Literal["REGISTER_CREDENTIAL_NOT_ALLOWED"] = (
        "REGISTER_CREDENTIAL_NOT_ALLOWED"
    )

Ancestors

Inherited members

class RegisterOptionsPOSTKwargsInput (*args, **kwargs)

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Expand source code
class RegisterOptionsPOSTKwargsInput(TypedDict):
    recover_account_token: NotRequired[str]
    display_name: NotRequired[str]
    email: NotRequired[str]

Ancestors

  • builtins.dict

Class variables

var display_name : str

The type of the None singleton.

var email : str

The type of the None singleton.

var recover_account_token : str

The type of the None singleton.

class RegisterOptionsPOSTResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class RegisterOptionsPOSTResponse(OkResponseBaseModel):
    class RelyingParty(CamelCaseBaseModel):
        id: str
        name: str

    class User(CamelCaseBaseModel):
        id: str
        name: str
        display_name: str

    class ExcludeCredentials(CamelCaseBaseModel):
        id: str
        type: Literal["public-key"]
        transports: List[Literal["ble", "hybrid", "internal", "nfc", "usb"]]

    class PubKeyCredParams(CamelCaseBaseModel):
        alg: int
        type: str

    class AuthenticatorSelection(CamelCaseBaseModel):
        require_resident_key: bool
        resident_key: ResidentKey
        user_verification: UserVerification

    webauthn_generated_options_id: str
    created_at: int
    expires_at: int
    rp: RelyingParty
    user: User
    challenge: str
    timeout: int
    exclude_credentials: List[ExcludeCredentials]
    attestation: Literal["none", "indirect", "direct", "enterprise"]
    pub_key_cred_params: List[PubKeyCredParams]
    authenticator_selection: AuthenticatorSelection

Ancestors

Class variables

var AuthenticatorSelection

Helper class that provides a standard way to create an ABC using inheritance.

var ExcludeCredentials

Helper class that provides a standard way to create an ABC using inheritance.

var PubKeyCredParams

Helper class that provides a standard way to create an ABC using inheritance.

var RelyingParty

Helper class that provides a standard way to create an ABC using inheritance.

var User

Helper class that provides a standard way to create an ABC using inheritance.

var attestation : Literal['none', 'indirect', 'direct', 'enterprise']

The type of the None singleton.

var authenticator_selectionRegisterOptionsPOSTResponse.AuthenticatorSelection

The type of the None singleton.

var challenge : str

The type of the None singleton.

var created_at : int

The type of the None singleton.

var exclude_credentials : List[RegisterOptionsPOSTResponse.ExcludeCredentials]

The type of the None singleton.

var expires_at : int

The type of the None singleton.

var pub_key_cred_params : List[RegisterOptionsPOSTResponse.PubKeyCredParams]

The type of the None singleton.

var rpRegisterOptionsPOSTResponse.RelyingParty

The type of the None singleton.

var timeout : int

The type of the None singleton.

var userRegisterOptionsPOSTResponse.User

The type of the None singleton.

var webauthn_generated_options_id : str

The type of the None singleton.

Inherited members

class SignInNotAllowedErrorResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SignInNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["SIGN_IN_NOT_ALLOWED"], str]
):
    status: Literal["SIGN_IN_NOT_ALLOWED"] = "SIGN_IN_NOT_ALLOWED"

Ancestors

Inherited members

class SignInOptionsPOSTResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SignInOptionsPOSTResponse(OkResponseBaseModel):
    webauthn_generated_options_id: str
    created_at: int
    expires_at: int
    rp_id: str
    challenge: str
    timeout: int
    user_verification: UserVerification

Ancestors

Class variables

var challenge : str

The type of the None singleton.

var created_at : int

The type of the None singleton.

var expires_at : int

The type of the None singleton.

var rp_id : str

The type of the None singleton.

var timeout : int

The type of the None singleton.

var user_verification : Literal['required', 'preferred', 'discouraged']

The type of the None singleton.

var webauthn_generated_options_id : str

The type of the None singleton.

Inherited members

class SignInPOSTResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SignInPOSTResponse(OkResponseBaseModel):
    user: User
    session: SessionContainer

Ancestors

Class variables

var sessionSessionContainer

The type of the None singleton.

var userUser

The type of the None singleton.

Inherited members

class SignUpNotAllowedErrorResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SignUpNotAllowedErrorResponse(
    StatusReasonResponseBaseModel[Literal["SIGN_UP_NOT_ALLOWED"], str]
):
    status: Literal["SIGN_UP_NOT_ALLOWED"] = "SIGN_UP_NOT_ALLOWED"

Ancestors

Inherited members

class SignUpPOSTResponse (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SignUpPOSTResponse(OkResponseBaseModel):
    user: User
    session: SessionContainer

Ancestors

Class variables

var sessionSessionContainer

The type of the None singleton.

var userUser

The type of the None singleton.

Inherited members

class TypeWebauthnRecoverAccountEmailDeliveryInput (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class TypeWebauthnRecoverAccountEmailDeliveryInput(CamelCaseBaseModel):
    type: Literal["RECOVER_ACCOUNT"] = "RECOVER_ACCOUNT"
    user: WebauthnRecoverAccountEmailDeliveryUser
    recover_account_link: str
    tenant_id: str

Ancestors

Class variables

var model_config

The type of the None singleton.

The type of the None singleton.

var tenant_id : str

The type of the None singleton.

var type : Literal['RECOVER_ACCOUNT']

The type of the None singleton.

var userWebauthnRecoverAccountEmailDeliveryUser

The type of the None singleton.

class TypeWebauthnEmailDeliveryInput (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class TypeWebauthnRecoverAccountEmailDeliveryInput(CamelCaseBaseModel):
    type: Literal["RECOVER_ACCOUNT"] = "RECOVER_ACCOUNT"
    user: WebauthnRecoverAccountEmailDeliveryUser
    recover_account_link: str
    tenant_id: str

Ancestors

Class variables

The type of the None singleton.

var tenant_id : str

The type of the None singleton.

var type : Literal['RECOVER_ACCOUNT']

The type of the None singleton.

var userWebauthnRecoverAccountEmailDeliveryUser

The type of the None singleton.

Inherited members

class WebauthnRecoverAccountEmailDeliveryUser (**data: Any)

Helper class that provides a standard way to create an ABC using inheritance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class WebauthnRecoverAccountEmailDeliveryUser(CamelCaseBaseModel):
    id: str
    recipe_user_id: Optional[RecipeUserId]
    email: str

Ancestors

Class variables

var email : str

The type of the None singleton.

var id : str

The type of the None singleton.

var recipe_user_id : Optional[RecipeUserId]

The type of the None singleton.

Inherited members