Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /olaflaitinen_Promethium.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client (UI/SDK/CLI) sends the Bearer token to the API; grep for Authorization/Bearer/access_token outside src/promethium/api and tests found nothing. Caller is outside the repo." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/promethium/api/deps/auth.py", | |
| "lines": "20", | |
| "notes": "FastAPI dependency that pulls the Bearer token via OAuth2PasswordBearer (deps/auth.py:17) and raises HTTP 401 on any failure; chained through get_current_active_user (deps/auth.py:53) which routers inject, e.g. routers/auth.py:57 and routers/datasets.py:26. Verification is inline, so the same method is also the Verifier." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/promethium/api/deps/auth.py", | |
| "lines": "20", | |
| "notes": "Same method as the Enforcer (no separate helper): it fetches the key/algorithm (deps/auth.py:35-36), calls jose jwt.decode (deps/auth.py:38) which checks signature and exp, extracts 'sub', and loads the User via db.get (deps/auth.py:46), returning the principal or raising 401." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "SECRET_KEY", | |
| "file": "src/promethium/core/config.py", | |
| "lines": "47", | |
| "notes": "Reached from the Verifier get_current_user, which reads settings.SECRET_KEY inline via getattr at deps/auth.py:35 (no retrieving method exists, so the config field is cited). Pydantic Settings field overridable from env/.env; default is a hard-coded dev secret, with a fallback default also in deps/auth.py:35." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "src/promethium/api/deps/auth.py", | |
| "lines": "38", | |
| "notes": "Called by the Verifier get_current_user: python-jose jwt.decode(token, secret_key, algorithms=[HS256]) verifies the HMAC-SHA256 signature and expiry (imported at deps/auth.py:7). Token generation uses jose jwt.encode in AuthService.create_access_token (services/auth_service.py:53)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "read_users_me", | |
| "file": "src/promethium/api/routers/auth.py", | |
| "lines": "56", | |
| "notes": "GET /api/v1/auth/me handler, runs only after Depends(get_current_active_user) -> get_current_user (routers/auth.py:57) succeeds, and returns the authenticated principal. Many other handlers (datasets, jobs, ml, pipelines, experiments, results, benchmarks, users) are guarded by the same dependency." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.78 kB
- Xet hash:
- 196dc82d402f9cbf335eb8dfc69740b552d3ab1dfbdb68a44d78b2e301c02b06
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.