Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /layinded_swx.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends a session id; callers of the FastAPI API are external (only tests and docs). The only credential sent is a JWT bearer token, not a session id." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Authentication is a stateless JWT flow: get_current_user (swx_core/auth/user/dependencies.py:35) takes an OAuth2PasswordBearer token and verifies it via decode_token (swx_core/auth/core/jwt.py:71, PyJWT jwt.decode at line 93); no session id is resolved against server-side state. Starlette SessionMiddleware (swx_core/middleware/session_middleware.py:31, registered in swx_core/utils/loader.py:163) is a signed client-side cookie used only for OAuth state (swx_core/routes/access/oauth_route.py:105), so it does not count." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No verifier resolves an opaque session id; the token is verified by signature in decode_token (swx_core/auth/core/jwt.py:71) using PyJWT jwt.decode (line 93), which is the verifiable-token pattern. The token blacklist (swx_core/security/token_blacklist.py) is not consulted by get_current_user." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No server-side session store on the request path; the signed Starlette cookie session (swx_core/middleware/session_middleware.py:31) is client-side, and refresh tokens (swx_core/security/refresh_token_service.py) only serve token renewal, not request authentication." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "policy_checker", | |
| "file": "swx_core/services/policy/dependencies.py", | |
| "lines": "139", | |
| "notes": "Reached from read_user_by_id (swx_core/routes/user/user_route.py:81-82, Depends(require_policy(action=\"user:read\", ...))) after the JWT user dependency (UserDep). policy_checker (inner function of require_policy) builds the Actor from the principal, calls PolicyEngine.evaluate at line 187 and raises HTTP 403 on DENY (line 233). Caveat: require_policy returns Depends(policy_checker) and the route wraps it in another Depends." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "evaluate", | |
| "file": "swx_core/services/policy/policy_engine.py", | |
| "lines": "67", | |
| "notes": "Called by policy_checker at swx_core/services/policy/dependencies.py:187. PolicyEngine.evaluate fetches applicable policies, matches action patterns and conditions against the actor/resource/context, and returns ALLOW/DENY (deny-overrides, fail closed). Actor roles/permissions are gathered by build_actor_from_user (dependencies.py:28) via rbac helpers." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "present", | |
| "symbol": "_find_policies", | |
| "file": "swx_core/services/policy/policy_engine.py", | |
| "lines": "174", | |
| "notes": "Called by evaluate at swx_core/services/policy/policy_engine.py:87. Loads enabled Policy rows from the DB (select at line 185) and system policies from PolicyRegistry.list_all (swx_core/services/policy/policy_registry.py:74). Role/permission privileges come from get_user_permissions (swx_core/rbac/helpers.py:56) via build_actor_from_user." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "read_user_by_id", | |
| "file": "swx_core/routes/user/user_route.py", | |
| "lines": "76", | |
| "notes": "The handler guarded by the policy_checker authorisation enforcer (Depends at swx_core/routes/user/user_route.py:81); it calls get_user_by_id_service after the policy passes. Only the authorisation half of the pattern is present; authentication on this route is JWT-based." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 4.05 kB
- Xet hash:
- ec1d9bd0d5f108195870e01d7902396a436b72343744da12a381c2422c313679
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.