Buckets:

download
raw
3.67 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client sends the access_token: cli.py only wraps Makefile commands and src/system_tests is test code. The caller is outside the repo."
},
{
"role": "Authentication enforcer",
"status": "present",
"symbol": "dispatch",
"file": "src/api/middlewares/session.py",
"lines": "15",
"notes": "dispatch in UserSessionMiddleware (registered at src/api/app.py:43) reads access_token from the JSON body and calls the Verifier at src/api/middlewares/session.py:28; it returns 401 on an invalid token and sets request.state.session_user. A missing token is rejected later by validate_user_credentials (src/api/tools/validator.py:68) on user routes."
},
{
"role": "Verifier",
"status": "present",
"symbol": "get_user_by_access_token",
"file": "src/api/models/tools.py",
"lines": "89",
"notes": "Called from dispatch at src/api/middlewares/session.py:28. Hashes the opaque token (hash_access_token, SHA-512, src/api/tools/token.py:4) and queries User for a matching unexpired access_token (or take-over token), raising 401 if none, else returning the UserSchema principal."
},
{
"role": "Session manager",
"status": "present",
"symbol": "access_token",
"file": "src/api/models/user.py",
"lines": "12",
"notes": "The User table's access_token column (with access_token_expiration, line 13) stores the hashed opaque tokens; it is queried inline by get_user_by_access_token at src/api/models/tools.py:96-102. No dedicated store method exists, so the column is cited; tokens are long-lived per-user tokens set by create_user (src/api/models/tools.py:125), not per-login sessions."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "validate_admin",
"file": "src/api/tools/validator.py",
"lines": "32",
"notes": "FastAPI dependency installed on the /api/admin router at src/api/routers/router.py:152; runs after the middleware has set request.state.session_user and raises 403 when the principal is not admin. Same function also serves as Decider (inline check); it falls back to a static MASTER-KEY header when no session user is present."
},
{
"role": "Decider",
"status": "present",
"symbol": "validate_admin",
"file": "src/api/tools/validator.py",
"lines": "32",
"notes": "Decision is inline in the Authorisation enforcer validate_admin: line 46 checks session_user.is_admin and returns or raises 403. Alternative per-object ownership checks (app_name in session_user.apps) exist inline in AppService methods, e.g. delete_app at src/api/services/apps.py:339."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "is_admin",
"file": "src/api/models/user.py",
"lines": "19",
"notes": "The User.is_admin column holds the privilege read by validate_admin (src/api/tools/validator.py:46); it is loaded into the principal by get_user_schema (src/api/models/tools.py:41) during verification. No retrieving method of its own, so the column is cited."
},
{
"role": "System",
"status": "present",
"symbol": "get_all_users",
"file": "src/api/routers/admin/users.py",
"lines": "38",
"notes": "Admin handler POST /api/admin/users/list/, reached only after validate_admin (src/api/routers/router.py:152) passes; it lists users via get_users. Representative of all /api/admin handlers."
}
]
}

Xet Storage Details

Size:
3.67 kB
·
Xet hash:
fd699324cdd8544603f5c523152061cc1657eedc8890cc659d3a975afde698e2

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