fix: audit findings (typing, DTO, encryption, javadoc, service methods)

This commit is contained in:
pray4skylark
2026-06-12 10:05:18 +09:00
parent cae0225f80
commit 0d538d66f0
6 changed files with 25 additions and 10 deletions
@@ -100,7 +100,7 @@ public class EmployeeController {
return ResponseEntity.ok(ApiResponse.ok("직원이 등록되었습니다", created));
}
@Operation(summary = "직원 정보 수정", description = "기본 정보(이름/이메일/전화번호/생년월일/학력/전공/졸업일/거주지/프로필사진) 수정")
@Operation(summary = "직원 정보 수정", description = "기본 정보(이름/이메일/전화번호/입사일/직급/프로필사진/사수) 수정")
@PreAuthorize("hasRole('ADMIN')")
@PutMapping("/{empId}")
public ResponseEntity<ApiResponse<Employee>> update(
@@ -4,6 +4,7 @@ public record EmployeeSearchResult(
Long empId,
String name,
String email,
String department
String roleCode,
String dispatchStatus
) {
}
@@ -75,6 +75,7 @@ public class EmployeeService {
e.getEmpId(),
e.getName(),
e.getEmail(),
e.getRoleCode() != null ? e.getRoleCode().name() : null,
e.getDispatchStatus() != null ? e.getDispatchStatus().name() : null
);
}
@@ -21,8 +21,8 @@ public class PhoneEncryptionConverter implements AttributeConverter<String, Stri
private static final int GCM_IV_LENGTH = 12;
private static final int GCM_TAG_LENGTH = 128;
private static SecretKey secretKey;
private static final SecureRandom secureRandom = new SecureRandom();
private SecretKey secretKey;
private final SecureRandom secureRandom = new SecureRandom();
public PhoneEncryptionConverter(@Value("${app.encryption.phone-key}") String key) {
byte[] keyBytes = key.getBytes();
@@ -65,7 +65,7 @@ public class PhoneEncryptionConverter implements AttributeConverter<String, Stri
cipher.init(Cipher.DECRYPT_MODE, secretKey, new GCMParameterSpec(GCM_TAG_LENGTH, iv));
return new String(cipher.doFinal(ciphertext));
} catch (Exception e) {
return encrypted;
throw new RuntimeException("Phone decryption failed", e);
}
}
}