Buckets:

download
raw
2.8 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client sends the Bearer token: the repo contains only the Python backend (labelu/) and model_server, no frontend JS/TS or SDK; tests are excluded. The caller is outside the repo."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "get_current_user",
"file": "labelu/internal/dependencies/user.py",
"lines": "36",
"notes": "FastAPI dependency installed on protected routes via Depends(get_current_user) (e.g. labelu/internal/adapter/routers/task.py:35); it takes the token from SpecialOAuth2PasswordBearer.__call__ (user.py:22, 401 if no Authorization header) and raises LabelUException 401 on invalid token or unknown user. The verification logic is inline, so it is also the Verifier."
},
{
"role": "Verifier",
"status": "present",
"symbol": "get_current_user",
"file": "labelu/internal/dependencies/user.py",
"lines": "36",
"notes": "Same method as the Enforcer (decision inline, no smaller helper): calls jwt.decode with verify_exp at user.py:42, parses claims into AccessToken (user.py:48), resolves the user via crud_user.get (user.py:54) and returns the principal. should_refresh_token (security.py:55) only handles sliding re-issue."
},
{
"role": "Key manager",
"status": "present",
"symbol": "PASSWORD_SECRET_KEY",
"file": "labelu/internal/common/config.py",
"lines": "64",
"notes": "Verifier reads settings.PASSWORD_SECRET_KEY directly at user.py:44 (no retrieving method), so the config field of the pydantic Settings class is cited. If unset, labelu/main.py:104-106 generates a random key with secrets.token_hex(32) at startup; same HMAC key is used for issuing in create_access_token (security.py:48)."
},
{
"role": "Cryptographer",
"status": "external",
"symbol": "decode",
"file": "labelu/internal/dependencies/user.py",
"lines": "42",
"notes": "Reached from the Verifier get_current_user (user.py:42): python-jose jwt.decode (import at user.py:4) verifies the HS256 HMAC signature (algorithms=[settings.TOKEN_GENERATE_ALGORITHM]) and expiry. Generation side uses jose jwt.encode at security.py:46."
},
{
"role": "System",
"status": "present",
"symbol": "create",
"file": "labelu/internal/adapter/routers/task.py",
"lines": "31",
"notes": "Example protected handler: POST /tasks create depends on get_current_user (task.py:35) and receives the resolved User principal, passing it to service.create (task.py:42). All task/sample/attachment/datasource routers are guarded the same way."
}
]
}

Xet Storage Details

Size:
2.8 kB
·
Xet hash:
f96f5bea67ca4538509dcd9a24ff7614caf8b0646ffc6a619a01e8d60f2f8cc8

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