Skip to content

fix: [ALT-298] 알바생 업장 일정 조회의 본인 범위 격리 - #109

Merged
hodoon merged 4 commits into
devfrom
fix/alt-298
Nov 4, 2026
Merged

hodoon merged 4 commits into
devfrom
fix/alt-298

Conversation

@ysw789

@ysw789 ysw789 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

같은 업장 다른 근무자의 일정이 앱 업장 캘린더에 노출되는 문제를 고쳤습니다. 활성 소속 확인 후 인증 사용자·업장·월을 DB 조회 조건으로 적용합니다.

변경

  • 기존 사용자·업장·월 조회를 재사용하며 시간 하한 생략을 허용합니다. 대타 후보의 기존 시간 하한을 유지합니다.
  • 본인 과거 퇴사 행 일정도 포함하며, 현재 근무자 행 기준 예상 급여 계산과 응답 구조를 유지합니다.
  • 격리, 사장님 전체 조회, 대타 시간 경계 회귀 테스트를 추가했습니다.

검증

  • Red: 본인 일정2개 대신 타인 포함3개 반환 재현.
  • 관련 단위/H2 테스트14개 및 ./gradlew clean build 통과.
  • 독립 검증자의 실제 localhost HTTP E2E 통과: A/B 일정·근무자 격리, 비소속/퇴사 거부, 재입사 이력 및 급여, 사장님 전체 조회, 대타 후보, self 월·일, 인증, 잘못된 월 기존 응답.
  • 격리 PostgreSQL17.2/Redis7.4.2와 합성 계정 사용, 임시 서버·인프라·민감 파일 정리 완료. V15 스키마 기반이며 V1부터 전체 마이그레이션 검증은 아닙니다.
  • 커밋 내용은 E2E 검증 diff/새 테스트 해시와 동일합니다.

겹침과 남은 확인

  • PR fix: [ALT-287] 홈 예상 수입 업장별 내역 추가·근무시간 급여 계산 단일화·삭제 근무 제외 #105: GetWorkspaceWorkSchedule/WorkspaceShiftQueryRepositoryImpl 겹침. 해당 PR 예상 수입 정책은 가져오지 않았습니다. 병합 시 양쪽 변경을 유지해야 합니다.
  • ALT-301: 동일 query adapter 잠금 변경, ALT-305: 일정 흐름 회귀. ALT-298 승인 후 순차 구현하며 통합 검증에서 조합 확인합니다. ALT-298을 먼저 반영한 뒤 잠금/회귀 후속을 반영하는 순서를 권장합니다.
  • 새 마이그레이션 없음.
  • 일정 상세 ID 조회 API는 현재 없습니다. 직접 ID 경로404는 미지원 경로 확인이며 구현된 상세 소유권 검증을 의미하지 않습니다.
  • 업장 조회의 day 파라미터 무시 및 self 일 조회 예상 급여null은 기존 계약을 유지했습니다.
  • 실제 브라우저 캘린더·화면 진입·배포 QA는 남아 있습니다. draft PR이며 병합은 사람이 진행합니다.

관련 작업: ALT-298

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hodoon hodoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰했습니다. 인라인 코멘트 확인 부탁드립니다.


List<WorkspaceShift> shifts = workspaceShiftQueryRepository
.findByWorkspaceAndDateRange(workspaceWorker.get().getWorkspace(), request.getYear(), request.getMonth());
.findByUserAndWorkspaceAndMonthFrom(actor.getUser(), workspaceWorker.get().getWorkspace(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 변경으로 findByWorkspaceAndDateRange를 main 코드에서 호출하는 곳이 없어진 것 같습니다(포트 21행, 구현 105행만 남아 있습니다). 이 메서드는 업장 전체 일정을 사용자 범위 없이 반환합니다. 포트에 그대로 남아 있으면 나중에 앱 측 UseCase가 다시 가져다 써서 같은 격리 문제가 생길 수 있습니다.
포트와 구현에서 이 메서드를 지우고, 테스트의 lenient 스텁과 never() 검증도 함께 정리하면 어떨까요? 메서드가 없어지면 컴파일 단계에서 막히므로 never() 검증보다 확실하게 재발을 막을 수 있을 것 같습니다. 같은 파일을 수정하는 PR #105와 병합 순서도 함께 맞춰 보면 좋겠습니다.

@hodoon hodoon self-assigned this Oct 21, 2026
hodoon added a commit that referenced this pull request Oct 22, 2026
앱 업장 일정 조회가 본인 범위 쿼리로 바뀌면서 findByWorkspaceAndDateRange 호출처가 사라졌다.
사용자 범위 없이 업장 전체 일정을 돌려주는 메서드라 남겨두면 재사용 시 같은 노출이 재발할 수 있어
포트·구현에서 지우고 테스트의 관련 스텁도 정리한다.
ysw789 and others added 3 commits October 22, 2026 19:21
앱 업장 일정 조회가 본인 범위 쿼리로 바뀌면서 findByWorkspaceAndDateRange 호출처가 사라졌다.
사용자 범위 없이 업장 전체 일정을 돌려주는 메서드라 남겨두면 재사용 시 같은 노출이 재발할 수 있어
포트·구현에서 지우고 테스트의 관련 스텁도 정리한다.
응답이 본인에게 배정된 확정 근무만 담도록 바뀌었는데 schedules 설명이 아직 "업장 전체 스케줄 목록"이라
클라이언트가 동료 일정을 기대할 수 있어 실제 동작에 맞춘다.
@hodoon
hodoon marked this pull request as ready for review November 4, 2026 10:34
@hodoon
hodoon merged commit 2008032 into dev Nov 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants