models.auth

class models.auth.Token(*, access_token: str, token_type: str, session_id: str | None = None, user: UserResponse | None = None)[source]

Bases: BaseModel

Токен пользователя

Атрибуты:

access_token (str): Токен пользователя (захэширован) token_type (str): Тип токена session_id (Optional[str]): Идентификатор сессии user (Optional[UserResponse]): Пользователь на основе проверки наличия пользователя

access_token: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_id: str | None
token_type: str
user: UserResponse | None
class models.auth.UserCreate(*, username: str, password: str, is_admin: bool = False)[source]

Bases: BaseModel

Модель созданного пользователя

Атрибуты:

username (str): Имя пользователя password (str): Пароль пользователя is_admin (bool): Административный доступ

is_admin: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: str
username: str
class models.auth.UserLogin(*, username: str, password: str)[source]

Bases: BaseModel

Модель авторизации пользователя

Атрибуты:

username (str): Имя пользователя password (str): Пароль пользователя

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: str
username: str
class models.auth.UserResponse(*, id: int, username: str, is_admin: bool)[source]

Bases: BaseModel

Модель проверки наличия пользователя

Атрибуты:

id (int): Идентификатор username (str): Имя пользователя is_admin (bool): Административный доступ

id: int
is_admin: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

username: str