auth begin

This commit is contained in:
2026-10-03 07:51:44 +03:00
parent 3e966c9ff6
commit 86bcd5b141
8 changed files with 370 additions and 33 deletions
+31
View File
@@ -2,6 +2,37 @@ from pydantic import BaseModel, Field
from typing import Optional, List
from datetime import datetime
# ============================================================
# USERS
# ============================================================
class UserCreate(BaseModel):
username: str
password: str
display_name: Optional[str] = ""
role: Optional[str] = "personal"
class UserLogin(BaseModel):
username: str
password: str
class UserOut(BaseModel):
id: int
username: str
display_name: str
role: str
created_at: str
class Config:
from_attributes = True
class Token(BaseModel):
access_token: str
token_type: str = "bearer"
user: UserOut
# ============================================================
# CLIENTS
# ============================================================