Buckets:

download
raw
3.65 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The caller is an outside browser or API client. ui/streamlit_app.py is a standalone Streamlit app that does not call the FaultRay API with a session cookie or Bearer token, and tests do not count."
},
{
"role": "Authentication enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "get_current_user (src/faultray/api/auth.py:178, reached via _resolve_user auth.py:67) accepts a Starlette SessionMiddleware signed-cookie session (server.py:304, request.session.get('user_id') at auth.py:222), a stateless JWT (decode_jwt oauth.py:71), or a per-user API key hash lookup (auth.py:288). None of these is a session id resolved against a server-side session store, so the session-side roles are missing (plan 6)."
},
{
"role": "Verifier",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "There is no verification of an opaque session id against open sessions. The cookie session is validated only by Starlette's itsdangerous signature (server.py:304), and the JWT by decode_jwt (oauth.py:71). The API-key branch in get_current_user (auth.py:288-298) is a long-lived key lookup, not a session."
},
{
"role": "Session manager",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No server-side session store exists (no Redis, session table or in-memory dict). Session state lives in the signed client cookie, written by the OAuth callback in routes/admin.py:412."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "check",
"file": "src/faultray/api/auth.py",
"lines": "51",
"notes": "The route dependency _require_permission('create_project') (routes/_shared.py:83, _dep calls require_permission(permission) at :91-93) leads to the inner check of require_permission (auth.py:45). check resolves the principal via _resolve_user (auth.py:52) and raises 403 when the role lacks the permission (auth.py:58-62). Because the decision is inline, check is also the Decider."
},
{
"role": "Decider",
"status": "present",
"symbol": "check",
"file": "src/faultray/api/auth.py",
"lines": "51",
"notes": "The decision is made inline in the same check method as the Authorisation enforcer (rule 6.1.2). It maps user.role to a Role, looks up ROLE_PERMISSIONS (auth.py:57) and allows the request when '*' or the permission is present, otherwise it raises 403. No smaller helper does this."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "ROLE_PERMISSIONS",
"file": "src/faultray/api/auth.py",
"lines": "33",
"notes": "Read by check at auth.py:57. It is a hard-coded dict from role (admin/editor/viewer) to permission strings, and no method retrieves it, so the constant is cited. Each user's role is stored in the UserRow.role column (database.py:63)."
},
{
"role": "System",
"status": "present",
"symbol": "create_project",
"file": "src/faultray/api/routes/projects.py",
"lines": "259",
"notes": "POST /api/projects runs only after Depends(_require_permission('create_project')) (projects.py:259) passes the check at auth.py:51; the router is included at server.py:725. It creates a ProjectRow. This is the handler guarded by the authorisation half; the authentication half is not session-based."
}
]
}

Xet Storage Details

Size:
3.65 kB
·
Xet hash:
499e6595f6f13e2747494f6f401745be21c3c9f646b141053ddc3bd031abab1c

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