You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
595 B
34 lines
595 B
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class UserSummary(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: str
|
|
username: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
username: str
|
|
password: str
|
|
|
|
|
|
class LoginResponse(BaseModel):
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_at: datetime
|
|
user: UserSummary
|
|
|
|
|
|
class AuthMeResponse(BaseModel):
|
|
user: UserSummary
|
|
|
|
|
|
class LogoutResponse(BaseModel):
|
|
success: bool = True
|
|
|