Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /namastexlabs_automagik-tools.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends the session cookie to /api/admin/workspaces; the hub_ui frontend is not in the repo (grep for admin/workspaces, local_session, wos_session found only server code). The caller is outside the repo." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The request is authenticated by the FastAPI dependency get_current_user_id (automagik_tools/hub/api_routes.py:34), which calls get_current_user (automagik_tools/hub/auth/__init__.py:118). The credential is not an opaque session id: in local mode it is a self-contained HMAC-signed payload, and in WorkOS mode it is a sealed cookie whose access token the WorkOS SDK validates locally. That makes this the verifiable-token pattern, so the role is missing under the session-credential rule." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "get_current_user (automagik_tools/hub/auth/__init__.py:118) calls verify_local_session (automagik_tools/hub/setup/local_auth.py:184). That function checks an HMAC-SHA256 signature and the exp field of the self-contained token, and never looks up an open session. WorkOS mode uses load_sealed_session().authenticate() at auth/__init__.py:171-176 (stateless JWT check). Neither resolves an opaque id against stored state, so the role is missing." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Nothing keeps server-side open sessions for incoming hub requests; the local_session and wos_session cookies are self-contained. OAuth21SessionStore (automagik_tools/hub/auth/google/oauth21_session_store.py:180) stores Google credentials for the repo's own outgoing Google API calls, so it is a lookalike and was not used." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "list_all_workspaces_api", | |
| "file": "automagik_tools/hub/api_routes.py", | |
| "lines": "462", | |
| "notes": "This is the GET /admin/workspaces handler (router mounted under /api in hub_http.py:430/450). It receives user_id from the get_current_user_id dependency (api_routes.py:465), loads the user's email and is_super_admin flag, and raises 403 at line 486 unless the user is a super admin." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "is_super_admin", | |
| "file": "automagik_tools/hub/authorization.py", | |
| "lines": "56", | |
| "notes": "Called by list_all_workspaces_api at api_routes.py:485 (`db_is_super_admin or is_super_admin(email)`). It checks whether the email is in the configured super-admin list. Caveat: is_super_admin is async but is not awaited there, so the coroutine is always truthy and the check effectively passes for any user found in the database." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "present", | |
| "symbol": "get_super_admin_emails", | |
| "file": "automagik_tools/hub/authorization.py", | |
| "lines": "34", | |
| "notes": "Called by is_super_admin (authorization.py:74). It reads the super-admin email list from ConfigStore key super_admin_emails (config_store.py:29) in the database. The User.is_super_admin column (models.py:95), queried inline in the handler at api_routes.py:477, also contributes to the policy." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "list_all_workspaces", | |
| "file": "automagik_tools/hub/workspaces.py", | |
| "lines": "239", | |
| "notes": "Called by list_all_workspaces_api at api_routes.py:488 after the super-admin check passes. It returns all workspaces." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.91 kB
- Xet hash:
- c2a48baa71c9abc24c6c425c89980910c70d087c36dcea256213ed733ec6c992
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.