Repository navigation
feat: 시드가 기본 테스트 계정(관리자·판매자)을 항상 만들도록 - #538
Conversation
- 로컬 관리자·판매자 테스트 때마다 비밀번호를 정해 .env에 넣던 단계를 없앰(사용자 결정). 관리자 admin, 판매자 seed-seller-a·b, 비밀번호 caquick1234! - 환경변수 ADMIN_SEED_USERNAME·ADMIN_SEED_PASSWORD·SELLER_SEED_PASSWORD 제거. 공개 레포지만 시드는 NODE_ENV=production에서 막히고 운영 DB는 외부 포트가 없어 운영 계정이 되지 않음(#304의 '레포에 비밀번호를 두지 않는다' 방침을 로컬 계정에 한해 변경) - credential-policy에 기본값 상수, admins·stores가 상수 사용(판매자 라벨에 아이디 항상 포함), README 한·영 환경변수 표에서 시드 행 삭제·설치 블록에 계정 안내 - 테스트 4건: 기본 계정 3개가 시드 정책·로그인 DTO 통과, 재시드해도 아이디가 겹치지 않고 기본 비밀번호로 검증. 반증: 시드를 env 방식으로 되돌리면 재시드 테스트 실패
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🧹 knip — dead-code 리포트전체 리포트
|
🩺 NestJS Doctor — 90/100 (Excellent)진단 487건 (error 13).
architecture / security 상위 항목
|
Coverage report
Test suite run success4303 tests passing in 387 suites. Report generated by 🧪jest coverage report action from ca61788 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
배경
.env에 넣고 시드를 돌려야 했습니다.admin, 판매자seed-seller-a·seed-seller-bcaquick1234!NODE_ENV=production에서 차단됩니다.변경
ADMIN_SEED_USERNAME·ADMIN_SEED_PASSWORD·SELLER_SEED_PASSWORD를 제거했습니다.prisma/seed/credential-policy.ts에 기본값 상수(SEED_PASSWORD,SEED_ADMIN_USERNAME)를 두고,admins.ts·stores.ts가 이 값을 씁니다.yarn prisma:seed줄에 테스트 계정을 적었습니다.테스트
src/test/seed-credential-policy.spec.ts: 기본 계정 3개가 시드 정책과 로그인 DTO(CredentialLoginInput)를 통과한다(3건).src/test/seed-reset-scope.spec.ts: 기본 테스트 계정을 만들고 재시드해도 아이디가 겹치지 않고, 기본 비밀번호로 검증되며 비밀번호 변경을 강제하지 않는다(1건).admins.ts·stores.ts를 env 방식으로 되돌리면 재시드 테스트가 실패하고(자격증명 없음), 적용하면 두 spec 23건이 모두 통과합니다.플랜 대조
docs-261015-234130-seed-default-credentials)admins.ts·stores.ts가 env 대신 상수 사용