Initial commit

This commit is contained in:
2026-06-07 02:32:28 +03:00
commit 2e645694e4
86 changed files with 10490 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
from pydantic import BaseModel, Field, field_validator
from app.schemas.user import UserRead
from app.schemas.validators import validate_username
class BootstrapRequest(BaseModel):
username: str = Field(min_length=3, max_length=64)
password: str = Field(min_length=8, max_length=128)
@field_validator("username")
@classmethod
def validate_username_value(cls, value: str) -> str:
return validate_username(value)
class LoginRequest(BaseModel):
username: str = Field(min_length=3, max_length=64)
password: str = Field(min_length=8, max_length=128)
@field_validator("username")
@classmethod
def validate_username_value(cls, value: str) -> str:
return validate_username(value)
class RefreshRequest(BaseModel):
refresh_token: str
class LogoutResponse(BaseModel):
success: bool = True
class AccessTokenResponse(BaseModel):
access_token: str
token_type: str = "bearer"
class TokenResponse(AccessTokenResponse):
refresh_token: str
user: UserRead