Buckets:

AnonymousSpottedToad/securityPatternsRecovery / ground_truth /python /authentication_pwd__olaflaitinen_Promethium.json
download
raw
8.17 kB
{
"role_mappings": [
{
"patternRole": "Subject",
"entity": "",
"file": "",
"lines": "",
"notes": "No in-repo client sends credentials to POST /auth/login; the frontend/ directory is absent from the working tree and src/ has no client code calling the login endpoint. The caller is outside the repo (OAuth2PasswordBearer in src/promethium/api/deps/auth.py:17 only points token clients at the URL).",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Enforcer",
"entity": "login_access_token",
"file": "src/promethium/api/routers/auth.py",
"lines": "22",
"notes": "FastAPI POST /auth/login handler (router included in src/promethium/api/main.py:43) receives username/password via OAuth2PasswordRequestForm, calls AuthService.authenticate_user at auth.py:29 and raises HTTP 401 at auth.py:34 when it returns None.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Verification manager",
"entity": "authenticate_user",
"file": "src/promethium/api/services/auth_service.py",
"lines": "18",
"notes": "Called by login_access_token (auth.py:29). AuthService.authenticate_user loads the User by email (line 24), then calls verify_password(password, user.hashed_password) at line 30 and returns the user or None.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Password store",
"entity": "User",
"file": "src/promethium/api/models/user.py",
"lines": "12",
"notes": "Reached from authenticate_user via the inline SQLAlchemy query select(User).where(User.email == email) at auth_service.py:24. SQLAlchemy model User (table 'users') holds the bcrypt hash in column hashed_password (user.py:30); no separate repository method exists, so the model class is cited.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Hasher",
"entity": "verify",
"file": "src/promethium/core/security.py",
"lines": "6",
"notes": "authenticate_user (auth_service.py:30) calls the thin wrapper verify_password (security.py:5), which calls passlib CryptContext.verify at security.py:6; the context is configured with bcrypt at security.py:3. One library call both hashes (with the stored salt) and compares, so it covers Hasher and Comparator.",
"status": "external",
"nodeId": null
},
{
"patternRole": "Pepper store",
"entity": "",
"file": "",
"lines": "",
"notes": "No pepper is used: verify_password/get_password_hash in src/promethium/core/security.py pass only the password to bcrypt; grep for pepper finds nothing. The bcrypt salt is not a pepper. SECRET_KEY in auth_service.py:50 is the JWT signing key, not a pepper.",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Encrypter",
"entity": "",
"file": "",
"lines": "",
"notes": "The bcrypt hash is not encrypted with any key on the verification path (security.py:6 is a plain passlib bcrypt verify); jwt.encode in create_access_token concerns token issuance, not password encryption.",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Comparator",
"entity": "verify",
"file": "src/promethium/core/security.py",
"lines": "6",
"notes": "Same call as the Hasher: passlib CryptContext(schemes=['bcrypt']).verify at security.py:6 (via wrapper verify_password, called from auth_service.py:30) recomputes the bcrypt hash and compares it with the stored hashed_password; one call covers both roles.",
"status": "external",
"nodeId": null
},
{
"patternRole": "System",
"entity": "create_access_token",
"file": "src/promethium/api/services/auth_service.py",
"lines": "36",
"notes": "On successful verification login_access_token calls AuthService.create_access_token at auth.py:44, which issues the HS256 JWT returned to the client (auth.py:48).",
"status": "present",
"nodeId": null
}
],
"interaction_order": {
"available": true,
"language": "python",
"repo": "olaflaitinen_Promethium",
"reason": "",
"entryRole": "Enforcer",
"entryRule": "behaviour",
"interactions": [
{
"rank": 1,
"interaction": "Enforcer \u2192 Verification manager",
"from": "Enforcer",
"to": "Verification manager",
"file": "src/promethium/api/routers/auth.py",
"line": 29,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "src/promethium/api/routers/auth.py:<module>.login_access_token",
"file": "src/promethium/api/routers/auth.py",
"line": 29,
"code": "AuthService.authenticate_user(db, email = form_data.username, password = form_data.password)",
"callee": "src/promethium/api/services/auth_service.py:<module>.AuthService.authenticate_user",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 2,
"interaction": "Verification manager \u2192 Hasher",
"from": "Verification manager",
"to": "Hasher",
"file": "src/promethium/core/security.py",
"line": 6,
"via": [
"src/promethium/core/security.py:<module>.verify_password"
],
"mechanism": "call",
"path": [
{
"caller": "src/promethium/api/services/auth_service.py:<module>.AuthService.authenticate_user",
"file": "src/promethium/api/services/auth_service.py",
"line": 30,
"code": "verify_password(password, user.hashed_password)",
"callee": "src/promethium/core/security.py:<module>.verify_password",
"mechanism": "call"
},
{
"caller": "src/promethium/core/security.py:<module>.verify_password",
"file": "src/promethium/core/security.py",
"line": 6,
"code": "pwd_context.verify(plain_password, hashed_password)",
"callee": "passlib/context.py:<module>.CryptContext.verify",
"mechanism": "call"
}
],
"parent": "Enforcer \u2192 Verification manager"
},
{
"rank": 3,
"interaction": "Verification manager \u2192 Comparator",
"from": "Verification manager",
"to": "Comparator",
"file": "src/promethium/core/security.py",
"line": 6,
"via": [
"src/promethium/core/security.py:<module>.verify_password"
],
"mechanism": "call",
"path": [
{
"caller": "src/promethium/api/services/auth_service.py:<module>.AuthService.authenticate_user",
"file": "src/promethium/api/services/auth_service.py",
"line": 30,
"code": "verify_password(password, user.hashed_password)",
"callee": "src/promethium/core/security.py:<module>.verify_password",
"mechanism": "call"
},
{
"caller": "src/promethium/core/security.py:<module>.verify_password",
"file": "src/promethium/core/security.py",
"line": 6,
"code": "pwd_context.verify(plain_password, hashed_password)",
"callee": "passlib/context.py:<module>.CryptContext.verify",
"mechanism": "call"
}
],
"parent": "Enforcer \u2192 Verification manager"
}
],
"anchoredRoles": [
{
"role": "Comparator",
"kind": "external"
},
{
"role": "Encrypter",
"kind": "external"
},
{
"role": "Enforcer",
"kind": "METHOD"
},
{
"role": "Hasher",
"kind": "external"
},
{
"role": "Password store",
"kind": "TYPE_DECL"
},
{
"role": "Pepper store",
"kind": "external"
},
{
"role": "Verification manager",
"kind": "METHOD"
}
],
"skippedRoles": [
"Subject",
"System"
]
}
}

Xet Storage Details

Size:
8.17 kB
·
Xet hash:
f01642d383ac37d52f61c7fbd32c184d6bcb5ae3af8b8d0b41018c3ada517542

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