-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.e2e.security.config.mts
More file actions
51 lines (47 loc) · 1.72 KB
/
Copy pathvitest.e2e.security.config.mts
File metadata and controls
51 lines (47 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Vitest config for security-enabled E2E tests.
*
* Runs tests/e2e/security-full-stack.test.ts against a real Redis instance
* that has a password, with ALL security features enabled via environment
* variables:
*
* REDIS_PASSWORD — Redis requirepass
* A2A_JWT_SECRET — enables POST /a2a/rpc bearer-token auth
* BOARD_JWT_SECRET — enables Socket.io JWT middleware
* CHANNEL_SIGNING_SECRET — enables HMAC-SHA256 Redis pub/sub signing
* NODE_ENV=production — enables error sanitization + CORS enforcement
* SEMANTIC_FIREWALL_ENABLED / CIRCUIT_BREAKER_ENABLED — feature flags
*
* Usage:
* npm run test:e2e:security
*
* Requires Docker (Redis started by globalSetup/securitySetup.ts).
*/
import { defineConfig } from 'vitest/config';
/** Must match SECURITY_TEST_REDIS_PASSWORD in securitySetup.ts */
const REDIS_PASSWORD = 'e2e-sec-redis-pass-32chars!!!!!';
export default defineConfig({
test: {
globals: true,
environment: 'node',
fileParallelism: false,
include: ['tests/e2e/security-full-stack.test.ts'],
globalSetup: './tests/e2e/setup/securitySetup.ts',
testTimeout: 30_000,
hookTimeout: 120_000,
env: {
REDIS_PASSWORD,
REDIS_URL: `redis://:${REDIS_PASSWORD}@localhost:6380`,
// Auth secrets — activates all three security gates
A2A_JWT_SECRET: 'e2e-a2a-secret-must-be-32-chars!!',
BOARD_JWT_SECRET: 'e2e-board-secret-must-32-chars!!!',
CHANNEL_SIGNING_SECRET: 'e2e-channel-secret-32bytes!!!!!',
// Runtime flags
NODE_ENV: 'production',
TRUST_PROXY: 'false',
SEMANTIC_FIREWALL_ENABLED: 'true',
CIRCUIT_BREAKER_ENABLED: 'true',
JIT_TOKENS_ENABLED: 'true',
},
},
});