Conversation
[๐ Audit] /api/* ๊ฒฝ๋ก๊ฐ middleware ์ธ์ฆ ๊ฐ๋๋ฅผ ํ์ง ์๋ ๊ตฌ์กฐ์์ ๋ชฉ๋ก API๊ฐ ์์ฒด ๊ถํ ๊ฒฝ๊ณ๋ฅผ ์ฑ ์ํ๋๋ก ์ ๋ฆฌ ๋น๋ก๊ทธ์ธ ์ง์ API ์์ฒญ์ด query viewerId๋ก ํ์ธ์ ๊ฐ์ธํ ์กฐํ์ ์ปจํ ์คํธ๋ฅผ ํ๋ด๋ผ ์ ์๋ ๊ฒฝ๋ก ์ฐจ๋จ Cloudflare webhook secret ๋๋ฝ ์ production์์ ๊ฒ์ฆ์ ๊ฑด๋๋ธ ์ ์๋ fail-open ๊ฐ๋ฅ์ฑ ์ฐจ๋จ Stream/VOD ๊ฐ์ธํ ์๋ต์ query key๊ฐ ์ถฉ๋ถํ ๊ตฌ๋ถํ์ง ๋ชปํ๋ ์บ์ ์ ํฉ์ฑ ๋ณด๊ฐ [๐ฅ Stream] ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ ๋ชฉ๋ก API์ viewerId query fallback ์ ๊ฑฐ ๋ชฉ๋ก ์กฐํ ๊ถํ ๊ธฐ์ค์ ์๋ฒ ์ธ์ ID๋ก ๊ณ ์ ๋น๋ก๊ทธ์ธ ๋ชฉ๋ก API ์ง์ ํธ์ถ ์ ๋น ๋ชฉ๋ก์ผ๋ก ์ข ๋ฃ Server Action ๋ชฉ๋ก ์กฐํ๋ ์ธ์ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ query key์ viewerId์ ํ๋ก์ ํํฐ ๋ฐ์ ํ๋ก์ฐ ์งํ ๊ธฐ๋ณธ ํ๋ก์ ์คํธ๋ฆผ cache seed key๋ฅผ ์กฐํ์๋ณ key์ ์ผ์น์ํด [โ๏ธ Webhook] Cloudflare Stream webhook secret ๋๋ฝ ์ production fail-closed ์ฒ๋ฆฌ Cloudflare Destination webhook secret ๋๋ฝ ์ production fail-closed ์ฒ๋ฆฌ ํธ๋์ ฐ์ดํฌ์ ๋น body ์์ฒญ์ ์ํ ๋ณ๊ฒฝ ์์ด ๊ธฐ์กด ํต๊ณผ ์ ์ฑ ์ ์ง secret ๋๋ฝ ์ ์ฑ ์ webhookAuth ์ ํธ๋ก ๋ถ๋ฆฌ [โ๏ธ Test] ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ ๋ชฉ๋ก API viewerId spoof ํ๊ท ํ ์คํธ ์ถ๊ฐ ์ธ์ ์ด ์์ ๋ query viewerId๋ณด๋ค session ID๊ฐ ์ฐ์ ๋๋์ง ๊ฒ์ฆ production webhook secret ๋๋ฝ ์ DB ๊ฐฑ์ ๊ณผ Realtime ์ก์ ์ด ์์๋์ง ์๋์ง ๊ฒ์ฆ webhook secret ์ ์ฑ ์ ํธ ํ ์คํธ ์ถ๊ฐ [โ Verification] ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ ๋ชฉ๋ก API์ ๋น๋ก๊ทธ์ธ ๊ณต๊ฐ ์๋น์ฒ๊ฐ ์์์ grep์ผ๋ก ํ์ธ npx tsc --noEmit npm run lint npm run test # 23 files / 107 tests npm run build npm run test:e2e # 7 passed / 19 skipped git diff --check
[๐ Audit] - /api/* ๊ฒฝ๋ก๊ฐ middleware ์ธ์ฆ ๊ฐ๋๋ฅผ ํ์ง ์๋ ๊ตฌ์กฐ์์ ๋ชฉ๋ก API๊ฐ ์์ฒด ๊ถํ ๊ฒฝ๊ณ๋ฅผ ์ฑ ์ํ๋๋ก ์ ๋ฆฌ - ๋น๋ก๊ทธ์ธ ์ง์ API ์์ฒญ์ด query viewerId๋ก ํ์ธ์ ๊ฐ์ธํ ์กฐํ์ ์ปจํ ์คํธ๋ฅผ ํ๋ด๋ผ ์ ์๋ ๊ฒฝ๋ก ์ฐจ๋จ - Cloudflare webhook secret ๋๋ฝ ์ production์์ ๊ฒ์ฆ์ ๊ฑด๋๋ธ ์ ์๋ fail-open ๊ฐ๋ฅ์ฑ ์ฐจ๋จ - Stream/VOD ๊ฐ์ธํ ์๋ต์ query key๊ฐ ์ถฉ๋ถํ ๊ตฌ๋ถํ์ง ๋ชปํ๋ ์บ์ ์ ํฉ์ฑ ๋ณด๊ฐ [๐ฅ Stream] - ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ ๋ชฉ๋ก API์ viewerId query fallback ์ ๊ฑฐ - ๋ชฉ๋ก ์กฐํ ๊ถํ ๊ธฐ์ค์ ์๋ฒ ์ธ์ ID๋ก ๊ณ ์ - ๋น๋ก๊ทธ์ธ ๋ชฉ๋ก API ์ง์ ํธ์ถ ์ ๋น ๋ชฉ๋ก์ผ๋ก ์ข ๋ฃ - Server Action ๋ชฉ๋ก ์กฐํ๋ ์ธ์ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ - ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ query key์ viewerId์ ํ๋ก์ ํํฐ ๋ฐ์ - ํ๋ก์ฐ ์งํ ๊ธฐ๋ณธ ํ๋ก์ ์คํธ๋ฆผ cache seed key๋ฅผ ์กฐํ์๋ณ key์ ์ผ์น์ํด [โ๏ธ Webhook] - Cloudflare Stream webhook secret ๋๋ฝ ์ production fail-closed ์ฒ๋ฆฌ - Cloudflare Destination webhook secret ๋๋ฝ ์ production fail-closed ์ฒ๋ฆฌ - ํธ๋์ ฐ์ดํฌ์ ๋น body ์์ฒญ์ ์ํ ๋ณ๊ฒฝ ์์ด ๊ธฐ์กด ํต๊ณผ ์ ์ฑ ์ ์ง - secret ๋๋ฝ ์ ์ฑ ์ webhookAuth ์ ํธ๋ก ๋ถ๋ฆฌ [โ๏ธ Test] - ์คํธ๋ฆผ/๋ค์๋ณด๊ธฐ ๋ชฉ๋ก API viewerId spoof ํ๊ท ํ ์คํธ ์ถ๊ฐ - ์ธ์ ์ด ์์ ๋ query viewerId๋ณด๋ค session ID๊ฐ ์ฐ์ ๋๋์ง ๊ฒ์ฆ - production webhook secret ๋๋ฝ ์ DB ๊ฐฑ์ ๊ณผ Realtime ์ก์ ์ด ์์๋์ง ์๋์ง ๊ฒ์ฆ webhook secret ์ ์ฑ ์ ํธ ํ ์คํธ ์ถ๊ฐ [โ Verification] - npx tsc --noEmit - npm run lint - npm run test # 23 files / 107 tests - npm run build - npm run test:e2e # 7 passed / 19 skipped - git diff --check
- [๐ README] - ์ฒซ ํ๋ฉด์ Key Engineering Problems ์น์ ์ถ๊ฐ - ๋ํ ๋ฌธ์ ํด๊ฒฐ ์ฌ๋ก๋ฅผ ์ฆ์/ํด๊ฒฐ ๋ฐฉํฅ/๋ฌธ์ ๋งํฌ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ - Demo ์๋ค ํ๋ฆ์ ์๋น์ค ์๊ฐ, ํต์ฌ ๋ฌธ์ , ๋ฐ๋ชจ, Feature Flow ์์๋ก ์ฌ๋ฐฐ์น - Recommended Reading์ ํต์ฌ ์ค๊ณ์ ํธ๋ฌ๋ธ์ํ ๋ฌธ์ ์ค์ฌ์ผ๋ก ์ ๋ฆฌ - [๐ก๏ธ Access Control] - ๊ถํ / ์ ๊ทผ ์ ์ด ๋งคํธ๋ฆญ์ค ๋ฌธ์ ์ถ๊ฐ - ํ์ด์ง, Route Handler, Server Action, service ๊ณ์ธต์ ๋ณดํธ ๊ธฐ์ค ์ ๋ฆฌ - ๋๋ฉ์ธ๋ณ ์ฃผ์ ํ์์ ๋ํ ๊ถํ ๊ฐ๋ ์ ๋ฆฌ - Webhook secret ๋๋ฝ ์ production fail-closed ์์น ๋ฌธ์ํ - [๐ Docs Index] - docs ์ถ์ฒ ์ฝ๋ ์์๋ฅผ ํ๋ก์ ํธ ๊ฐ์์ ํต์ฌ ๋ฌธ์ ํด๊ฒฐ ์ฌ๋ก ์ค์ฌ์ผ๋ก ์ ๋ฆฌ - ๊ถํ ๋งคํธ๋ฆญ์ค์ PWA Push ๋ฌธ์๋ฅผ ์ถ๊ฐ ์ฌ๋ก๋ก ์ฐ๊ฒฐ - [โ Verification] - git diff --check
- [๐ README] - ์ฒซ ํ๋ฉด์ Key Engineering Problems ์น์ ์ถ๊ฐ - ๋ํ ๋ฌธ์ ํด๊ฒฐ ์ฌ๋ก๋ฅผ ์ฆ์/ํด๊ฒฐ ๋ฐฉํฅ/๋ฌธ์ ๋งํฌ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ - Demo ์๋ค ํ๋ฆ์ ์๋น์ค ์๊ฐ, ํต์ฌ ๋ฌธ์ , ๋ฐ๋ชจ, Feature Flow ์์๋ก ์ฌ๋ฐฐ์น - Recommended Reading์ ํต์ฌ ์ค๊ณ์ ํธ๋ฌ๋ธ์ํ ๋ฌธ์ ์ค์ฌ์ผ๋ก ์ ๋ฆฌ - [๐ก๏ธ Access Control] - ๊ถํ / ์ ๊ทผ ์ ์ด ๋งคํธ๋ฆญ์ค ๋ฌธ์ ์ถ๊ฐ - ํ์ด์ง, Route Handler, Server Action, service ๊ณ์ธต์ ๋ณดํธ ๊ธฐ์ค ์ ๋ฆฌ - ๋๋ฉ์ธ๋ณ ์ฃผ์ ํ์์ ๋ํ ๊ถํ ๊ฐ๋ ์ ๋ฆฌ - Webhook secret ๋๋ฝ ์ production fail-closed ์์น ๋ฌธ์ํ - [๐ Docs Index] - docs ์ถ์ฒ ์ฝ๋ ์์๋ฅผ ํ๋ก์ ํธ ๊ฐ์์ ํต์ฌ ๋ฌธ์ ํด๊ฒฐ ์ฌ๋ก ์ค์ฌ์ผ๋ก ์ ๋ฆฌ - ๊ถํ ๋งคํธ๋ฆญ์ค์ PWA Push ๋ฌธ์๋ฅผ ์ถ๊ฐ ์ฌ๋ก๋ก ์ฐ๊ฒฐ - [โ Verification] - git diff --check
[๐ฌ Chat] ์ฑํ ์ฝ์ ์๋ฝ ํ ํ์ ์ํ์ ์ํ ์์ฝ ์ํ ์ ์ง ๊ฒ์ฆ ์๋ฝ ํ ์๋ก๊ณ ์นจ๊ณผ ์ํ ๋ชฉ๋ก/์์ธ ์ง์ ์์๋ ์์ฝ ์ํ ํ์ธ [๐๏ธ Product] ์ํ ๋ชฉ๋ก์์ ๋ชจ๋ฌ ์์ธ ์ง์ ํ ์์ ์ ์ฅ ๊ฒ์ฆ ์์ ํ ์๋ ๋ชฉ๋ก ๊ฒ์ ๋ฌธ๋งฅ ๋ณต๊ท์ ๋ณ๊ฒฝ ๋ด์ฉ ๋ฐ์ ํ์ธ [๐ฅ Stream] ํ๋ก์ฐ ํ ํ๋ก์ ์ ์ฉ VOD ์ ๊ธ ํด์ ๊ฒ์ฆ ํ๋ก์ ๋ชฉ๋ก ๋ ธ์ถ๊ณผ VOD ์์ธ ์ ๊ทผ๊น์ง ์ด์ด์ง๋ ์ํ ์๋ ด ํ์ธ [๐งช E2E Seed] ์ฝ์ ์๋ฝ ์ํ ์ํ ๋ณต์ seed ๋ณด๊ฐ ๋ชจ๋ฌ ์์ ์ํ๊ณผ ํ๋ก์ ์ ์ฉ VOD seed ์ถ๊ฐ E2E ๊ณ์ ๊ฐ follow ๊ด๊ณ cleanup ์ถ๊ฐ ์ํ ๋ณ๊ฒฝํ E2E ๋ถ๋ฆฌ ์คํ ์ seed ์ฌ์คํ ๊ธฐ์ค ๋ฌธ์ํ [โ Verification] git diff --check npx tsc --noEmit npm run lint npm run test # 23 files / 107 tests E2E_SEEDED=1 npm run test:e2e -- tests/e2e/chat-appointment.spec.ts tests/e2e/product-modal-edit.spec.ts tests/e2e/stream-follow-access.spec.ts --project=chromium # 3 passed E2E_SEEDED=1 npm run test:e2e -- --project=chromium # 28 passed npm run cleanup:e2e
[๐ฌ Chat] - ์ฑํ ์ฝ์ ์๋ฝ ํ ํ์ ์ํ์ ์ํ ์์ฝ ์ํ ์ ์ง ๊ฒ์ฆ - ์๋ฝ ํ ์๋ก๊ณ ์นจ๊ณผ ์ํ ๋ชฉ๋ก/์์ธ ์ง์ ์์๋ ์์ฝ ์ํ ํ์ธ [๐๏ธ Product] - ์ํ ๋ชฉ๋ก์์ ๋ชจ๋ฌ ์์ธ ์ง์ ํ ์์ ์ ์ฅ ๊ฒ์ฆ - ์์ ํ ์๋ ๋ชฉ๋ก ๊ฒ์ ๋ฌธ๋งฅ ๋ณต๊ท์ ๋ณ๊ฒฝ ๋ด์ฉ ๋ฐ์ ํ์ธ [๐ฅ Stream] - ํ๋ก์ฐ ํ ํ๋ก์ ์ ์ฉ VOD ์ ๊ธ ํด์ ๊ฒ์ฆ - ํ๋ก์ ๋ชฉ๋ก ๋ ธ์ถ๊ณผ VOD ์์ธ ์ ๊ทผ๊น์ง ์ด์ด์ง๋ ์ํ ์๋ ด ํ์ธ [๐งช E2E Seed] - ์ฝ์ ์๋ฝ ์ํ ์ํ ๋ณต์ seed ๋ณด๊ฐ - ๋ชจ๋ฌ ์์ ์ํ๊ณผ ํ๋ก์ ์ ์ฉ VOD seed ์ถ๊ฐ - E2E ๊ณ์ ๊ฐ follow ๊ด๊ณ cleanup ์ถ๊ฐ - ์ํ ๋ณ๊ฒฝํ E2E ๋ถ๋ฆฌ ์คํ ์ seed ์ฌ์คํ ๊ธฐ์ค ๋ฌธ์ํ [โ Verification] - git diff --check - npx tsc --noEmit - npm run lint - npm run test # 23 files / 107 tests - E2E_SEEDED=1 npm run test:e2e -- tests/e2e/chat-appointment.spec.ts tests/e2e/product-modal-edit.spec.ts tests/e2e/stream-follow-access.spec.ts --project=chromium # 3 passed - E2E_SEEDED=1 npm run test:e2e -- --project=chromium # 28 passed - npm run cleanup:e2e"
[๐ Auth / Rate Limit] - SMS ์ธ์ฆ๋ฒํธ TTL ์ถ๊ฐ - SMS ์ฌ์ ์ก ์ฟจ๋ค์ด๊ณผ IP ๊ธฐ์ค ๋ฐ์ก ์์ฒญ ์ ํ ์ถ๊ฐ - ํ์๊ฐ์ ์ ์ถ IP ๊ธฐ์ค ๋จ๊ธฐ ์ ํ ์ถ๊ฐ - rate limit ์๋ณ์๋ RATE_LIMIT_SALT ๊ธฐ๋ฐ HMAC hash๋ก ์ ์ฅ - kind/keyHash ๋จ์ advisory lock์ผ๋ก rate limit ๊ธฐ๋ก ๊ฒฝํฉ ์ง๋ ฌํ [๐ฑ SMS] - ๋ก๊ทธ์ธ SMS ํ ํฐ ๊ต์ฒด๋ฅผ ์กฐ๊ฑด๋ถ updateMany ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ - provider ์คํจ ์ ๊ธฐ์กด ํ ํฐ ๋ณต๊ตฌ ๋๋ ์ ๊ท ํ ํฐ ์ญ์ - ๋ง๋ฃ๋ SMS ์ธ์ฆ๋ฒํธ ๊ฒ์ฆ ๊ฑฐ์ ๋ฐ ์ง์ฐ ์ ๋ฆฌ - ํ๋กํ ์ ํ๋ฒํธ ์ธ์ฆ์๋ ๋์ผํ TTL/์ฟจ๋ค์ด/IP ์ ํ/์คํจ ๋ณต๊ตฌ ์ ์ฑ ์ ์ฉ [โ๏ธ Upload] - Cloudflare Images direct upload URL ๋ฐ๊ธ ์ ์ธ์ ํ์ธ - ์ฌ์ฉ์ ์ํ ๊ฒ์ฆ ํ Cloudflare API ํธ์ถ - ๋น๋ก๊ทธ์ธ/์ ์ง ์ฌ์ฉ์ upload URL ๋ฐ๊ธ ๊ฑฐ์ ํ ์คํธ ์ถ๊ฐ [๐๏ธ Database] - SMSToken expires_at ์ถ๊ฐ ๋ฐ ๊ธฐ์กด ํ ํฐ ๋ง๋ฃ ์๊ฐ backfill - AuthRateLimitEvent ๋ชจ๋ธ ์ถ๊ฐ - rate limit ์กฐํ/cleanup์ฉ ๋ณตํฉ ์ธ๋ฑ์ค ์ถ๊ฐ [๐ Docs] - .env.example ์ถ๊ฐ - README ํ์ ํ๊ฒฝ๋ณ์ ํ ์ ๋ฆฌ - Rate Limit ์ด์ ์ ์ฑ ๋ฌธ์ ์ถ๊ฐ - ๊ถํ ๋งคํธ๋ฆญ์ค์ docs ์ธ๋ฑ์ค์ rate limit ๋ฌธ์ ์ฐ๊ฒฐ [โ๏ธ Test] - SMS TTL/์ฟจ๋ค์ด/IP ์ ํ/๋์ ์์ฒญ/rollback ํ๊ท ํ ์คํธ ์ถ๊ฐ - ํ๋กํ ์ ํ๋ฒํธ SMS ๋ณดํธ ํ๊ท ํ ์คํธ ์ถ๊ฐ - rate limit hash/advisory lock ํ ์คํธ ์ถ๊ฐ - Cloudflare Images upload URL ์ธ์ฆ ๊ฒฝ๊ณ ํ ์คํธ ์ถ๊ฐ [โ Verification] - npx prisma migrate dev - npx prisma generate - git diff --check - npm run lint - npm run test # 27 files / 125 tests - npx tsc --noEmit - npm run build - npx prisma validate
[๐ Auth / Rate Limit] - SMS ์ธ์ฆ๋ฒํธ TTL ์ถ๊ฐ - SMS ์ฌ์ ์ก ์ฟจ๋ค์ด๊ณผ IP ๊ธฐ์ค ๋ฐ์ก ์์ฒญ ์ ํ ์ถ๊ฐ - ํ์๊ฐ์ ์ ์ถ IP ๊ธฐ์ค ๋จ๊ธฐ ์ ํ ์ถ๊ฐ - rate limit ์๋ณ์๋ RATE_LIMIT_SALT ๊ธฐ๋ฐ HMAC hash๋ก ์ ์ฅ - kind/keyHash ๋จ์ advisory lock์ผ๋ก rate limit ๊ธฐ๋ก ๊ฒฝํฉ ์ง๋ ฌํ [๐ฑ SMS] - ๋ก๊ทธ์ธ SMS ํ ํฐ ๊ต์ฒด๋ฅผ ์กฐ๊ฑด๋ถ updateMany ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ - provider ์คํจ ์ ๊ธฐ์กด ํ ํฐ ๋ณต๊ตฌ ๋๋ ์ ๊ท ํ ํฐ ์ญ์ - ๋ง๋ฃ๋ SMS ์ธ์ฆ๋ฒํธ ๊ฒ์ฆ ๊ฑฐ์ ๋ฐ ์ง์ฐ ์ ๋ฆฌ - ํ๋กํ ์ ํ๋ฒํธ ์ธ์ฆ์๋ ๋์ผํ TTL/์ฟจ๋ค์ด/IP ์ ํ/์คํจ ๋ณต๊ตฌ ์ ์ฑ ์ ์ฉ [โ๏ธ Upload] - Cloudflare Images direct upload URL ๋ฐ๊ธ ์ ์ธ์ ํ์ธ - ์ฌ์ฉ์ ์ํ ๊ฒ์ฆ ํ Cloudflare API ํธ์ถ - ๋น๋ก๊ทธ์ธ/์ ์ง ์ฌ์ฉ์ upload URL ๋ฐ๊ธ ๊ฑฐ์ ํ ์คํธ ์ถ๊ฐ [๐๏ธ Database] - SMSToken expires_at ์ถ๊ฐ ๋ฐ ๊ธฐ์กด ํ ํฐ ๋ง๋ฃ ์๊ฐ backfill - AuthRateLimitEvent ๋ชจ๋ธ ์ถ๊ฐ - rate limit ์กฐํ/cleanup์ฉ ๋ณตํฉ ์ธ๋ฑ์ค ์ถ๊ฐ [๐ Docs] - .env.example ์ถ๊ฐ - README ํ์ ํ๊ฒฝ๋ณ์ ํ ์ ๋ฆฌ - Rate Limit ์ด์ ์ ์ฑ ๋ฌธ์ ์ถ๊ฐ - ๊ถํ ๋งคํธ๋ฆญ์ค์ docs ์ธ๋ฑ์ค์ rate limit ๋ฌธ์ ์ฐ๊ฒฐ [โ๏ธ Test] - SMS TTL/์ฟจ๋ค์ด/IP ์ ํ/๋์ ์์ฒญ/rollback ํ๊ท ํ ์คํธ ์ถ๊ฐ - ํ๋กํ ์ ํ๋ฒํธ SMS ๋ณดํธ ํ๊ท ํ ์คํธ ์ถ๊ฐ - rate limit hash/advisory lock ํ ์คํธ ์ถ๊ฐ - Cloudflare Images upload URL ์ธ์ฆ ๊ฒฝ๊ณ ํ ์คํธ ์ถ๊ฐ [โ Verification] - npx prisma migrate dev - npx prisma generate - git diff --check - npm run lint - npm run test # 27 files / 125 tests - npx tsc --noEmit - npm run build - npx prisma validate
[๐ฑ SMS] - SMS ๋ก๊ทธ์ธ ํ ํฐ์ด ์ธ์ฆ ์ User.phone์ ์ ์ ํ์ง ์๋๋ก ์ ๋ฆฌ - SMS ๋ก๊ทธ์ธ ํ ํฐ๊ณผ ํ๋กํ ์ ํ๋ฒํธ ์ธ์ฆ ํ ํฐ์ userId ๋ชฉ์ ๋ถ๋ฆฌ - ํ๋กํ ์ธ์ฆ ํ ํฐ์ด SMS ๋ก๊ทธ์ธ ๊ฒ์ฆ์์ ์๋น๋์ง ์๋๋ก ์ฐจ๋จ - ๋ก๊ทธ์ธ SMS ๋ฐ์ก ์คํจ ์ ์ด์ ํ ํฐ์ userId๊น์ง ์กฐ๊ฑด๋ถ ๋ณต๊ตฌ [๐๏ธ Database] - SMSToken.userId nullable ์ ํ migration ์ถ๊ฐ - ๋ก๊ทธ์ธ SMS ํ ํฐ์ userId ์์ด ์ ์ฅํ๊ณ , ๊ฒ์ฆ ์ฑ๊ณต ์ ์ ํ๋ฒํธ ๊ธฐ์ค User๋ฅผ ์กฐํ ๋๋ ์์ฑ [๐ Rate Limit] - ์ค๋๋ rate limit ๊ธฐ๋ก ์ญ์ ๋ฅผ advisory lock transaction ๋ฐ์ผ๋ก ๋ถ๋ฆฌ - PostgreSQL transaction ๋ด๋ถ ์ญ์ ์คํจ๊ฐ ์ดํ ์กฐํ/๊ธฐ๋ก์ ์ํฅ์ ์ฃผ์ง ์๋๋ก ์ ๋ฆฌ - rate limit ํ๋จ transaction์ lock, ์ต๊ทผ ์์ฒญ ์กฐํ, ํ์ฌ ์์ฒญ ๊ธฐ๋ก๋ง ์ํํ๋๋ก ๋จ์ํ [โ๏ธ Test] - SMS ์ธ์ฆ ์ User ์์ฑ ๋ฐฉ์ง ํ๊ท ํ ์คํธ ์ถ๊ฐ - ํ๋กํ ํ ํฐ userId ์์กด ๋ฐ ๋ก๊ทธ์ธ ๋ชฉ์ ํผ์ฉ ๋ฐฉ์ง ํ ์คํธ ์ถ๊ฐ - SMS ๋ฐ์ก ์คํจ rollback ํ๊ท ํ ์คํธ ๋ณด๊ฐ [โ Verification] - npx prisma generate - npm run test -- features/auth/service/sms.test.ts features/auth/service/rateLimit.test.ts features/user/service/phone.test.ts - npx tsc --noEmit - npm run lint - npm run test - npx prisma validate - git diff --check
[๐ฑ SMS] - SMS ๋ก๊ทธ์ธ ํ ํฐ์ด ์ธ์ฆ ์ User.phone์ ์ ์ ํ์ง ์๋๋ก ์ ๋ฆฌ - SMS ๋ก๊ทธ์ธ ํ ํฐ๊ณผ ํ๋กํ ์ ํ๋ฒํธ ์ธ์ฆ ํ ํฐ์ userId ๋ชฉ์ ๋ถ๋ฆฌ - ํ๋กํ ์ธ์ฆ ํ ํฐ์ด SMS ๋ก๊ทธ์ธ ๊ฒ์ฆ์์ ์๋น๋์ง ์๋๋ก ์ฐจ๋จ - ๋ก๊ทธ์ธ SMS ๋ฐ์ก ์คํจ ์ ์ด์ ํ ํฐ์ userId๊น์ง ์กฐ๊ฑด๋ถ ๋ณต๊ตฌ [๐๏ธ Database] - SMSToken.userId nullable ์ ํ migration ์ถ๊ฐ - ๋ก๊ทธ์ธ SMS ํ ํฐ์ userId ์์ด ์ ์ฅํ๊ณ , ๊ฒ์ฆ ์ฑ๊ณต ์ ์ ํ๋ฒํธ ๊ธฐ์ค User๋ฅผ ์กฐํ ๋๋ ์์ฑ [๐ Rate Limit] - ์ค๋๋ rate limit ๊ธฐ๋ก ์ญ์ ๋ฅผ advisory lock transaction ๋ฐ์ผ๋ก ๋ถ๋ฆฌ - PostgreSQL transaction ๋ด๋ถ ์ญ์ ์คํจ๊ฐ ์ดํ ์กฐํ/๊ธฐ๋ก์ ์ํฅ์ ์ฃผ์ง ์๋๋ก ์ ๋ฆฌ - rate limit ํ๋จ transaction์ lock, ์ต๊ทผ ์์ฒญ ์กฐํ, ํ์ฌ ์์ฒญ ๊ธฐ๋ก๋ง ์ํํ๋๋ก ๋จ์ํ [โ๏ธ Test] - SMS ์ธ์ฆ ์ User ์์ฑ ๋ฐฉ์ง ํ๊ท ํ ์คํธ ์ถ๊ฐ - ํ๋กํ ํ ํฐ userId ์์กด ๋ฐ ๋ก๊ทธ์ธ ๋ชฉ์ ํผ์ฉ ๋ฐฉ์ง ํ ์คํธ ์ถ๊ฐ - SMS ๋ฐ์ก ์คํจ rollback ํ๊ท ํ ์คํธ ๋ณด๊ฐ [โ Verification] - npx prisma generate - npm run test -- features/auth/service/sms.test.ts features/auth/service/rateLimit.test.ts features/user/service/phone.test.ts - npx tsc --noEmit - npm run lint - npm run test - npx prisma validate - git diff --check
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
BoardPort v1.2.0 ๋ฆด๋ฆฌ์ฆ ์ดํ ํ์ธํ ์ ๊ทผ ๊ฒฝ๊ณ, ๋ฌธ์ ๊ตฌ์กฐ, ํต์ฌ E2E, ์ธ์ฆ rate limit, SMS ํ ํฐ ์์ ๊ถ ๊ฒฝ๊ณ๋ฅผ ์ ๋ฆฌํ ์์ ํ ํจ์น์ ๋๋ค.
์ด๋ฒ PR์ ์ ๊ท ๋ํ ๊ธฐ๋ฅ ์ถ๊ฐ๊ฐ ์๋๋ผ, ๋ฆด๋ฆฌ์ฆ ํ ์ฝ๋ ๊ฐ์ฌ์ QA ๊ณผ์ ์์ ํ์ธํ ์ด์ ์์ ์ฑยท๋ณด์ ๊ฒฝ๊ณยท๊ฒ์ฆ ์ปค๋ฒ๋ฆฌ์ง๋ฅผ ๋ณด๊ฐํ๋ ์์ ์ ๋๋ค.
Changes
[๐ Access Boundary]
[๐ Docs]
[โ๏ธ E2E]
[๐ Auth / Rate Limit]
[๐ฑ SMS]
[โ๏ธ Upload]
[๐๏ธ Database / Env]
Verification
npm run testnpm run test:e2enpm run buildnpx prisma validategit diff --checkDeployment Notes
RATE_LIMIT_SALT๊ฐ ๋ฑ๋ก๋์ด ์์ต๋๋ค.