Buckets:

download
raw
4.36 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo production client sends the bearer/cookie to /users/sessions/me; svc-infra is a library and callers are outside the repo (only comments in examples/ mention the endpoint). Tests not counted."
},
{
"role": "Authentication enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The credential on the traced path is a self-contained JWT, not an opaque session id: Identity (src/svc_infra/api/fastapi/auth/security.py:174) -> _current_principal (security.py:151) -> resolve_bearer_or_cookie_principal (security.py:85), which verifies the token via fastapi-users JWTStrategy.read_token (security.py:114; strategy built in src/svc_infra/api/fastapi/db/sql/users.py:88). Per the verifiable-token rule the session-side enforcer is missing; the Starlette SessionMiddleware (auth/add.py:285) is a signed cookie used only for OAuth state."
},
{
"role": "Verifier",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Token verification is JWT signature/expiry validation (JWTStrategy/RotatingJWTStrategy.read_token, security.py:114, security/jwt_rotation.py:38), not a lookup of a session id. resolve_bearer_or_cookie_principal (security.py:130) additionally checks that the user has any non-revoked AuthSession row, but this is a per-user revocation check, not resolution of the presented token to a session, so it is not counted."
},
{
"role": "Session manager",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The AuthSession/RefreshToken tables (src/svc_infra/security/models.py, managed by issue_session_and_refresh in src/svc_infra/security/session.py:109) track refresh-token sessions only; the access JWT presented on requests is not resolved against them (only a per-user 'any active session' query at security.py:130). Refresh-token lookup in rotate_refresh_session (auth/session_tokens.py:72) only mints new JWTs, off the request path."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "_guard",
"file": "src/svc_infra/security/permissions.py",
"lines": "74",
"notes": "Inner dependency of RequirePermission (permissions.py:71), attached to GET /sessions/me via dependencies=[RequirePermission(\"security.session.list\")] (src/svc_infra/api/fastapi/auth/routers/session_router.py:20); it takes the authenticated Principal (Identity) and raises 403 missing_permissions when a permission is absent. The decision is inline, so it is also cited as Decider."
},
{
"role": "Decider",
"status": "present",
"symbol": "_guard",
"file": "src/svc_infra/security/permissions.py",
"lines": "74",
"notes": "Same method as the Authorisation enforcer: _guard in RequirePermission computes perms = principal_permissions(principal) (permissions.py:75) and decides inline whether all needed permissions are present (line 76-78). has_permission (permissions.py:67) is an equivalent helper not used on this path."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "get_permissions_for_roles",
"file": "src/svc_infra/security/permissions.py",
"lines": "52",
"notes": "Reached from Decider _guard via principal_permissions (permissions.py:60, which adds the implicit 'user' role and calls get_permissions_for_roles at line 64). It returns the union of permissions from the in-memory role->permission PERMISSION_REGISTRY (permissions.py:16), extensible via register_role/extend_role."
},
{
"role": "System",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Library repo (rule 7): the only handler behind the RequirePermission _guard is svc-infra's own session-management helper route list_my_sessions (src/svc_infra/api/fastapi/auth/routers/session_router.py:22, GET /sessions/me, mounted at auth/add.py:81), which is not a business System, so System is missing for consistency with the batch convention. revoke_session/delete_session (lines 71, 95) are similar helper routes."
}
]
}

Xet Storage Details

Size:
4.36 kB
·
Xet hash:
4220b63cb132dc947b97d52e21bc105fadb63731b791cbc92c9d2a136525456c

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