AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /authentication_pwd__edsonmartins_archbase-app-framework.json
| { | |
| "role_mappings": [ | |
| { | |
| "patternRole": "Subject", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The caller is an external HTTP client (frontend/mobile app) that POSTs email + password to /api/v1/auth/authenticate; no in-repo client of the login endpoint exists outside tests.", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Enforcer", | |
| "entity": "ArchbaseAuthenticationController", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/auth/ArchbaseAuthenticationController.java", | |
| "lines": "31", | |
| "notes": "REST entry point of the login flow (@RequestMapping(\"/api/v1/auth\")): POST /authenticate, /login and /login-flexible receive the identifier + password, delegate to ArchbaseAuthenticationService and return 401 on BadCredentialsException / 403 on CredentialsExpiredException. All other endpoints are blocked before this by the SecurityFilterChain in BaseArchbaseSecurityConfiguration.configure (line 24) which permits only the whitelist and installs ArchbaseJwtAuthenticationFilter.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Verification manager", | |
| "entity": "authenticate", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseAuthenticationService.java", | |
| "lines": "120", | |
| "notes": "Collects the credentials from AuthenticationRequest, resolves the tenant, then drives the check by calling authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(email, password)) at line 142 and only afterwards loads the user and mints JWT/refresh tokens. The actual credential comparison is delegated to Spring's DaoAuthenticationProvider, which this repo wires itself in ArchbaseSecurityApplicationConfig.authenticationProvider (line 41).", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Comparator", | |
| "entity": "matches", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseUserService.java", | |
| "lines": "26", | |
| "notes": "The decision is Spring Security's PasswordEncoder.matches(rawPassword, storedHash); this is the only in-repo call site of it on a user password (verifying the current password before a change; the same call at line 50 and in MfaService line 119 for recovery codes). On the primary login path the identical matches() call is executed inside DaoAuthenticationProvider, which the repo configures with its BCryptPasswordEncoder in ArchbaseSecurityApplicationConfig line 43 — one library call performs both the hashing of the presented password and the comparison.", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Hasher", | |
| "entity": "BCryptPasswordEncoder", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/config/ArchbaseSecurityApplicationConfig.java", | |
| "lines": "62", | |
| "notes": "The repo declares BCryptPasswordEncoder as the PasswordEncoder bean (BCrypt generates and embeds its own per-password salt). Its encode() is called in-repo when a password enters the store (UserService.createUser line 105, updateUser line 122, ArchbaseAuthenticationService.resetPassword line 407), and it is the same encoder DaoAuthenticationProvider uses to hash the presented password during login.", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Password store", | |
| "entity": "UserJpaRepository", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/repository/UserJpaRepository.java", | |
| "lines": "15", | |
| "notes": "Spring Data JPA repository over UserEntity; findByEmail (line 17) is the lookup used both by the UserDetailsService bean (ArchbaseSecurityApplicationConfig line 32) that feeds DaoAuthenticationProvider and by the login/reset flows. The bcrypt hash itself lives in UserEntity.password, column SENHA (archbase-security/src/main/java/br/com/archbase/security/persistence/UserEntity.java line 31).", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Encrypter", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No pepper or keyed encryption is applied to the password hash: UserEntity.password is stored as the plain bcrypt string with no @Convert encryption. ArchbaseCryptoService / ArchbaseEncryptedStringConverter (AES-GCM) exist but are used for the MFA TOTP secret at rest, never on the password verification path.", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "System", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "This is a reusable framework module: a successful login only returns JWT/refresh tokens, and the business logic behind the guarded endpoints belongs to the consuming application. The repo's own protected controllers (e.g. UserController) are security administration, not the business action the login was requested for.", | |
| "status": "missing", | |
| "nodeId": null | |
| } | |
| ], | |
| "interaction_order": { | |
| "available": true, | |
| "language": "java", | |
| "repo": "edsonmartins_archbase-app-framework", | |
| "reason": "", | |
| "entryRole": "Enforcer", | |
| "entryRule": "behaviour", | |
| "interactions": [ | |
| { | |
| "rank": 1, | |
| "interaction": "Enforcer → Verification manager", | |
| "from": "Enforcer", | |
| "to": "Verification manager", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/auth/ArchbaseAuthenticationController.java", | |
| "line": 102, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "br.com.archbase.security.auth.ArchbaseAuthenticationController.authenticate:org.springframework.http.ResponseEntity(br.com.archbase.security.auth.AuthenticationRequest)", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/auth/ArchbaseAuthenticationController.java", | |
| "line": 102, | |
| "code": "this.service.authenticate(request)", | |
| "callee": "br.com.archbase.security.service.ArchbaseAuthenticationService.authenticate:br.com.archbase.security.auth.AuthenticationResponse(br.com.archbase.security.auth.AuthenticationRequest)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 2, | |
| "interaction": "Verification manager → Password store", | |
| "from": "Verification manager", | |
| "to": "Password store", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseAuthenticationService.java", | |
| "line": 188, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "br.com.archbase.security.service.ArchbaseAuthenticationService.authenticate:br.com.archbase.security.auth.AuthenticationResponse(br.com.archbase.security.auth.AuthenticationRequest)", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseAuthenticationService.java", | |
| "line": 188, | |
| "code": "this.repository.findTenantsByEmailIgnoringTenant(request.getEmail())", | |
| "callee": "br.com.archbase.security.repository.UserJpaRepository.findTenantsByEmailIgnoringTenant:java.util.List(java.lang.String)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer → Verification manager" | |
| }, | |
| { | |
| "rank": 3, | |
| "interaction": "Enforcer → Password store", | |
| "from": "Enforcer", | |
| "to": "Password store", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseAuthenticationService.java", | |
| "line": 328, | |
| "via": [ | |
| "br.com.archbase.security.service.ArchbaseAuthenticationService.completeMfaAuthentication:br.com.archbase.security.auth.AuthenticationResponse(java.lang.String,java.lang.String)" | |
| ], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "br.com.archbase.security.auth.ArchbaseAuthenticationController.verifyMfa:org.springframework.http.ResponseEntity(br.com.archbase.security.auth.MfaVerifyRequest)", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/auth/ArchbaseAuthenticationController.java", | |
| "line": 126, | |
| "code": "this.service.completeMfaAuthentication(request.challengeToken(), request.code())", | |
| "callee": "br.com.archbase.security.service.ArchbaseAuthenticationService.completeMfaAuthentication:br.com.archbase.security.auth.AuthenticationResponse(java.lang.String,java.lang.String)", | |
| "mechanism": "call" | |
| }, | |
| { | |
| "caller": "br.com.archbase.security.service.ArchbaseAuthenticationService.completeMfaAuthentication:br.com.archbase.security.auth.AuthenticationResponse(java.lang.String,java.lang.String)", | |
| "file": "archbase-security/src/main/java/br/com/archbase/security/service/ArchbaseAuthenticationService.java", | |
| "line": 328, | |
| "code": "this.repository.findByEmail(email)", | |
| "callee": "br.com.archbase.security.repository.UserJpaRepository.findByEmail:java.util.Optional(java.lang.String)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| } | |
| ], | |
| "anchoredRoles": [ | |
| { | |
| "role": "Comparator", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Encrypter", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "kind": "TYPE_DECL" | |
| }, | |
| { | |
| "role": "Hasher", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Password store", | |
| "kind": "TYPE_DECL" | |
| }, | |
| { | |
| "role": "Verification manager", | |
| "kind": "METHOD" | |
| } | |
| ], | |
| "skippedRoles": [ | |
| "Subject", | |
| "System" | |
| ] | |
| } | |
| } |
Xet Storage Details
- Size:
- 9.89 kB
- Xet hash:
- c62741f2bb4c00181bdef17a2c504d095b5c2963103b5d8cca818aba21858fd3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.