# models.auth ### *class* models.auth.Token(, access_token: str, token_type: str, session_id: str | None = None, user: UserResponse | None = None) Bases: `BaseModel` Модель JWT-токена. Атрибуты: - `access_token` (str): Значение токена (в формате JWT). - `token_type` (str): Тип токена (обычно `bearer`). - `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) 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) 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) 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*