AnonymousSpottedToad/securityPatternsRecovery / ground_truth /python /authentication_pwd__aspuru-guzik-group_molar.json
| { | |
| "role_mappings": [ | |
| { | |
| "patternRole": "Subject", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Implicit; submits OAuth2PasswordRequestForm (username+password) to /login/access-token, registration form to /user/register, or reset request to /password-recovery/{email}", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Enforcer", | |
| "entity": "login_access_token", | |
| "file": "molar/backend/api/api_v1/endpoints/login.py", | |
| "lines": "27", | |
| "notes": "OAuth2PasswordBearer extracts Bearer token from Authorization header; login_access_token() accepts form credentials, delegates to crud.user.authenticate(), returns JWT on success", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Verification manager", | |
| "entity": "authenticate", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "lines": "55", | |
| "notes": "authenticate() fetches user by email then delegates to verify_password(); get_current_user() decodes JWT, validates token payload, fetches user from DB", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Comparator", | |
| "entity": "verify", | |
| "file": "molar/backend/core/security.py", | |
| "lines": "32", | |
| "notes": "passlib CryptContext with bcrypt scheme; constant-time comparison via passlib.verify()", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Hasher", | |
| "entity": "verify", | |
| "file": "molar/backend/core/security.py", | |
| "lines": "32", | |
| "notes": "passlib CryptContext(schemes=['bcrypt'], deprecated='auto'); salt generated internally by bcrypt", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Password store", | |
| "entity": "get_by_email", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "lines": "15–16", | |
| "notes": "User table created via Alembic migration; hashed_password stored as text; accessed via SQLAlchemy ORM (automap reflected models)", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Pepper store", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Not found; no pepper or secret key concatenated before hashing", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Encrypter", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "JWT HS256 with SECRET_KEY (secrets.token_urlsafe(32)) for both access tokens and password reset tokens; jose library", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Hash manager", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "create() hashes password via get_password_hash() before DB insert; update() re-hashes if password field present in update data", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "SRNG", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "SECRET_KEY generated once at startup via secrets.token_urlsafe(32); bcrypt salt generated internally by passlib CryptContext on each hash() call", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Password policy", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Not found; no password length, complexity, dictionary, or breach checks; any string accepted as password (UserCreate simply takes password: str)", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "System", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "FastAPI dependency injection enforces authentication on protected routes; superuser check for admin endpoints (add user, activate, deactivate, delete)", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Registrar", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Two registration paths: open self-registration (inactive by default, needs admin activation) and admin-created users (active immediately); both call crud.user.create() which hashes password", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Resetter", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Full side-channel reset: generates JWT reset token, sends via email, verify_password_reset_token() validates token, re-hashes new password via get_password_hash()", | |
| "status": "missing", | |
| "nodeId": null | |
| } | |
| ], | |
| "interaction_order": { | |
| "available": true, | |
| "language": "python", | |
| "repo": "aspuru-guzik-group_molar", | |
| "reason": "", | |
| "entryRole": "Enforcer", | |
| "entryRule": "behaviour", | |
| "interactions": [ | |
| { | |
| "rank": 1, | |
| "interaction": "Enforcer → Verification manager", | |
| "from": "Enforcer", | |
| "to": "Verification manager", | |
| "file": "molar/backend/api/api_v1/endpoints/login.py", | |
| "line": 41, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "molar/backend/api/api_v1/endpoints/login.py:<module>.login_access_token", | |
| "file": "molar/backend/api/api_v1/endpoints/login.py", | |
| "line": 41, | |
| "code": "crud.user.authenticate(db, email = form_data.username, password = form_data.password)", | |
| "callee": "molar/backend/crud/crud_user.py:<module>.CRUDUser.authenticate", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 2, | |
| "interaction": "Verification manager → Password store", | |
| "from": "Verification manager", | |
| "to": "Password store", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "line": 58, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "molar/backend/crud/crud_user.py:<module>.CRUDUser.authenticate", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "line": 58, | |
| "code": "self.get_by_email(db, email = email)", | |
| "callee": "molar/backend/crud/crud_user.py:<module>.CRUDUser.get_by_email", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer → Verification manager" | |
| }, | |
| { | |
| "rank": 3, | |
| "interaction": "Verification manager → Hasher", | |
| "from": "Verification manager", | |
| "to": "Hasher", | |
| "file": "molar/backend/core/security.py", | |
| "line": 32, | |
| "via": [ | |
| "molar/backend/core/security.py:<module>.verify_password" | |
| ], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "molar/backend/crud/crud_user.py:<module>.CRUDUser.authenticate", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "line": 61, | |
| "code": "verify_password(password, user.hashed_password)", | |
| "callee": "molar/backend/core/security.py:<module>.verify_password", | |
| "mechanism": "call" | |
| }, | |
| { | |
| "caller": "molar/backend/core/security.py:<module>.verify_password", | |
| "file": "molar/backend/core/security.py", | |
| "line": 32, | |
| "code": "pwd_context.verify(plain_password, hashed_password)", | |
| "callee": "passlib/context.py:<module>.CryptContext.verify", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer → Verification manager" | |
| }, | |
| { | |
| "rank": 4, | |
| "interaction": "Verification manager → Comparator", | |
| "from": "Verification manager", | |
| "to": "Comparator", | |
| "file": "molar/backend/core/security.py", | |
| "line": 32, | |
| "via": [ | |
| "molar/backend/core/security.py:<module>.verify_password" | |
| ], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "molar/backend/crud/crud_user.py:<module>.CRUDUser.authenticate", | |
| "file": "molar/backend/crud/crud_user.py", | |
| "line": 61, | |
| "code": "verify_password(password, user.hashed_password)", | |
| "callee": "molar/backend/core/security.py:<module>.verify_password", | |
| "mechanism": "call" | |
| }, | |
| { | |
| "caller": "molar/backend/core/security.py:<module>.verify_password", | |
| "file": "molar/backend/core/security.py", | |
| "line": 32, | |
| "code": "pwd_context.verify(plain_password, hashed_password)", | |
| "callee": "passlib/context.py:<module>.CryptContext.verify", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer → Verification manager" | |
| } | |
| ], | |
| "anchoredRoles": [ | |
| { | |
| "role": "Comparator", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Encrypter", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "Hash manager", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Hasher", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Password policy", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Password store", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "Pepper store", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Registrar", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Resetter", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "SRNG", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Verification manager", | |
| "kind": "METHOD" | |
| } | |
| ], | |
| "skippedRoles": [ | |
| "Subject", | |
| "System" | |
| ] | |
| } | |
| } |
Xet Storage Details
- Size:
- 9.67 kB
- Xet hash:
- ad17467846d0ce124f4ffb228045e3f3c77785213f9bbf9201249759722b1b00
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.