MCPcopy Index your code
hub / github.com/python-websockets/websockets / query_param_auth

Function query_param_auth

experiments/authentication/app.py:123–133  ·  view source on GitHub ↗

Authenticate user from token in query parameter.

(connection, request)

Source from the content-addressed store, hash-verified

121
122
123async def query_param_auth(connection, request):
124 """Authenticate user from token in query parameter."""
125 token = get_query_param(request.path, "token")
126 if token is None:
127 return connection.respond(http.HTTPStatus.UNAUTHORIZED, "Missing token\n")
128
129 user = get_user(token)
130 if user is None:
131 return connection.respond(http.HTTPStatus.UNAUTHORIZED, "Invalid token\n")
132
133 connection.username = user
134
135
136async def cookie_auth(connection, request):

Callers

nothing calls this directly

Calls 3

get_query_paramFunction · 0.85
get_userFunction · 0.85
respondMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…