MCPcopy
hub / github.com/AstrBotDevs/AstrBot / _alias_username

Function _alias_username

tests/test_fastapi_v1_dashboard.py:618–622  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

616 provider_manager: FakeProviderManager,
617) -> None:
618 def _alias_username(request: Request) -> str:
619 auth_header = request.headers.get("Authorization", "")
620 token = auth_header.removeprefix("Bearer ").strip()
621 payload = jwt.decode(token, JWT_SECRET, algorithms=["HS256"])
622 return payload["username"]
623
624 def alias_get(path: str):
625 return app.get(path, include_in_schema=False)

Calls 2

decodeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected