feat: 프로필 부가 정보(로그인 이력·보안·알림 설정) 실데이터화 - #174
Open
BcKmini wants to merge 2 commits into
Open
Conversation
ProfilePage에 표시되던 마지막 로그인 시각/기기, 계정 상태, 비밀번호 변경일, 업무 권한, 알림 수신 설정이 전부 profileData.ts의 고정값이었던 문제를 백엔드부터 해결한다. - user_login_event 테이블 신설, 로그인 성공 시 User-Agent 기반 기기 요약과 함께 기록. GET /auth/me/profile이 role/account_status/password_changed_at/ last_login_at/last_login_device/recent_device_count를 실제 값으로 반환. (last_login/work-context의 "담당 영역"·"문서 열람 범위"처럼 백엔드에 대응 개념이 아예 없는 항목은 만들어내지 않고 클라이언트에서 제거 예정) - user_account.password_changed_at 컬럼 추가, changePassword()에서 갱신. - notification_preference 테이블 + GET/PATCH /notifications/preferences 신설. 7개 알림 유형 기본값은 client의 기존 INITIAL_NOTIFICATION_PREFS와 동일하게 맞췄고, security-permission은 서버에서도 끌 수 없도록 강제. Part of the "no hardcoded profile data" cleanup requested after client#339. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
user_login_event/notification_preference 테이블이 새로 생겼는데 PostgreSqlRestrictedRoleHttpEnvironment의 TABLE_PRIVILEGES 허용목록에 반영이 안 돼 있었다. 이 목록은 실제 fowoco_runtime role 권한을 테스트용 role에 그대로 재현하는 용도라, 로그인 시 user_login_event에 INSERT하는 새 로직이 테스트 환경에서만 42501(insufficient_privilege)로 막혀 로그인 자체가 500으로 실패하고 있었다 (실제 프로덕션은 migration role의 ALTER DEFAULT PRIVILEGES로 자동 커버되어 영향 없음, 이 테스트 role만 수동 허용목록이라 별도 반영 필요). 로컬에서 Postgres 16 컨테이너로 4개 테스트 전부 통과 확인함.
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.
요약
user_login_event테이블 신설 — 로그인 성공 시 User-Agent 기반 기기 요약과 함께 기록.GET /auth/me/profile이role/account_status/password_changed_at/last_login_at/last_login_device/recent_device_count를 실제 값으로 반환.user_account.password_changed_at컬럼 추가,changePassword()에서 갱신.notification_preference테이블 +GET/PATCH /api/v1/notifications/preferences신설. 기본값 7종은 client의INITIAL_NOTIFICATION_PREFS와 동일하게 맞췄고security-permission은 서버에서도 끌 수 없도록 강제(422).테스트
./gradlew test전체: BUILD SUCCESSFULUserAgentDeviceSummarizerTest,AuthSecurityIntegrationTest#getMyProfileReflectsAccountStateAndRecordsLoginDeviceHistory,NotificationSecurityIntegrationTest의 알림 설정 조회/변경/필수항목 보호/사용자 간 격리 테스트Closes #173