Skip to content

Release v2.10.0 - #495

Merged
datvt243 merged 14 commits into
mainfrom
release/v2.10.0
Nov 19, 2026
Merged

datvt243 merged 14 commits into
mainfrom
release/v2.10.0

Conversation

@datvt243

Copy link
Copy Markdown
Owner

e134187 Merge pull request #494 from datvt243/chore/ship-note-email-auth-links
7035723 chore(agent-hub): ship note for email-auth-links
6e21b45 Merge pull request #493 from datvt243/feature/461-password-reset-email
32cbe39 feat(auth): email reset/verify links over SMTP instead of logging tokens
7e704be Merge pull request #492 from datvt243/chore/agent-hub-kit-e900251
1a808c3 chore(agent-hub): sync kit af32868 → e900251 (verifier on Sonnet, batched lookups, worker-runs rotation)
74a49b8 Merge pull request #491 from datvt243/fix/490-access-token-jti
df91bcc fix(auth): give every JWT a unique jti so same-second sessions don't collide
de5fd4f Merge pull request #489 from datvt243/chore/463-auth-integration-tests
f942b99 test(auth): add HTTP-level integration tests for the auth flow
33fcfb1 Merge pull request #488 from datvt243/refactor/459-hide-password-select
41df4ae refactor(candidate): hide password at schema level with select: false
b1ea2be Merge pull request #487 from datvt243/main
Closes #459.
Closes #461.
Closes #463.
Closes #490.

datvt243 and others added 14 commits November 17, 2026 16:18
chore: sync v2.9.0 back into staging
- models/candidate.model.ts: password gets select: false, so no query
  returns the hash unless it opts in
- auth/auth.service.ts: handlerLogin (only hash reader) opts in with
  .select('+password'); reset writes via updateOne, unchanged
- tests: login mocks chain .select and assert '+password'; new
  models/candidatePassword.test.ts asserts a plain findById() sends
  projection { password: 0 } (red without the fix)

npm test: Test Suites: 73 passed, 73 total; Tests: 784 passed, 784 total
npm run build: exit 0 (tsc typecheck); lint 274 = baseline, 0 new

Node: hide-password-select-false (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-18/hide-password-select-false-seal.md

Closes #459

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
refactor(candidate): hide password at schema level with select: false
- src/server.ts: extract the middleware chain into exported createApp(); startServer() and the unhandledRejection handler run only when the file is the entry point (require.main === module)
- src/__tests__/integration/auth.http.test.ts: supertest + mongodb-memory-server over the real chain (register/login/GET/refresh/logout with token rejected after; rotated refresh reuse after 10s grace revokes all sessions; cookie-only POST without CSRF -> 403; client candidateId ignored; unknown route -> 404 standard shape; Redis absent -> in-memory fallback)
- package.json/package-lock.json: dev deps supertest, @types/supertest, mongodb-memory-server
- CLAUDE.md: middleware order now lives in createApp

npm test: Test Suites: 74 passed, 74 total / Tests: 790 passed, 790 total
npm run build: exit 0 (tsc exit 0); lint 273 problems (<= 274 baseline), none new in changed files

Node: auth-http-integration-tests (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-18/auth-http-integration-tests-seal.md

Closes #463

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test(auth): add HTTP-level integration tests for the auth flow
…collide

Access tokens were signed with { _id } only, so two issued for one candidate in the same second were byte-identical and logging out one session blacklisted the other.

- src/utils/jwt.ts: jwtSign sets jwtid: crypto.randomUUID() on every token (access and refresh)
- src/auth/auth.service.ts, src/auth/auth.controller.ts: drop the hand-built refresh jti (jsonwebtoken rejects payload jti + jwtid) and the now-unused crypto import
- tests: new src/__tests__/utils/jwt.test.ts; integration test for two same-second logins where logout of one leaves the other at 200; caller unit tests and refreshTokenReuse helper adjusted
- .claude/rules/api.md: auth flow payload now { _id, jti }
- agent-hub: ship note for auth-http-integration-tests

npm test: Test Suites: 75 passed, 75 total / Tests: 792 passed, 792 total
npm run build: exit 0 (tsc exit 0); lint 273 problems (<= 274 baseline), none new in changed files

Node: fix-access-token-jti (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-18/fix-access-token-jti-seal.md

Closes #490

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fix(auth): give every JWT a unique jti so same-second sessions don't collide
…ched lookups, worker-runs rotation)

- agent-hub/: CLAUDE.md batch-lookup rule, verifier manifest reads
  evidence/README.md, verify_seal re-run scope / one-call reads /
  pointer cap / worker-runs rotation (13b), evidence README coverage-claim
  rule; PROJECT.md branch naming marked "kept over kit default"
  (operator approved); ship notes for fix-access-token-jti and
  hide-password-select-false (2026-11-18) left uncommitted by ship.sh
- .claude/skills/: hub-health grep/loop/report fixes, worker verifier on
  Sonnet, "Use when" descriptions, issues-ls description
- Kit mechanism only, no code — no node, no test run needed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
chore(agent-hub): sync kit af32868 → e900251 (verifier on Sonnet, batched lookups, worker-runs rotation)
Reset and verification links carried live tokens in logger.info, so anyone with log access could take over an account.

- src/services/mail.ts (new): sendAuthLinkEmail via Nodemailer SMTP (SMTP_HOST/PORT/USER/PASS, MAIL_FROM, APP_URL), plain text in the ?lang= language, 10s SMTP timeouts; SMTP_HOST or APP_URL unset -> dev logs the link, prod warns without it and sends nothing
- src/auth/auth.service.ts: register and forgot-password email the link fire-and-forget (no response-time difference for registered emails, a failed send keeps the generic response and is logged by message only); prod forgot-password logs only the candidate id
- src/locales/vi.ts, en.ts: mail subject/body strings
- src/utils/passwordReset.ts, emailVerification.ts, src/routers/api/v1/auth.route.ts: stale stub comments/summaries updated
- tests: auth.service.test.ts mocks the mail module (send asserted, no token in prod logs, failure path, no await); new services/mail.test.ts with nodemailer mocked
- package.json/package-lock.json: nodemailer ^10.6.0 (6.x had open high advisories), @types/nodemailer
- .env.example, CLAUDE.md, .claude/rules/api.md, README.md: new env vars, stub wording removed

npm test: Test Suites: 76 passed, 76 total / Tests: 801 passed, 801 total
npm run build: exit 0 (tsc typecheck); lint 273 problems (<= 274 baseline), none new in changed files

Node: email-auth-links (SEALED)
Evidence: agent-hub/evidence/verifier/2026-11-19/email-auth-links-seal.md

Closes #461

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat(auth): email reset/verify links over SMTP instead of logging tokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore(agent-hub): ship note for email-auth-links
@gitguardian

gitguardian Bot commented Nov 19, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
40242150 Triggered Generic Password f942b99 src/tests/integration/auth.http.test.ts View secret
40242150 Triggered Generic Password de5fd4f src/tests/integration/auth.http.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@datvt243
datvt243 merged commit 2c219c4 into main Nov 19, 2026
3 checks passed
@datvt243
datvt243 deleted the release/v2.10.0 branch November 19, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant