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

Function create_token

experiments/authentication/app.py:23–28  ·  view source on GitHub ↗

Create token for user and delete it once its lifetime is over.

(user, lifetime=1)

Source from the content-addressed store, hash-verified

21
22
23def create_token(user, lifetime=1):
24 """Create token for user and delete it once its lifetime is over."""
25 token = uuid.uuid4().hex
26 USERS[token] = user
27 asyncio.get_running_loop().call_later(lifetime, USERS.pop, token)
28 return token
29
30
31def get_user(token):

Callers 1

serve_htmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…