Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /fastapi-keycloak_fastapi-keycloak.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends the bearer token to the Enforcer; callers are outside the repo. add_swagger_config (fastapi_keycloak/api.py:159) only configures the framework-provided Swagger UI OAuth settings, and tests do not count." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "current_user", | |
| "file": "fastapi_keycloak/api.py", | |
| "lines": "203", | |
| "notes": "Inner dependency function returned by get_current_user (api.py:184); it receives the Authorization bearer token via Depends(self.user_auth_scheme) (OAuth2PasswordBearer, api.py:182) and calls _decode_token at api.py:220, raising HTTP 401 on jwt.PyJWTError (and 403 on missing roles). Wired into routes via Depends(idp.get_current_user()) e.g. docs/examples/quickstart/app.py:25." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "_decode_token", | |
| "file": "fastapi_keycloak/api.py", | |
| "lines": "314", | |
| "notes": "Reached from current_user at api.py:220. Builds verification options (verify_signature, verify_exp, verify_aud when audience given) and calls jwt.decode with the Keycloak public key and RS256 default, returning the claims or raising PyJWTError; current_user then parses them into OIDCUser. token_is_valid (api.py:298) is an alternative caller of the same helper." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "public_key", | |
| "file": "fastapi_keycloak/api.py", | |
| "lines": "254", | |
| "notes": "Accessed as key=self.public_key in _decode_token at api.py:340. Cached property that fetches the realm's public key from the Keycloak realm endpoint via requests.get and wraps it into a PEM string; the key itself is owned by the external Keycloak IdP." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "fastapi_keycloak/api.py", | |
| "lines": "339", | |
| "notes": "Called by _decode_token (api.py:314) at api.py:339; PyJWT's jwt.decode (imported api.py:10) verifies the RS256 signature with the public key and checks exp/aud claims." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "current_users", | |
| "file": "docs/examples/quickstart/app.py", | |
| "lines": "25", | |
| "notes": "The repo is a library with no business handlers of its own; per rule 6.1.7 the in-repo quickstart example app is wired to the same Enforcer via Depends(idp.get_current_user()) at app.py:25 and returns the authenticated OIDCUser principal. company_admin (app.py:30) is the role-protected variant." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.75 kB
- Xet hash:
- 1c01bb3d3e5a43f83fdcac7d61fbe51cd93a1c7d711223dcc4cf27422015bb40
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.