diff --git a/schemas/auth.py b/schemas/auth.py new file mode 100644 index 0000000..7d5d7bf --- /dev/null +++ b/schemas/auth.py @@ -0,0 +1,31 @@ +from pydantic import BaseModel, Field +from datetime import datetime +from typing import Optional + +class AuthBase(BaseModel): + user_id: str = Field(..., description="User ID associated with the auth token") + token: str = Field(..., description="Authentication token") + is_blacklisted: bool = Field(default=False, description="Token blacklist status") + expires_at: datetime = Field(..., description="Token expiration timestamp") + +class AuthCreate(AuthBase): + class Config: + schema_extra = { + "example": { + "user_id": "user123", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", + "expires_at": "2024-01-01T00:00:00Z" + } + } + +class Auth(AuthBase): + class Config: + orm_mode = True + schema_extra = { + "example": { + "user_id": "user123", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", + "is_blacklisted": False, + "expires_at": "2024-01-01T00:00:00Z" + } + } \ No newline at end of file