Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /beanone_apikey.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client (UI/SDK/CLI) sends the Bearer JWT; the repo is a FastAPI service plus tests only, and tokens are issued by an external login service (LOGIN_URL, src/apikey/dependencies.py:37). Caller is outside the repo." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/apikey/dependencies.py", | |
| "lines": "153", | |
| "notes": "FastAPI dependency injected via Depends(get_current_user) on every route in api_key_router (e.g. src/apikey/router.py:58), router mounted at src/apikey/service.py:57. It extracts the Bearer credential (HTTPBearer, dependencies.py:65), calls validate_jwt at dependencies.py:170, and raises 401 when no credential is given; an API-key branch (validate_api_key, dependencies.py:165) is an alternative opaque-token path not used here." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "validate_jwt", | |
| "file": "src/apikey/dependencies.py", | |
| "lines": "70", | |
| "notes": "Reached from get_current_user at src/apikey/dependencies.py:170. Calls jose jwt.decode with JWT_SECRET, algorithm and audience check (line 74), requires 'sub' and 'exp' claims, returns a User principal or raises 401 on JWTError." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "JWT_SECRET", | |
| "file": "src/apikey/dependencies.py", | |
| "lines": "55", | |
| "notes": "validate_jwt passes JWT_SECRET to jwt.decode at src/apikey/dependencies.py:76. Module constant loaded once from Settings.jwt_secret (env JWT_SECRET, default 'changeme', dependencies.py:38) via get_settings(); no dedicated key-retrieval method on the verification path, so the constant is cited." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "src/apikey/dependencies.py", | |
| "lines": "74", | |
| "notes": "validate_jwt calls jwt.decode from python-jose (import at src/apikey/dependencies.py:13), which verifies the HS256 HMAC signature, expiry and audience. Token generation happens in an external login service, not in this repo." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "create_api_key", | |
| "file": "src/apikey/router.py", | |
| "lines": "56", | |
| "notes": "Route handler POST /api/v1/api-keys/ that receives the User principal from Depends(get_current_user) (router.py:58) and creates an API key via manager.create_api_key. Other protected handlers on the same enforcer: list_api_keys (router.py:74), delete_api_key (router.py:85), test_auth (router.py:100)." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.77 kB
- Xet hash:
- 19aef21ef898484817f215d9def8326a5d4e507e010d82b14853952b81e2be23
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.