MCPcopy
hub / github.com/encode/starlette / websocket_endpoint_decorated

Function websocket_endpoint_decorated

tests/test_authentication.py:176–184  ·  view source on GitHub ↗
(websocket: WebSocket, additional: str)

Source from the content-addressed store, hash-verified

174@ws_inject_decorator(additional="payload")
175@requires("authenticated")
176async def websocket_endpoint_decorated(websocket: WebSocket, additional: str) -> None:
177 await websocket.accept()
178 await websocket.send_json(
179 {
180 "authenticated": websocket.user.is_authenticated,
181 "user": websocket.user.display_name,
182 "additional": additional,
183 }
184 )
185
186
187app = Starlette(

Callers

nothing calls this directly

Calls 2

acceptMethod · 0.80
send_jsonMethod · 0.45

Tested by

no test coverage detected