(authorization: str)
| 71 | |
| 72 | |
| 73 | def _extract_bearer_token(authorization: str) -> str: |
| 74 | if not authorization or not authorization.startswith("Bearer "): |
| 75 | raise HTTPException(status_code=401, detail="未授权或授权校验失败") |
| 76 | token = authorization.split(" ", 1)[1].strip() |
| 77 | if not token: |
| 78 | raise HTTPException(status_code=401, detail="未授权或授权校验失败") |
| 79 | return token |
| 80 | |
| 81 | |
| 82 | def _require_admin_payload(authorization: str) -> dict: |
no outgoing calls
no test coverage detected