Buckets:

AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /authentication_pwd__catch-money_java-impetus.json
download
raw
15.9 kB
{
"role_mappings": [
{
"patternRole": "Subject",
"entity": "",
"file": "",
"lines": "",
"notes": "The caller is an external HTTP client that POSTs /v1/login/up; the repo only contains the request DTO (LoginRequest), not the subject itself.",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Enforcer",
"entity": "login",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"lines": "40–124",
"notes": "@RestController mapped to /v1/login exposing POST /up, the single credential entry point of the framework; it refuses to issue a token and returns 'account does not exist' / 'password is incorrect' unless the presented password matches the stored one. Enforcement of subsequent requests is token-based (DefaultFilter/TokenParseSecurityRequestFilter in the same module), which is a different pattern.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Verification manager",
"entity": "login",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"lines": "42",
"notes": "Orchestrates the whole verification: obtains a Cryption instance and decrypts the submitted username/password (lines 44-50), loads the stored account via UserAccount.getByUsername (line 56), and drives the comparison at line 62 before generating a token. No separate AuthenticationProvider/UserDetailsService exists — Spring Security's formLogin is explicitly disabled in SpringSecurityConfiguration.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Comparator",
"entity": "equals",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"lines": "62",
"notes": "The decision point is `if (!userAccount.getPassword().equals(password))` — a direct String comparison of the stored credential against the decrypted presented password, returning a failure Result when it does not match. No PasswordEncoder#matches is used anywhere in the repo.",
"status": "external",
"nodeId": null
},
{
"patternRole": "Hasher",
"entity": "md5",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"lines": "105",
"notes": "Repo-defined hashing helper (wraps commons-codec DigestUtils.md5Hex); it is the only hash applied to a credential, used to seed the stored password at account creation (UserInfoApi.addAccountInfo line 198) and at password reset (UserInfoApi.resetPwd line 115). Caveat: the login path itself does not hash the presented password — it compares plaintext against the stored value — and UserInfoApi.changePwd (line 311) writes the new password unhashed; an unused toSHA256 also exists at line 89.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Password store",
"entity": "getByUsername",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"lines": "56",
"notes": "The lookup the login path calls to fetch the stored credential by identifier; it queries the JPA @Entity UserAccount (class line 21, table user_account) whose `password` column is declared at line 42. There is no dedicated UserRepository interface — persistence goes through the generic JpaRepositoryUtils/DaoUtils helpers, so the entity's own finder is the store's access point.",
"status": "present",
"nodeId": null
},
{
"patternRole": "Encrypter",
"entity": "decrypt",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"lines": "70",
"notes": "AES/ECB/PKCS7Padding (BouncyCastle) under a hard-coded 32-byte server key, reached from the login path via Cryption.getInstance(...).decryptAsString on both the username and the password (LoginApi lines 44-50); the matching encrypt primitive is at line 82. This is keyed encryption of the credential in transit, not a pepper over the stored hash — the encryption_data table (EncryptionData, with salt and algorithm_key columns) is never consulted by the verification path, so no pepper step exists.",
"status": "present",
"nodeId": null
},
{
"patternRole": "System",
"entity": "",
"file": "",
"lines": "",
"notes": "This is a reusable Spring Boot auth starter, not an application: on a successful password check LoginApi only mints and records a token (TokenGenerate/TokenRecordProcess), and the business logic to be protected belongs to the downstream app. The in-repo admin endpoints (UserInfoApi, GroupApi, PermissionApi) are reached only in a later token-validated request, not by this login flow.",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Pepper store",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Registrar",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Resetter",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Password policy",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Hash manager",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
},
{
"patternRole": "SRNG",
"entity": "",
"file": "",
"lines": "",
"notes": "",
"status": "missing",
"nodeId": null
}
],
"interaction_order": {
"available": true,
"language": "java",
"repo": "catch-money_java-impetus",
"reason": "",
"entryRole": "Enforcer",
"entryRule": "behaviour",
"interactions": [
{
"rank": 1,
"interaction": "Enforcer → Verification manager",
"from": "Enforcer",
"to": "Verification manager",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 40,
"via": [],
"mechanism": "co-located",
"path": [],
"parent": ""
},
{
"rank": 2,
"interaction": "Enforcer → Encrypter",
"from": "Enforcer",
"to": "Encrypter",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"line": 46,
"via": [
"io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)"
],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 49,
"code": "instance.decryptAsString(loginRequest.getUsername())",
"callee": "io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"file": "java-impetus-auth/src/main/java/io/github/jockerCN/secret/Cryption.java",
"line": 19,
"code": "this.decrypt(data)",
"callee": "io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"file": "java-impetus-auth/src/main/java/io/github/jockerCN/secret/Cryption.java",
"line": 41,
"code": "CryptoUtils.simpleDecrypt(data.toString())",
"callee": "io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"line": 46,
"code": "CryptoUtils.DEFAULT_CRYPTO.decrypt(data)",
"callee": "io.github.jockerCN.secret.CryptoUtils.decrypt:byte[](java.lang.String)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 3,
"interaction": "Verification manager → Encrypter",
"from": "Verification manager",
"to": "Encrypter",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"line": 46,
"via": [
"io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)"
],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 49,
"code": "instance.decryptAsString(loginRequest.getUsername())",
"callee": "io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.Cryption.decryptAsString:java.lang.String(java.lang.Object)",
"file": "java-impetus-auth/src/main/java/io/github/jockerCN/secret/Cryption.java",
"line": 19,
"code": "this.decrypt(data)",
"callee": "io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.Cryption.defaultCryption.Cryption$0.decrypt:byte[](java.lang.Object)",
"file": "java-impetus-auth/src/main/java/io/github/jockerCN/secret/Cryption.java",
"line": 41,
"code": "CryptoUtils.simpleDecrypt(data.toString())",
"callee": "io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)",
"mechanism": "call"
},
{
"caller": "io.github.jockerCN.secret.CryptoUtils.simpleDecrypt:byte[](java.lang.String)",
"file": "java-impetus-common/src/main/java/io/github/jockerCN/secret/CryptoUtils.java",
"line": 46,
"code": "CryptoUtils.DEFAULT_CRYPTO.decrypt(data)",
"callee": "io.github.jockerCN.secret.CryptoUtils.decrypt:byte[](java.lang.String)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 4,
"interaction": "Enforcer → Password store",
"from": "Enforcer",
"to": "Password store",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 56,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 56,
"code": "UserAccount.getByUsername(username)",
"callee": "io.github.jockerCN.dao.UserAccount.getByUsername:io.github.jockerCN.dao.UserAccount(java.lang.String)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 5,
"interaction": "Verification manager → Password store",
"from": "Verification manager",
"to": "Password store",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 56,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 56,
"code": "UserAccount.getByUsername(username)",
"callee": "io.github.jockerCN.dao.UserAccount.getByUsername:io.github.jockerCN.dao.UserAccount(java.lang.String)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 6,
"interaction": "Enforcer → Comparator",
"from": "Enforcer",
"to": "Comparator",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 62,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 62,
"code": "userAccount.getPassword().equals(password)",
"callee": "java.lang.String.equals:boolean(java.lang.Object)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 7,
"interaction": "Verification manager → Comparator",
"from": "Verification manager",
"to": "Comparator",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 62,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "io.github.jockerCN.api.LoginApi.login:io.github.jockerCN.Result(io.github.jockerCN.api.param.LoginRequest)",
"file": "java-impetus-auth-impl/src/main/java/io/github/jockerCN/api/LoginApi.java",
"line": 62,
"code": "userAccount.getPassword().equals(password)",
"callee": "java.lang.String.equals:boolean(java.lang.Object)",
"mechanism": "call"
}
],
"parent": ""
}
],
"anchoredRoles": [
{
"role": "Comparator",
"kind": "external"
},
{
"role": "Encrypter",
"kind": "METHOD"
},
{
"role": "Enforcer",
"kind": "METHOD"
},
{
"role": "Hash manager",
"kind": "external"
},
{
"role": "Hasher",
"kind": "METHOD"
},
{
"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:
15.9 kB
·
Xet hash:
a244629890a8eb55e5abdf1c9d0725c0ec390accf913be64add9a105f5a3fac8

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