Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /pfun-health_pfun-cma-model.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The caller is a browser outside the repo that carries the 'token' cookie / Starlette session cookie set by login_callback (pfun_cma_model/routes/sso.py:88). No in-repo UI, SDK or CLI sends the credential to the admin enforcer." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The only incoming-request authentication is stateless JWT, not an opaque session id. AdminAuth.authenticate (pfun_cma_model/admin/auth.py:37, registered via Admin(authentication_backend=...) at pfun_cma_model/api.py:252) reads a JWT from the cookie or the signed-cookie Starlette session and validates it by signature with jwt.decode (auth.py:58). get_current_user (routes/auth.py:134) and get_logged_user (admin/core.py:124) are also JWT-only, so per rule 6 this is the verifiable-token pattern." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No server-side lookup resolves an opaque session id. The token check is JWT signature verification: PyJWT decode in AdminAuth.authenticate (pfun_cma_model/admin/auth.py:58) and python-jose decode in verify_token (pfun_cma_model/routes/auth.py:84). The later DB query by email (auth.py:122) resolves a user, not a session." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "There is no store of open sessions. SessionMiddleware (pfun_cma_model/api.py:238) is Starlette's client-side signed cookie and holds only the JWT. The Redis client in api.py:83 is not used for sessions, and routes/auth.py:248 logout says there is no server-side token store or blacklist." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "is_accessible", | |
| "file": "pfun_cma_model/admin/views.py", | |
| "lines": "102", | |
| "notes": "Reached after AdminAuth.authenticate (admin/auth.py:37) admits a request to /admin. sqladmin calls the is_accessible hook of UserAdmin (registered at api.py:263) before every model action and denies access when it returns False. Caveat: the check only re-validates the session JWT (jose jwt.decode, views.py:110) and does not use any role or privilege." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "is_accessible", | |
| "file": "pfun_cma_model/admin/views.py", | |
| "lines": "102", | |
| "notes": "The decision is made inline in the Authorisation enforcer, so both roles cite the same method in UserAdmin. It returns True for any request with a validly signed, unexpired token in request.session. The policy is effectively 'any authenticated user'; User.is_admin is never checked." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "is_accessible (admin/views.py:102) fetches no privileges. User.is_admin exists in admin/models.py and is used only by get_category (views.py:98) for password-hash categories, not for access decisions. No role or permission store was found." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "on_model_change", | |
| "file": "pfun_cma_model/admin/views.py", | |
| "lines": "127", | |
| "notes": "This is the in-repo UserAdmin hook that sqladmin's create/edit actions run only after is_accessible (views.py:102) allows the request. It hashes the password and persists User records. The rest of the CRUD handling is provided by the sqladmin ModelView framework." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.8 kB
- Xet hash:
- 1e6b67ea5123c91a2973fedc9bc19f63ef1c037f23878a6164d0f5414c354652
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.