Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /sustainability-software-lab_ca-biositing.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client (UI/SDK/CLI) sends the Bearer JWT or access_token cookie to the webservice; searched for Authorization/access_token/X-API-Key across .py/.js/.ts outside tests. Caller is outside the repo." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/ca_biositing/webservice/ca_biositing/webservice/dependencies.py", | |
| "lines": "95", | |
| "notes": "FastAPI dependency installed on all /v1/feedstocks routes via router.include_router(feedstocks_router, dependencies=[Depends(get_current_user)]) at src/ca_biositing/webservice/ca_biositing/webservice/v1/router.py:32. It reads the Bearer token (OAuth2PasswordBearer, dependencies.py:42) or access_token cookie and calls helper _resolve_jwt_user (dependencies.py:45), which calls the Verifier at dependencies.py:59 and raises 401 on failure; falls back to an X-API-Key path otherwise." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "decode_access_token", | |
| "file": "src/ca_biositing/webservice/ca_biositing/webservice/services/auth_service.py", | |
| "lines": "83", | |
| "notes": "Reached from Enforcer helper _resolve_jwt_user at dependencies.py:59 with config.jwt_secret_key and config.jwt_algorithm. Calls jwt.decode (signature + exp check), returns the sub claim as principal or None on InvalidTokenError; _resolve_jwt_user then loads the ApiUser and rejects disabled users." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "jwt_secret_key", | |
| "file": "src/ca_biositing/webservice/ca_biositing/webservice/config.py", | |
| "lines": "55", | |
| "notes": "Pydantic settings field (env API_JWT_SECRET_KEY, injected from GCP Secret Manager in deployment) passed by _resolve_jwt_user at dependencies.py:59 into decode_access_token; no retrieving method exists, so the config field is cited. Insecure dev default is warned about in main.py:24." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "src/ca_biositing/webservice/ca_biositing/webservice/services/auth_service.py", | |
| "lines": "93", | |
| "notes": "PyJWT jwt.decode (import at auth_service.py:14) called from the Verifier decode_access_token; verifies the HS256 HMAC signature and expiry with the shared secret. Token issuing uses jwt.encode at auth_service.py:80." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "get_analysis_data_by_resource", | |
| "file": "src/ca_biositing/webservice/ca_biositing/webservice/v1/feedstocks/analysis.py", | |
| "lines": "69", | |
| "notes": "One of the feedstocks data handlers (analysis router included in feedstocks router at v1/feedstocks/__init__.py:17) guarded by the Enforcer dependency at v1/router.py:32; runs only after get_current_user returns the principal. Other guarded handlers (usda, availability) are equivalent." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.1 kB
- Xet hash:
- 2ed569276b9b19ac479f0a755c36648b1596d7e8652c2c62b19e628666d7c38a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.