veritas-kanban/server/src/__tests__/security-config-randomness.test.ts
Brad Groux 6ab3feb35f
fix: harden file and input handling (#1234)
* fix: harden file and input handling

* fix: keep URI scheme regex lint-safe
2026-08-24 01:58:21 -05:00

13 lines
475 B
TypeScript

import { describe, expect, it } from 'vitest';
import { generateRecoveryKey } from '../config/security.js';
describe('security config recovery keys', () => {
it('generates the documented alphabet and grouping', () => {
const keys = Array.from({ length: 128 }, () => generateRecoveryKey());
expect(new Set(keys).size).toBe(keys.length);
for (const key of keys) {
expect(key).toMatch(/^[A-HJ-KM-NP-Z2-9]{4}(?:-[A-HJ-KM-NP-Z2-9]{4}){3}$/);
}
});
});