Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PphXq1s43DNRj1uWKGXof
22 lines
425 B
Python
22 lines
425 B
Python
import uuid
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class RegisterRequest(BaseModel):
|
|
username: str = Field(min_length=3, max_length=32)
|
|
password: str = Field(min_length=8, max_length=128)
|
|
email: str | None = None
|
|
|
|
|
|
class UserOut(BaseModel):
|
|
id: uuid.UUID
|
|
username: str
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
username: str
|
|
password: str
|