Buckets:

download
raw
3.09 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client (UI/SDK/CLI) sending a Bearer token to the Mothership API was found; grep for 'Bearer'/Authorization in .py/.ts/.tsx outside tests only hits outbound clients to third-party LLM services and debug scripts. The caller is outside the repo."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "verify_authentication",
"file": "src/application/mothership/dependencies.py",
"lines": "219",
"notes": "FastAPI dependency (wrapped as Auth/RequiredAuth at dependencies.py:282/353 and used by routers such as cockpit.py:241) that takes the Bearer token from get_bearer_token and calls verify_jwt_token at dependencies.py:254, raising HTTP 401 on failure and denying by default when no credentials are given."
},
{
"role": "Verifier",
"status": "present",
"symbol": "verify_token",
"file": "src/application/mothership/security/jwt.py",
"lines": "370",
"notes": "Reached from Enforcer via verify_jwt_token (security/auth.py:225, call at auth.py:249). JWTManager.verify_token decodes/verifies the token via _decode_jwt (jwt.py:390), checks token type, issuer and audience and returns a TokenPayload principal; verify_jwt_token then adds a revocation check and builds the auth context."
},
{
"role": "Key manager",
"status": "present",
"symbol": "__init__",
"file": "src/application/mothership/security/jwt.py",
"lines": "146",
"notes": "verify_jwt_token calls get_jwt_manager(secret_key=settings.security.secret_key, ...) at security/auth.py:241, which builds JWTManager; JWTManager.__init__ resolves the HMAC secret (passed from SecuritySettings.from_env config/__init__.py:281 reading MOTHERSHIP_SECRET_KEY, else env fallback or generated dev secret), validates its strength and stores self.secret_key used by verify_token at jwt.py:390."
},
{
"role": "Cryptographer",
"status": "external",
"symbol": "decode",
"file": "src/application/mothership/security/jwt.py",
"lines": "72",
"notes": "Verifier verify_token -> _decode_jwt (jwt.py:61) calls PyJWT jwt.decode with the secret, algorithms=[HS256], audience and exp verification (import at jwt.py:21). If PyJWT is not installed, an in-repo fallback computes HMAC-SHA256 with hmac.new and compares with hmac.compare_digest (jwt.py:93-99)."
},
{
"role": "System",
"status": "present",
"symbol": "get_full_state",
"file": "src/application/mothership/routers/cockpit.py",
"lines": "239",
"notes": "Example protected business handler GET /api/v1/cockpit/state/full (cockpit router included in main.py:916) that depends on RequiredAuth -> require_authentication -> verify_authentication (dependencies.py:219) and returns the full cockpit state only after successful token verification. Many other handlers use the same Auth/RequiredAuth dependency."
}
]
}

Xet Storage Details

Size:
3.09 kB
·
Xet hash:
999e924f61fdaf5b04cc84b14ad2022bd56c862e6655359e0122ba254e4cedbf

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.