Repository navigation
[feature/#724] 게임판 접근 권한 검증 및 기본 코트 정책 반영 - #731
Merged
Merged
Conversation
Dimo-2562
requested changes
Aug 24, 2026
| * @param memberId 요청자(추후 게임판 접근 권한 검증에 사용 예정) | ||
| * @param memberId 요청자 | ||
| */ | ||
| public GameBoardResult getBoard(Long memberId, Long gameBoardId) { |
Contributor
There was a problem hiding this comment.
이 메서드를 통해 DTO를 만들고 이를 기반으로 전체에게 브로드캐스트를 GameReadtimeDomainHandler에서 148-150, 184-187, 200-211에서 진행합니다.
이때 isGameHost가 true인채로 모두에게 전파되므로 이는 수정되어야 할 필요성이 있어 보입니다!
Contributor
Author
There was a problem hiding this comment.
오 그렇네요! 해당 부분 수정하였습니다!
| private static final int MIN_COURT_COUNT = 1; | ||
| private static final int MAX_COURT_COUNT = 10; | ||
|
|
||
| public GameCourtManageCommand { |
Contributor
There was a problem hiding this comment.
해당 Command를 생성하는 GameCourtMapper에서 item.courtId()를 호출하다 NPE가 발생할 수 있습니다.
Request 객체에서 배열뿐만 아니라 배열 원소도 NotNull 검증이 필요해보입니다!
| Long gameBoardId, | ||
| List<CourtCommand> courts | ||
| ) { | ||
| private static final int MIN_COURT_COUNT = 1; |
Contributor
There was a problem hiding this comment.
뿐만 아니라 해당 DTO에서 NotNull 내부 메세지로 전체 삭제 시 빈 배열이라고 문구가 적혀있지만 실제로 기획상 0개는 될 수 없으므로 해당 문구 수정이 필요합니다.
isGameHost는 요청자 본인의 진행자 여부를 뜻하는 개인 값이나, 변경을 일으킨 요청자 기준으로 조회한 보드 DTO를 그대로 전체 구독자에게 브로드캐스트하여 다른 구독자에게 isGameHost=true가 새어나갔다. 브로드캐스트 본문에서는 항상 false로 내리는 toBroadcastBoard를 추가해 create/delete/board-update 3개 지점에 적용한다. 요청자 본인은 직접 응답으로 올바른 값을 받으므로 영향이 없다.
courts 배열에 null 원소({"courts":[null]})가 들어오면 GameCourtMapper에서 item.courtId() 호출 시 NPE(500)가 발생했다. 리스트 원소에 컨테이너 요소 제약 @NotNull을 걸어 경계에서 400으로 걸러지도록 한다.
기획상 코트는 최소 1개(빈 배열 불가)이나 안내 문구가 '전체 삭제 시 빈 배열'로 되어 있어 0개가 허용되는 것처럼 오해를 주었다. 실제 제약에 맞게 문구를 정정한다.
Merged
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. 조회 권한 완화 + 게임 진행자 여부(isGameHost) 응답 추가
isGameHost필드 추가 → 프론트가 조작 UI 노출 여부를 판단GameBoardAccessValidator.validateViewer및 관련 에러코드(GAME_BOARD_VIEW_ACCESS_DENIED) 제거,isGameHost()판별 메서드 추가2. 게임 진행 API에 게임 진행자 권한 검증 추가
createGame/startGame/completeGame/deleteGame/moveGameToWaiting에validateGameHost배선3. 코트 관리 권한 검증 + 기본 코트 정책 반영
manageCourts/moveCourt)에 진행자 검증 배선연결된 issue
연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #724
🩷 Approve 하기 전 확인해주세요!
✅ 체크리스트