This repository has been archived on 2026-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Proxmox-VPS-Panel-secure/backend/app/schemas.py
T

32 lines
710 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from datetime import datetime
from pydantic import BaseModel, ConfigDict, EmailStr, Field
from .models import UserRole
class UserCreate(BaseModel):
"""Данные для регистрации пользователя."""
email: EmailStr
password: str = Field(min_length=12, max_length=128)
class UserOut(BaseModel):
"""Публичное представление пользователя без пароля."""
model_config = ConfigDict(from_attributes=True)
id: int
email: EmailStr
role: UserRole
is_active: bool
created_at: datetime
class TokenOut(BaseModel):
"""Ответ с access token."""
access_token: str
token_type: str = "bearer"