- Hexagonal identity module: domain ports, use cases, argon2id hasher, pg repos - Migration 002_identity: identity_users + identity_sessions (token hash only) - Opaque 512-bit session tokens; DB stores SHA-256 hash; 7-day TTL in SQL - Cookie HttpOnly + Secure (COOKIE_SECURE, default true) + SameSite=Lax - LoginRateLimiter: 10 failures -> 429 + Retry-After, 15-min cooldown - Anti-enumeration: identical generic 401 + dummy-hash timing equalization - buildApp gains optional pool/cookieSecure; foundation-only app preserved - 47 unit + 14 integration tests; live smoke covers all acceptance criteria
44 lines
1.5 KiB
JSON
44 lines
1.5 KiB
JSON
{
|
|
"name": "mercadodevida-backend",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "MercadoDeVida vNext backend - modular monolith skeleton",
|
|
"engines": {
|
|
"node": ">=22"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc -p tsconfig.build.json",
|
|
"start": "node dist/infrastructure/http/server.js",
|
|
"lint": "eslint . && prettier --check .",
|
|
"lint:boundaries": "node scripts/check-module-boundaries.mjs src",
|
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
"test": "vitest run",
|
|
"test:integration": "node --env-file-if-exists=.env node_modules/vitest/vitest.mjs run itest",
|
|
"docker:up": "docker compose up -d --wait",
|
|
"docker:down": "docker compose down",
|
|
"db:up": "node --env-file-if-exists=.env node_modules/node-pg-migrate/bin/node-pg-migrate.js up --migrations-dir migrations",
|
|
"db:down": "node --env-file-if-exists=.env node_modules/node-pg-migrate/bin/node-pg-migrate.js down --migrations-dir migrations",
|
|
"db:status": "node --env-file-if-exists=.env scripts/db-status.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@fastify/cookie": "^11.1.2",
|
|
"argon2": "^0.45.1",
|
|
"fastify": "^5.2.0",
|
|
"node-pg-migrate": "^9.0.0",
|
|
"pg": "^8.23.0",
|
|
"pino": "^10.3.1",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.17.0",
|
|
"@types/pg": "^8.21.0",
|
|
"eslint": "^9.17.0",
|
|
"eslint-config-prettier": "^10.0.0",
|
|
"prettier": "^3.4.0",
|
|
"typescript": "^5.7.0",
|
|
"typescript-eslint": "^8.18.0",
|
|
"vitest": "^3.0.0"
|
|
}
|
|
}
|