Commit Graph

12 Commits

Author SHA1 Message Date
浅念 43de31ffda docs: p1a completion markers in plan and master roadmap
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-18 00:14:23 +08:00
浅念 8a09001525 docs: p1a acceptance record
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-18 00:06:44 +08:00
浅念 368b1d5b47 feat(api): argon2 password, idempotent admin seed, api-exception infra
Task 12 + Task 7 quality-review carryovers:

Part A - password hashing & controlled initial admin:
- src/auth/password.ts: hashPassword/verifyPassword over @node-rs/argon2
  (napi prebuilt, argon2id default); empty plain rejected at the door
- src/scripts/seed-admin.ts: idempotent admin seed (ADMIN_ACCOUNT/
  ADMIN_PASSWORD env, walk-up root .env load); existing account -> skip,
  never overwrites the password; no audit_logs (system op, no actor)
- pnpm seed script (build + node dist/scripts/seed-admin.js);
  .env.example dev defaults admin/admin-secret-change-me
- tests: test/password.spec.ts (5), test/seed.spec.ts real-DB idempotency (4)

Part B - Task 7 carryovers (all 8):
- ApiException(apiCode, message, httpStatus, details?) recognized first by
  the filter; unmapped-status rule: >=500 -> INTERNAL_ERROR + generic
  message, <500 -> VALIDATION_FAILED keeping original status (warn-logged)
- 5xx/INTERNAL_ERROR responses forced to generic message (leak fix)
- pino redact adds req.headers.cookie / res.headers.set-cookie
- x-request-id echo capped at 128 chars (fresh UUID beyond, no log)
- LOG_LEVEL validated against pino levels at module wiring -> fail fast
- shared/ constants (API_PREFIX), request-with-id, log-level (+spec)
- jest ts-jest reuses tsconfig.json; unit testMatch includes test/*.spec.ts
- build:watch script (no concurrently dep; dev = build:watch + node --watch)

api: 35 unit + 10 e2e tests green; root lint/typecheck/test green.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 20:54:30 +08:00
浅念 a99b8f200b feat(api): album domain schema
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 20:05:09 +08:00
浅念 7d250ec342 feat(api): cn-app skeleton, toolchain, env loading convention
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 19:14:41 +08:00
浅念 f77ab5ae4b feat(contracts): outbox event contract types
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 18:18:06 +08:00
浅念 f6448bd006 fix(contracts): quality review fixes for p1a contracts
- status enum active|archived -> active|offline (align requirement docs)
- UploadSessionState session-state semantics documented (no failed state)
- maxLength: clientTaskId 128 / filename 255 / cursor 512
- PublicPhoto width/height required (layout placeholders)
- reusable Unauthorized/InternalError responses (hybrid with inline op-specific codes)
- PublicAlbum.translations -> translation (single resolved object)
- contentType enum [jpeg/png/heic] (heic provisional pending G2)
- minLength 1 on title/name; publicToken pattern ^[0-9a-z]{20,32}$
- CursorPageMeta hasMore/nextCursor invariant documented
- public locale: silent fallback to defaultLocale (tech doc section 11)
- plan: upload_sessions state comment aligned; P1b adds management photo list + account lookup endpoints

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 18:06:54 +08:00
浅念 1dae00eaef feat(contracts): p1a endpoint contracts
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 17:31:11 +08:00
浅念 9dc530feaf docs(plan): record M0 completion (tasks 1-3, port conflict resolution, quay.io deviation)
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 16:50:43 +08:00
浅念 538fdd46dd chore(infra): cn-side mysql/redis/minio compose
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 16:46:40 +08:00
浅念 68a7d6a6d4 chore: pnpm workspace and turbo pipeline
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 16:24:12 +08:00
浅念 d973c714f0 chore: init repository skeleton
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-17 16:13:49 +08:00