Buckets:

download
raw
3.81 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client (UI/SDK/CLI) sends a session id or token; the repo contains only the FastAPI backend, tests and docs. The caller is outside the repo."
},
{
"role": "Authentication enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No session-based authentication flow exists. redis_session_middleware (src/main.py:36, duplicate in src/app.py:46) loads session:{session_id} from Redis into request.state.session but never rejects a request, and no handler reads it. The guarded /api/v1/admin-dashboard (src/api/v1/endpoints.py:85) authenticates with a stateless JWT via OAuth2PasswordBearer + jwt.decode (endpoints.py:87), which is the verifiable-token pattern; StarletteSessionMiddleware (src/main.py:80) is a signed cookie session and is unused for auth."
},
{
"role": "Verifier",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No function verifies that a session id maps to an authenticated session. auth_via_google (src/api/v1/endpoints.py:120) looks up session:{session_id} in Redis (line 129) only to check OAuth state/nonce (CSRF protection during login), not to authenticate later requests; the JWT check is jwt.decode at endpoints.py:87."
},
{
"role": "Session manager",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Redis (RedisConnection.get_redis, src/redis.py:21) holds session:{id} entries, but they contain only OAuth state/nonce written by login_via_google (src/api/v1/endpoints.py:110), never an authenticated principal, and no enforcer resolves them. Not used as an authenticated-session store, so not mapped."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "admin_dashboard",
"file": "src/api/v1/endpoints.py",
"lines": "85",
"notes": "Reached by GET /api/v1/admin-dashboard (router included at src/main.py:78); after the JWT principal is decoded at line 87, the handler itself calls has_role(payload, \"admin\") at line 94 and raises 403 on failure. A second /admin-dashboard route using Depends(role_required(\"admin\")) (endpoints.py:164, role_checker in src/middleware/role.py:6) is shadowed by this earlier registration. Caveat: the principal comes from a JWT, not a session."
},
{
"role": "Decider",
"status": "present",
"symbol": "has_role",
"file": "src/auth/auth.py",
"lines": "25",
"notes": "Called by the Authorisation enforcer admin_dashboard at src/api/v1/endpoints.py:94; returns whether the required role is in the principal's \"roles\" list."
},
{
"role": "Policy provider",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "has_role (src/auth/auth.py:26) reads privileges only from the JWT payload's \"roles\" claim; no in-repo store supplies them on this path. fake_users_db roles (src/api/v1/endpoints.py:55/62) and the Role model are never put into the token (create_access_token called with only sub at endpoints.py:79), and the required role \"admin\" is hard-coded at line 94."
},
{
"role": "System",
"status": "present",
"symbol": "admin_dashboard",
"file": "src/api/v1/endpoints.py",
"lines": "85",
"notes": "The protected action is the success branch of admin_dashboard (return of admin data at src/api/v1/endpoints.py:97), executed only after the Authorisation enforcer's has_role check at line 94 passes; same function as the enforcer since the check is inline."
}
]
}

Xet Storage Details

Size:
3.81 kB
·
Xet hash:
091b40c81ea931ec81237404922e1e3fc6b44aa565e9557729bd3f5b294b795b

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