Buckets:

download
raw
3.93 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "present",
"symbol": "send_data",
"file": "client/python/gradio_client/client.py",
"lines": "339",
"notes": "In-repo Python client (gradio_client Client). After _login (client.py:982) stores the access-token cookies returned by POST /login, send_data POSTs the action to queue/join (utils.SSE_DATA_URL) with cookies=self.cookies, reaching the login_check enforcer on /queue/join (gradio/routes.py:1503). The Svelte web frontend is not present in this checkout."
},
{
"role": "Authentication enforcer",
"status": "present",
"symbol": "login_check",
"file": "gradio/routes.py",
"lines": "432",
"notes": "FastAPI dependency installed via dependencies=[Depends(login_check)] on /queue/join (routes.py:1503), /api/{api_name}, /config, /file=, /upload, etc. It receives the principal from get_current_user (Depends, routes.py:432) and raises 401 when auth is configured and no user resolves. Opt-in: only active when launch(auth=...) is set; off by default (no auth). With auth_dependency (external e.g. OAuth) the user comes from a user callable instead of the session store."
},
{
"role": "Verifier",
"status": "present",
"symbol": "get_current_user",
"file": "gradio/routes.py",
"lines": "419",
"notes": "Reached from login_check (routes.py:432, Depends(get_current_user)). Reads the opaque access-token-{cookie_id} (or -unsecure-) cookie and resolves it with app.tokens.get(token) (routes.py:428), returning the username or None; login_check makes the accept/reject decision on that result."
},
{
"role": "Session manager",
"status": "present",
"symbol": "tokens",
"file": "gradio/routes.py",
"lines": "241",
"notes": "In-memory server-side dict App.tokens (token -> username), initialised in App.__init__ (routes.py:241, reset in configure_app routes.py:286). Looked up by get_current_user at routes.py:428; populated by login (routes.py:513, token from secrets.token_urlsafe(16)) and purged by logout (routes.py:560-565). It is a plain dict with no accessor method, so the field is cited."
},
{
"role": "Authorisation enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "After login_check passes, routes such as queue_join (routes.py:1504) run without any principal-based authorisation check; every authenticated user may call every endpoint. The only access checks are resource-based (utils.is_allowed_file gradio/utils.py:1867 for file paths, api_open/visibility checks), which do not use the principal, so they were not mapped."
},
{
"role": "Decider",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No decision function evaluates the principal against a policy on the traced path (gradio/routes.py login/login_check/queue_join). is_allowed_file (gradio/utils.py:1867) is a path allow/block list independent of the user, not a lookalike to substitute."
},
{
"role": "Policy provider",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No per-user privileges/roles store exists; app.auth (routes.py:277) holds only username->password credentials. allowed_paths/blocked_paths configuration is user-independent."
},
{
"role": "System",
"status": "present",
"symbol": "queue_join",
"file": "gradio/routes.py",
"lines": "1504",
"notes": "Handler for POST /queue/join guarded by Depends(login_check) (routes.py:1503); receives the principal via Depends(get_current_user) and pushes the prediction event onto the queue (queue_join_helper -> blocks._queue.push, routes.py:1533). Mapped because the authentication half of the pattern is present."
}
]
}

Xet Storage Details

Size:
3.93 kB
·
Xet hash:
fb2ace4b79f8c6a90a9ccd5666dc8276433d4de01355c8db56adcfc7b0a82791

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.