Buckets:

AnonymousSpottedToad/securityPatternsRecovery / ground_truth /python /authentication_pwd__cxmjg_yaml-to-backend.json
download
raw
8.79 kB
{
"role_mappings": [
{
"patternRole": "Subject",
"entity": "",
"file": "",
"lines": "",
"notes": "Implicit (HTTP client submitting LoginRequest with username + password)",
"status": "external",
"nodeId": null
},
{
"patternRole": "Enforcer",
"entity": "login",
"file": "yaml_to_backend/api/auth_routes.py",
"lines": "34",
"notes": "Raises HTTP 401 on bad credentials; HTTPBearer enforces token on protected routes",
"status": "present",
"nodeId": null
},
{
"patternRole": "Verification manager",
"entity": "authenticate_user",
"file": "yaml_to_backend/security/auth.py",
"lines": "57",
"notes": "Orchestrates DB lookup (raw SQL SELECT) + verify_password(); returns user or None",
"status": "present",
"nodeId": null
},
{
"patternRole": "Comparator",
"entity": "verify",
"file": "yaml_to_backend/security/auth.py",
"lines": "30",
"notes": "passlib bcrypt constant-time comparison",
"status": "external",
"nodeId": null
},
{
"patternRole": "Hasher",
"entity": "verify",
"file": "yaml_to_backend/security/auth.py",
"lines": "30",
"notes": "bcrypt with 12 rounds (CryptContext schemes=['bcrypt'], bcrypt__rounds=12)",
"status": "external",
"nodeId": null
},
{
"patternRole": "Password store",
"entity": "session",
"file": "yaml_to_backend/security/auth.py",
"lines": "73",
"notes": "Async access via SQLAlchemy/asyncmy; raw SQL in authenticate_user()",
"status": "present",
"nodeId": null
},
{
"patternRole": "Pepper store",
"entity": "",
"file": "",
"lines": "",
"notes": "Not found -- no pepper/pre-hash secret",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Encrypter",
"entity": "",
"file": "",
"lines": "",
"notes": "Not found -- no HMAC/pepper encryption step",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Hash manager",
"entity": "_create_initial_users",
"file": "yaml_to_backend/app.py",
"lines": "314",
"notes": "Orchestrates hashing before DB insert during install-mode user creation",
"status": "missing",
"nodeId": null
},
{
"patternRole": "SRNG",
"entity": "",
"file": "",
"lines": "",
"notes": "bcrypt internally uses os.urandom for salt generation; no explicit SRNG call",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Password policy",
"entity": "",
"file": "",
"lines": "",
"notes": "Not found -- no min-length, complexity, or dictionary checks on passwords",
"status": "missing",
"nodeId": null
},
{
"patternRole": "System",
"entity": "",
"file": "",
"lines": "",
"notes": "Returns {access_token, token_type: 'bearer'} via AuthManager.create_access_token()",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Registrar",
"entity": "",
"file": "",
"lines": "",
"notes": "Install-mode only; seeds admin + usuario1; no API-exposed self-registration",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Resetter",
"entity": "",
"file": "",
"lines": "",
"notes": "Not found -- no password reset endpoint, CLI command, or side-channel flow",
"status": "missing",
"nodeId": null
}
],
"interaction_order": {
"available": true,
"language": "python",
"repo": "cxmjg_yaml-to-backend",
"reason": "",
"entryRole": "Enforcer",
"entryRule": "behaviour",
"interactions": [
{
"rank": 1,
"interaction": "Enforcer \u2192 Verification manager",
"from": "Enforcer",
"to": "Verification manager",
"file": "yaml_to_backend/api/auth_routes.py",
"line": 45,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "yaml_to_backend/api/auth_routes.py:<module>.login",
"file": "yaml_to_backend/api/auth_routes.py",
"line": 45,
"code": "auth_manager.authenticate_user(login_data.username, login_data.password, session)",
"callee": "yaml_to_backend/security/auth.py:<module>.AuthManager.authenticate_user",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 2,
"interaction": "Verification manager \u2192 Password store",
"from": "Verification manager",
"to": "Password store",
"file": "yaml_to_backend/security/auth.py",
"line": 73,
"via": [],
"mechanism": "data",
"path": [
{
"caller": "yaml_to_backend/security/auth.py:<module>.AuthManager.authenticate_user",
"file": "yaml_to_backend/security/auth.py",
"line": 73,
"code": "",
"callee": "session",
"mechanism": "data"
}
],
"parent": "Enforcer \u2192 Verification manager"
},
{
"rank": 3,
"interaction": "Verification manager \u2192 Hasher",
"from": "Verification manager",
"to": "Hasher",
"file": "yaml_to_backend/security/auth.py",
"line": 30,
"via": [
"yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password"
],
"mechanism": "call",
"path": [
{
"caller": "yaml_to_backend/security/auth.py:<module>.AuthManager.authenticate_user",
"file": "yaml_to_backend/security/auth.py",
"line": 79,
"code": "self.verify_password(password, getattr(user_data, password_column))",
"callee": "yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password",
"mechanism": "call"
},
{
"caller": "yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password",
"file": "yaml_to_backend/security/auth.py",
"line": 30,
"code": "pwd_context.verify(plain_password, hashed_password)",
"callee": "passlib/context.py:<module>.CryptContext.verify",
"mechanism": "call"
}
],
"parent": "Enforcer \u2192 Verification manager"
},
{
"rank": 4,
"interaction": "Verification manager \u2192 Comparator",
"from": "Verification manager",
"to": "Comparator",
"file": "yaml_to_backend/security/auth.py",
"line": 30,
"via": [
"yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password"
],
"mechanism": "call",
"path": [
{
"caller": "yaml_to_backend/security/auth.py:<module>.AuthManager.authenticate_user",
"file": "yaml_to_backend/security/auth.py",
"line": 79,
"code": "self.verify_password(password, getattr(user_data, password_column))",
"callee": "yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password",
"mechanism": "call"
},
{
"caller": "yaml_to_backend/security/auth.py:<module>.AuthManager.verify_password",
"file": "yaml_to_backend/security/auth.py",
"line": 30,
"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": "Hash manager",
"kind": "METHOD"
},
{
"role": "Hasher",
"kind": "external"
},
{
"role": "Password policy",
"kind": "external"
},
{
"role": "Password store",
"kind": "PARAM"
},
{
"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:
8.79 kB
·
Xet hash:
38855e77f4c466fa93b33bbc09f43fd2b5cbf982a7628aebaadaa3ecc8331fe8

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