Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /session_based_access_control /Maxl94_yaai.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends a session id: the SDK (yaai/client.py:133,153) and the Vue frontend send a JWT Bearer access token or X-API-Key, which is not this pattern's opaque session credential. Callers are otherwise outside the repo." | |
| }, | |
| { | |
| "role": "Authentication enforcer", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "User requests are authenticated by stateless JWTs: get_current_identity (yaai/server/auth/dependencies.py:126) / require_auth (dependencies.py:173) call _try_jwt (dependencies.py:66), which only verifies the signature via decode_token (yaai/server/auth/jwt.py:41, PyJWT decode). That is the verifiable-token pattern, not a session. Starlette SessionMiddleware (main.py:186) is a signed client-side cookie used only for OAuth state, and the API-key path (service_auth.py:36) is a static key, so neither counts." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No session-id verification exists; the JWT verifier is _try_jwt / decode_token (yaai/server/auth/dependencies.py:66, yaai/server/auth/jwt.py:41) and checks only the signature and the type claim. Refresh-token jti lookup (services/auth_service.py:147) is only used to issue new tokens, not on action requests." | |
| }, | |
| { | |
| "role": "Session manager", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No server-side session store resolves session ids to principals; the principal is rebuilt from JWT claims in _try_jwt (yaai/server/auth/dependencies.py:72). The RefreshToken table (models/auth.py:94) only tracks refresh-token revocation for the /refresh endpoint." | |
| }, | |
| { | |
| "role": "Authorisation enforcer", | |
| "status": "present", | |
| "symbol": "require_model_write", | |
| "file": "yaai/server/auth/dependencies.py", | |
| "lines": "197", | |
| "notes": "Reached from the authenticated principal: require_model_write depends on require_auth (dependencies.py:199) and is injected as Depends(require_model_write) on update_model (yaai/server/routers/models.py:92); it raises 403 before the handler runs. Auth is on by default (AuthConfig.enabled=True, auth/config.py:99); require_owner (dependencies.py:185) is a sibling role-only guard." | |
| }, | |
| { | |
| "role": "Decider", | |
| "status": "present", | |
| "symbol": "require_model_write", | |
| "file": "yaai/server/auth/dependencies.py", | |
| "lines": "197", | |
| "notes": "The decision is inline in the Authorisation enforcer (same method): owners pass (is_owner property, dependencies.py:58), non-SA viewers are denied, service accounts pass only if a ModelAccess row exists for (model_id, service_account_id) (dependencies.py:219-224). check_model_write_access (dependencies.py:233) duplicates this logic for body-resolved ids." | |
| }, | |
| { | |
| "role": "Policy provider", | |
| "status": "present", | |
| "symbol": "ModelAccess", | |
| "file": "yaai/server/models/auth.py", | |
| "lines": "78", | |
| "notes": "Queried by the Decider require_model_write via select(ModelAccess).where(...) at yaai/server/auth/dependencies.py:219; the model_access table holds the per-model whitelist for service accounts. No method wraps the query, so the ORM model class is cited; for user principals the policy is the role claim (User.role, models/auth.py:29) carried in the JWT." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "update_model", | |
| "file": "yaai/server/routers/models.py", | |
| "lines": "89", | |
| "notes": "Handler PUT /models/{model_id} runs only after require_model_write (models.py:92) allows the request, then calls ModelService.update_model. Kept mapped because the authorisation half of the pattern is present; the authentication guarding it is JWT/API-key, not session based." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 4.06 kB
- Xet hash:
- 29374f4777a78382e17eb5e77afb7f0773eafbf2cca8c77416fd8bfe27489a6f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.