Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /nijaru_zenith.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Zenith is a web framework library; callers are outside the repo. No in-repo client sends a session id or token to the framework's enforcer (examples/task-api is a separate FastAPI app; tests excluded)." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The framework's only authentication enforcer is the stateless JWT middleware __call__ in AuthenticationMiddleware (zenith/middleware/auth.py:39, registered by configure_auth at zenith/auth/config.py:72), not a session check. SessionMiddleware.__call__ (zenith/sessions/middleware.py:50) only loads/auto-creates a session and never rejects requests or resolves a principal, so it is not a session-based authentication enforcer." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Token verification is JWT signature verification in verify_token/extract_user_from_token (zenith/auth/jwt.py:147/206, PyJWT decode), i.e. the verifiable-token pattern, not an opaque session lookup. No code resolves a principal from a session id." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "An off-path session subsystem exists (SessionManager.get_session at zenith/sessions/manager.py:223 with Redis/cookie stores), but no authentication flow uses it to look up a principal; it is a generic session data store, so not mapped." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "_resolve_auth", | |
| "file": "zenith/core/routing/dependency_resolver.py", | |
| "lines": "71", | |
| "notes": "Reached for every handler parameter declared with Auth(scopes=...) (AuthDependency dispatch at zenith/core/routing/dependency_resolver.py:41-42); it gets the principal via get_current_user and calls require_scopes at line 81, raising before the handler runs. Principal is the JWT-derived user set by AuthenticationMiddleware." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "require_scopes", | |
| "file": "zenith/middleware/auth.py", | |
| "lines": "144", | |
| "notes": "Called from _resolve_auth (zenith/core/routing/dependency_resolver.py:81); compares the route's required scopes against current_user['scopes'] and raises AuthorizationException if any are missing. A role-hierarchy variant require_role (zenith/middleware/auth.py:173) and dependency factories in zenith/auth/dependencies.py exist but are not on this path." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "present", | |
| "symbol": "extract_user_from_token", | |
| "file": "zenith/auth/jwt.py", | |
| "lines": "206", | |
| "notes": "The principal's privileges read by require_scopes (zenith/middleware/auth.py:159) are the 'scopes' (and 'role') that extract_user_from_token puts into the principal dict from the verified token claims, invoked by AuthenticationMiddleware.__call__ at zenith/middleware/auth.py:72. Caveat: privileges are carried in token claims, not a separate policy store; the required scopes per route live in AuthDependency (zenith/core/routing/dependencies.py:23)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Library repo: no in-repo Zenith route handler declares Auth(scopes=...) behind this enforcer (only docstring examples, e.g. zenith/auth/config.py:45); examples/task-api uses FastAPI's own HTTPBearer instead." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.78 kB
- Xet hash:
- 0339e353700f13d406a5f7c7c955943a5c6178477d4b3d5c6d7a176bb64e012b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.