File size: 705 Bytes
02af15b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Authentication models."""

from __future__ import annotations

from datetime import datetime

from pydantic import BaseModel, Field


class TokenResponse(BaseModel):
    """JWT issuance response."""

    token: str = Field(..., description="JWT access token")
    token_type: str = Field("bearer", description="Token type (always bearer)")
    expires_at: datetime = Field(..., description="Expiration timestamp")


class JWTPayload(BaseModel):
    """JWT claims payload."""

    sub: str = Field(..., description="Subject (user_id)")
    iat: int = Field(..., description="Issued at timestamp")
    exp: int = Field(..., description="Expiration timestamp")


__all__ = ["TokenResponse", "JWTPayload"]