test(security): persist panic-lock across restarts and add multi-auth/recovery E2E tests
This commit is contained in:
parent
90a8bf8553
commit
21176265aa
4 changed files with 559 additions and 13 deletions
|
|
@ -198,11 +198,18 @@ describe('Bundle size budget & full-stack Express + WS lifecycle', () => {
|
|||
(await api('/api/auth/safe-mode', { method: 'POST', body: { enabled: false } })).status,
|
||||
).toBe(200);
|
||||
|
||||
// 6. Vault Init + Step-Up guard + Generate Ed25519 key
|
||||
// 6. Vault Init + Drop Elevation -> Step-Up guard + Generate Ed25519 key
|
||||
const vInit = await api('/api/vault/init', { method: 'POST', body: {} });
|
||||
expect(vInit.status).toBe(201);
|
||||
const generatedMasterKey = String(vInit.data.generatedKeyHex);
|
||||
|
||||
// Default balanced mode elevates on bootstrap/login; drop elevation to verify guard enforcement
|
||||
const statusBeforeDrop = await api('/api/auth/status');
|
||||
expect(typeof statusBeforeDrop.data.elevatedUntil).toBe('number');
|
||||
const dropped = await api('/api/auth/drop-elevation', { method: 'POST' });
|
||||
expect(dropped.status).toBe(200);
|
||||
expect(dropped.data.elevatedUntil).toBeNull();
|
||||
|
||||
const noStepUp = await api('/api/vault/generate-ed25519', {
|
||||
method: 'POST',
|
||||
body: { id: 'prod-key', name: 'Prod Key' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue