Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /roksprogar_fastapi-otp-auth.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The repo is a FastAPI auth library with no in-repo client (UI/SDK/CLI) that sends the bearer token to get_current_user; callers are outside the repo. Only tests/test_auth_router.py calls it, and tests do not count." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/fastapi_otp_auth/dependencies.py", | |
| "lines": "12", | |
| "notes": "FastAPI dependency exported as the library's public guard (src/fastapi_otp_auth/__init__.py:2). It reads the Bearer token via OAuth2PasswordBearer (dependencies.py:9), calls verify_token at dependencies.py:16, and raises 401 if the token is invalid, has no sub, or its jti is blacklisted (dependencies.py:32). Otherwise it returns the email principal. Consumers wire it with Depends(get_current_user)." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "verify_token", | |
| "file": "src/fastapi_otp_auth/utils.py", | |
| "lines": "42", | |
| "notes": "Reached from get_current_user at dependencies.py:16. It decodes and verifies the JWT with PyJWT (utils.py:44), which also checks exp, then checks that the type claim is 'access' and returns the payload or None. get_current_user adds the extra sub and Redis blacklist checks." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "jwt_secret", | |
| "file": "src/fastapi_otp_auth/config.py", | |
| "lines": "28", | |
| "notes": "verify_token passes settings.jwt_secret directly to jwt.decode (utils.py:44). No method retrieves the key, so the entity is the field of the pydantic-settings Settings class. It is loaded from env FASTAPI_OTP_AUTH_JWT_SECRET, with an insecure default 'change-me-in-production', and the algorithm is HS256 (config.py:29)." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "src/fastapi_otp_auth/utils.py", | |
| "lines": "44", | |
| "notes": "verify_token calls PyJWT jwt.decode (import at utils.py:5) with algorithms=[HS256], which verifies the HMAC signature and exp. The same library's jwt.encode signs tokens at issuance (utils.py:20/36)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "This is a library repo (rule 7). get_current_user guards no in-repo route, and its only protected handler is protected_route in tests/test_auth_router.py:15, which is a test. The /refresh handler (auth_router.py:188) verifies a refresh JWT inline but does not use this Enforcer." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.74 kB
- Xet hash:
- 0cd8c33c2b0efcb6cdd1c96a195d73496bd4b4c5e499f12e9f20dfec50d5022a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.