feat: Auth·Company 로그인 구현 및 DB 마이그레이션 정합성 보완#33
Merged
Conversation
검증된 JWT의 사용자, 사업장, 역할 정보를 ActorContext로 변환합니다. roles claim을 Spring Security 권한과 연결하고 HR 쓰기 권한 및 사업장 격리 검증을 추가합니다. 현재 인증 주체를 확인할 수 있도록 GET /api/v1/auth/me를 제공합니다.
실제 로그인으로 발급한 JWT를 사용해 ActorContext와 역할 권한을 검증합니다. VIEWER 쓰기 차단, 타 사업장 404 은닉, 변조 토큰과 company_id 주입 거부를 확인합니다. Refresh Token 원문 비저장과 사용자-사업장 복합 FK 무결성도 통합 테스트합니다.
Bearer JWT 보안 스키마와 로그인 및 현재 사용자 API 계약을 Swagger에 반영합니다. Refresh Token 쿠키, 로그인 전용 오류, 요청·응답 필드와 snake_case 계약을 명시합니다. 생성된 OpenAPI JSON을 검증하는 계약 테스트와 초보자용 README 흐름을 추가합니다.
main의 중복 V2와 flyway.target 우회를 제거했습니다. Auth 전용 V2와 PostgreSQL migration 검증을 ADR-0001/0002 기준으로 통합했습니다. PR #32의 V2가 persistent shared DB에 적용되지 않았다는 전제이며, 이미 적용된 환경은 DB 재생성 또는 별도 forward migration이 필요합니다.
Migration이 소유 Issue의 aggregate만 생성하도록 규칙을 명확히 했습니다. RLS 도입 전 필요한 DB Role, tenant bootstrap, transaction context와 connection pool 검증 조건을 문서화했습니다.
Contributor
Author
|
RLS는 로그인/공개 링크 bootstrap과 connection pool 격리까지 설계·검증한 뒤 별도 ADR과 migration으로 도입합니다. |
36 tasks
hywznn
marked this pull request as ready for review
July 22, 2026 09:54
26 tasks
This was referenced Jul 23, 2026
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.
왜 필요한가요?
PR #32가 추가한 통합
V2는 Auth·Company뿐 아니라 Worker·Task·Ticket·Document까지 한 migration에서 생성하여 ADR-0001의 모듈 소유권과 예약 순서(V2 = #4,V3 = #5)에 충돌했습니다.또한 local/test의
flyway.target: 1이 최신 migration과 JPA schema validation을 건너뛰어 실제 불일치를 숨기고 있었습니다.무엇이 바뀌나요?
company,user_account,refresh_token만 포함한 Auth 전용V2__create_auth_company.sql을 canonical migration으로 유지했습니다.V2__create_fowoco_schema.sql과flyway.target: 1우회를 제거했습니다.main의 Dockerfile 변경도 merge했습니다.사용자·개발 영향
user_id,company_id,roles로ActorContext를 구성합니다.ActorContext + company_id 범위 Repository + tenant-aware DB 제약을 기준으로 합니다.검증
./gradlew clean test— 성공./gradlew build -x test— 성공Migration 전제와 롤백
GitHub Deployment 기록이 없고 PR #32 직후 교정하는 초기 단계이므로, 해당 V2가 staging/demo/공유 persistent DB에는 적용되지 않았다는 전제로 잘못된 초기 V2를 교체했습니다. GitHub Actions의 일회성 PostgreSQL은 공유 DB로 간주하지 않습니다.
만약 누군가 PR #32의 V2를 persistent DB에 수동 적용했다면 이 PR을 그대로 배포하면 안 됩니다. 그 환경은 보존 데이터 여부를 확인한 뒤 DB를 재생성하거나 별도의 forward-only 데이터 이전 migration을 설계해야 하며, checksum 차이를
flyway repair로 숨기지 않습니다.