Initial commit: site monorepo with API, web, and infra.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 10:11:54 +03:00
co-authored by Cursor
commit 016910ffb7
447 changed files with 73972 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
from pydantic import BaseModel, EmailStr, Field, field_validator
from app.core.password_policy import validate_password_strength
class RegisterIn(BaseModel):
email: EmailStr
password: str = Field(min_length=8)
@field_validator("email", "password", mode="before")
@classmethod
def strip_whitespace(cls, value: str) -> str:
if isinstance(value, str):
return value.strip()
return value
@field_validator("password")
@classmethod
def password_policy(cls, value: str) -> str:
return validate_password_strength(value)
class LoginIn(BaseModel):
email: EmailStr
password: str = Field(min_length=8)
@field_validator("email", "password", mode="before")
@classmethod
def strip_whitespace(cls, value: str) -> str:
if isinstance(value, str):
return value.strip()
return value
class VerifyEmailIn(BaseModel):
token: str
class ForgotPasswordIn(BaseModel):
email: EmailStr
class ResendVerificationIn(BaseModel):
email: EmailStr
class ResetPasswordIn(BaseModel):
token: str
new_password: str = Field(min_length=8)
@field_validator("new_password")
@classmethod
def password_policy(cls, value: str) -> str:
return validate_password_strength(value)
class AuthUserOut(BaseModel):
id: str
email: EmailStr
role: str
is_superuser: bool
status: str
class LoginOut(BaseModel):
access_token: str
token_type: str = "bearer"
expires_in: int = 900
user: AuthUserOut