gonets/SRV/docs/_build/markdown/api/models/auth.md

90 lines
2.5 KiB
Markdown
Raw Normal View History

2025-10-14 16:11:12 +05:00
# models.auth
### *class* models.auth.Token(, access_token: str, token_type: str, session_id: str | None = None, user: UserResponse | None = None)
Bases: `BaseModel`
Модель JWT-токена.
2025-10-14 16:11:12 +05:00
Атрибуты:
- `access_token` (str): Значение токена (в формате JWT).
- `token_type` (str): Тип токена (обычно `bearer`).
- `session_id` (Optional[str]): Идентификатор сессии.
- `user` (Optional[UserResponse]): Данные пользователя, если включены в ответ.
2025-10-14 16:11:12 +05:00
#### 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`
Модель созданного пользователя.
2025-10-14 16:11:12 +05:00
Атрибуты:
- `username` (str): Имя пользователя.
- `password` (str): Пароль пользователя.
- `is_admin` (bool): Флаг административного доступа.
2025-10-14 16:11:12 +05:00
#### 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`
Модель авторизации пользователя.
2025-10-14 16:11:12 +05:00
Атрибуты:
- `username` (str): Имя пользователя.
- `password` (str): Пароль пользователя.
2025-10-14 16:11:12 +05:00
#### 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`
Модель, используемая при возврате сведений о пользователе.
2025-10-14 16:11:12 +05:00
Атрибуты:
- `id` (int): Идентификатор пользователя.
- `username` (str): Имя пользователя.
- `is_admin` (bool): Флаг административного доступа.
2025-10-14 16:11:12 +05:00
#### 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*