Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /tristeng_tasos-apiauth.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends the bearer token; the only callers are tests (tests/apiauth/...), which do not count. sample.py only builds the FastAPI app. The caller is outside the repo." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "tasos/apiauth/auth.py", | |
| "lines": "87", | |
| "notes": "FastAPI dependency that pulls the bearer token via OAuth2PasswordBearer (auth.py:20) and raises HTTP 401 on any failure; wired through get_current_active_user (auth.py:118) into Depends(...) of /auth/whoami (api/base.py:107) and admin routes via get_current_admin_user (api/user.py:102). Decision logic is inline, so the same method is also the Verifier." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "tasos/apiauth/auth.py", | |
| "lines": "87", | |
| "notes": "Same method as the Enforcer (decision inline): calls jwt.decode at auth.py:102 (signature + exp check), extracts 'sub', resolves the user via get_user_by_email (auth.py:111) and returns the principal or raises 401." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "get_apiauth_settings", | |
| "file": "tasos/apiauth/config.py", | |
| "lines": "34", | |
| "notes": "Called by the Verifier get_current_user at auth.py:101; returns cached ApiAuthSettings whose secret_key (config.py:23) and algorithm are loaded by pydantic-settings from APIAUTH_* env vars / .env. Shared HMAC secret (e.g. HS256)." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "tasos/apiauth/auth.py", | |
| "lines": "102", | |
| "notes": "Verifier get_current_user calls PyJWT jwt.decode(token, secret_key, algorithms=[algorithm]) at auth.py:102, which verifies the MAC/signature and expiry. Token generation uses jwt.encode in create_access_token (auth.py:55)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "current_user_info", | |
| "file": "tasos/apiauth/api/base.py", | |
| "lines": "107", | |
| "notes": "GET {auth_path}/whoami handler registered by add_base_endpoints_to_app (wired in sample.py:16 via add_all_endpoints_to_app); runs only after Depends(get_current_active_user) -> get_current_user passes and returns the principal. Other protected handlers: change_password (api/base.py:119), admin user endpoints in api/user.py." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.6 kB
- Xet hash:
- 9b2ec21fdb0191061f9e3184c928b81178323513cb449a9bd2938f93daf52cda
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.