Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /verifiable_token_based_authentication /SINTEF-9012_SINDIT20.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "present", | |
| "symbol": "create_s3_object_node", | |
| "file": "upload_to_s3.py", | |
| "lines": "73", | |
| "notes": "In-repo CLI client S3Uploader: __init__/_authenticate (upload_to_s3.py:55,70) put 'Authorization: Bearer <token>' on the requests session, and create_s3_object_node POSTs to /kg/s3_object (upload_to_s3.py:119), which is guarded by the traced Enforcer. test_s3_upload_from_api.py ignored as a test." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "get_current_user", | |
| "file": "src/sindit/api/authentication_endpoints.py", | |
| "lines": "21", | |
| "notes": "FastAPI dependency: extracts the bearer token via OAuth2PasswordBearer (oauth2_scheme, line 18) and forwards it to authService.verify_token (line 22); a raised HTTPException 401 blocks the request. Wired into routes through get_current_active_user (line 25), e.g. Depends(get_current_active_user) at src/sindit/api/kg_endpoints.py:405." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "verify_token", | |
| "file": "src/sindit/authentication/in_memory.py", | |
| "lines": "118", | |
| "notes": "Reached from get_current_user (authentication_endpoints.py:22) via authService, which is InMemoryAuthService by default (USE_KEYCLOAK defaults False, src/sindit/initialize_authentication.py:9-17). Decodes/verifies the HS256 JWT (exp checked by PyJWT), extracts 'sub', looks up the user and returns it or raises 401. Alternative KeycloakAuthService.verify_token (keycloak.py:36) uses userinfo introspection and is only active when USE_KEYCLOAK=true." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "__init__", | |
| "file": "src/sindit/authentication/in_memory.py", | |
| "lines": "19", | |
| "notes": "InMemoryAuthService.__init__ derives self.SECRET_KEY from env SECRET_KEY or generates a random 32-byte key and stores it in the vault (secret_vault.storeSecret, line 31); verify_token uses self.SECRET_KEY directly at in_memory.py:125. No separate getter method exists, so the init that derives the key is cited." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "decode", | |
| "file": "src/sindit/authentication/in_memory.py", | |
| "lines": "125", | |
| "notes": "Called by verify_token (in_memory.py:118): PyJWT jwt.decode(token, SECRET_KEY, algorithms=['HS256']) verifies the HMAC-SHA256 signature and expiry (import jwt at line 10). Token generation uses jwt.encode at in_memory.py:101 (issuing sub-flow)." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "create_s3_object", | |
| "file": "src/sindit/api/kg_endpoints.py", | |
| "lines": "403", | |
| "notes": "Protected route POST /kg/s3_object, reached after Depends(get_current_active_user) -> get_current_user (kg_endpoints.py:405) succeeds; it is the endpoint the in-repo Subject create_s3_object_node calls. Many other /kg/* routes use the same dependency." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.06 kB
- Xet hash:
- 55e38d0e92de3c45003edff5e898839dad2d91c927ec4b604851cd320aa1dba6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.