"""鉴权中间件"""

from __future__ import annotations

from fastapi import Request, Response
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint


class AuthMiddleware(BaseHTTPMiddleware):
    """API 鉴权 — 验证请求携带的 token/key"""

    async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response:
        # TODO: 实现鉴权逻辑（API key / token 验证）
        return await call_next(request)
