Repository navigation
🐛 공개 전 문제 노출 차단, Clock KST 고정, 본문 파싱 오류 400 통일 - #54
Merged
Merged
Conversation
- 문제 상세 조회와 제출 경로를 openAt <= now 기준 findOpenById로 변경 (공개 전 문제는 존재하지 않는 문제와 같은 404 PROBLEM_NOT_FOUND) - ClockConfig를 Asia/Seoul로 고정해 UTC 컨테이너에서 회차 비교가 9시간 밀리는 문제 방지 - HttpMessageNotReadableException을 400 INVALID_REQUEST로 통일 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
1. 공개 전 문제 노출 차단
ProblemRepository.findOpenById(id, now)추가 — 목록 쿼리(searchOpen...)와 같은 기준(p.round.openAt <= :now)ProblemService.getProblemDetail이findById대신findOpenById(problemId, LocalDateTime.now(clock))사용ProblemNotFoundException(404PROBLEM_NOT_FOUND)으로 응답 → 존재 여부 비노출SubmissionService.validate도 같은findOpenById로 변경. 기존엔findById라 공개 전(23시에 미리 생성된 다음 날) 문제에도 제출이 가능했음 → 이제 같은 4042. Clock KST 고정
ClockConfig:Clock.systemDefaultZone()→Clock.system(ZoneId.of("Asia/Seoul"))-Duser.timezone임시 처리는 이후 제거 가능)3. HttpMessageNotReadableException 핸들러
GlobalExceptionHandler에 추가: 400 +ErrorResponse("INVALID_REQUEST", "요청 본문 형식이 올바르지 않습니다.")테스트
ProblemServiceTest: 공개 전 문제 상세 조회 시 404SubmissionServiceTest: 공개 전 문제 제출 시 404, 채점 엔진 미호출ProblemRepositoryTest:findOpenById가 공개 전 회차 문제를 반환하지 않음 (실제 쿼리 검증)SubmissionControllerTest: 깨진 JSON → 400INVALID_REQUEST./gradlew test통과노션 명세
노션 명세는 이미 반영됨(문제 상세 404에 공개 전 문제 포함).
이번에 건드리지 않은
now()직접 호출 (clock 미사용)JVM 기본 시간대를 따르므로 UTC 환경에서는 KST와 어긋남. 후속 PR 대상.
domain/notification/entity/Notification.java:43—createdAtdomain/feedback/entity/Feedback.java:64—createdAtdomain/admin/entity/AiGenerationLog.java:69—createdAtdomain/problem/entity/Problem.java:62—createdAt(최신순 정렬 기준)domain/submission/entity/Submission.java:90—submittedAtdomain/user/entity/User.java:65—@CreatedDate(JPA Auditing, 시스템 시간대 기준)🤖 Generated with Claude Code