Some checks failed
CI / go-lint (pull_request) Failing after 1s
CI / python-lint (pull_request) Failing after 10s
CI / nodejs-lint (pull_request) Failing after 2s
CI / test-go-consent (pull_request) Failing after 2s
CI / test-python-voice (pull_request) Failing after 9s
CI / test-bqas (pull_request) Failing after 12s
CI / Deploy (pull_request) Has been skipped
Adds vitest with 36 tests covering the security primitives: - lib/auth: token gen uniqueness, hashToken determinism, JWT roundtrip, validateAdminSecret bearer flow, getClientIp x-forwarded-for parsing - lib/admin-auth: bcrypt hash uniqueness/verify, JWT roundtrip, audience claim isolation (admin JWT does not validate as investor JWT) - lib/rate-limit: limit enforcement, key isolation, window reset via fake timers, preset config sanity Pure-function coverage only — route handler integration tests would need a test DB and are deferred. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 lines
368 B
TypeScript
5 lines
368 B
TypeScript
// Vitest global setup. Required env so the auth modules can initialize.
|
|
process.env.PITCH_JWT_SECRET = process.env.PITCH_JWT_SECRET || 'test-secret-do-not-use-in-production-32chars'
|
|
process.env.PITCH_ADMIN_SECRET = process.env.PITCH_ADMIN_SECRET || 'test-admin-secret'
|
|
process.env.DATABASE_URL = process.env.DATABASE_URL || 'postgres://test:test@localhost:5432/test'
|