"""
CSRF Models (Phase 20)
======================
CSRF Token 相關的 Pydantic 模型。

建立日期: 2026-03-28 (台北時間)
建立者: Claude Code (首席架構師)
"""

from pydantic import BaseModel, Field


class CSRFTokenResponse(BaseModel):
    """CSRF Token 回應模型"""

    token: str = Field(
        ...,
        description="CSRF Token (64 字元十六進位)",
        min_length=64,
        max_length=64,
    )
    cookie_name: str = Field(
        default="awoooi_csrf_token",
        description="Cookie 名稱",
    )
    header_name: str = Field(
        default="X-CSRF-Token",
        description="Header 名稱 (敏感請求時使用)",
    )

    model_config = {
        "json_schema_extra": {
            "example": {
                "token": "a1b2c3d4e5f6789012345678901234567890123456789012345678901234abcd",
                "cookie_name": "awoooi_csrf_token",
                "header_name": "X-CSRF-Token",
            }
        }
    }
