Buckets:

download
raw
4.77 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client sends an opaque session id to the traced worker. The only in-repo client of the /api endpoints guarded by ToolBoxHandler.handle_api_call (toolboxv2/utils/workers/server_worker.py:1025) is Session.fetch (toolboxv2/utils/system/session.py:443), and it sends a CloudM.Auth JWT as Authorization: Bearer (_get_auth_headers, line 436), so the credential type does not match the pattern. The caller is therefore outside the repo."
},
{
"role": "Authentication enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The HTTP worker (wsgi_app, toolboxv2/utils/workers/server_worker.py:1808/1817) resolves the caller through SessionManager.get_session_from_request_sync (toolboxv2/utils/workers/session.py:735). That method uses either an HMAC-signed, stateless client-side cookie (SignedCookieSession.decode, session.py:278, which the file itself calls 'no server-side storage') or a Bearer JWT checked by CloudM.Auth validate_session -> _validate_jwt (mods/CloudM/auth/jwt_tokens.py:57, pyjwt.decode). Neither is an opaque session id resolved against server state, so per the plan there is no session Authentication enforcer. Off-path: opaque live-session tokens are checked in llm-gateway/live_handler.py:430 handle_websocket, a separate service with no authorisation half."
},
{
"role": "Verifier",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "On the traced path, credential checks happen in SignedCookieSession.decode (toolboxv2/utils/workers/session.py:278, an HMAC signature plus expiry check on a self-contained cookie) and AuthSessionVerifier.verify_session_async/sync (session.py:444) -> CloudM.Auth validate_session -> _validate_jwt (toolboxv2/mods/CloudM/auth/jwt_tokens.py:57, JWT signature and jti blacklist). These are verifiable-token checks, not session-id verification. Off-path: llm-gateway/live_handler.py:363 get_session."
},
{
"role": "Session manager",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "SessionManager (toolboxv2/utils/workers/session.py:521) keeps no server-side session store: all session state lives in the signed cookie, and _pending_updates only buffers cookie rewrites. No open-session table exists on the worker path. Off-path: llm-gateway LiveHandler.active_sessions / live_sessions SQLite table (llm-gateway/live_handler.py:203) and toolboxv2/mods/llama_lab/webapp/live.py LiveHandler.sessions."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "handle_api_call",
"file": "toolboxv2/utils/workers/server_worker.py",
"lines": "1025",
"notes": "wsgi_app (server_worker.py:1859) sends every /api/<Module>/<function> request to ToolBoxHandler.handle_api_call, which gets the principal's level from request.session (line 1039). It then calls check_access (line 1040) and returns 401/403 when the check fails, before dispatching to the module. The ToolBoxHandler is constructed at line 3190."
},
{
"role": "Decider",
"status": "present",
"symbol": "check_access",
"file": "toolboxv2/utils/workers/server_worker.py",
"lines": "452",
"notes": "handle_api_call calls AccessController.check_access at server_worker.py:1040. It allows open_modules, functions starting with 'open' and whitelisted CloudM.Auth functions. It denies level 0 (not logged in), allows ADMIN (-1), and otherwise compares user_level to required_level (default LOGGED_IN)."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "_load_config",
"file": "toolboxv2/utils/workers/server_worker.py",
"lines": "415",
"notes": "AccessController._load_config loads config.toolbox.open_modules into _open_modules, which check_access (line 452) consults through is_public_endpoint (line 440). The principal's privilege level is read by get_user_level (line 487, called at line 1039) from the session's level field. Caveat: the per-endpoint required level is a hard-coded default (AccessLevel.LOGGED_IN)."
},
{
"role": "System",
"status": "present",
"symbol": "a_run_any",
"file": "toolboxv2/utils/toolbox.py",
"lines": "2367",
"notes": "Once check_access allows the request, handle_api_call calls self.app.a_run_any((module_name, function_name), ...) at server_worker.py:1073. App.a_run_any dispatches to the requested ToolBoxV2 module function, which is the protected business action."
}
]
}

Xet Storage Details

Size:
4.77 kB
·
Xet hash:
10b1f25dbf20801ceb285b29f95213d6be54fc29f6f36052cc35c26865e06eb6

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