MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / _extract_bearer_token

Function _extract_bearer_token

apps/admin/dependencies.py:73–79  ·  view source on GitHub ↗
(authorization: str)

Source from the content-addressed store, hash-verified

71
72
73def _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
82def _require_admin_payload(authorization: str) -> dict:

Callers 2

_require_admin_payloadFunction · 0.85
get_admin_sessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected