chore: import DH V2 D5.6.4 production baseline

This commit is contained in:
DH V2
2026-09-05 10:12:35 -03:00
commit 82213e72f5
757 changed files with 84218 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { PasswordService } from '../../src/auth/services/password.service';
test('PasswordService hashes with Argon2id and verifies safely', async () => {
const service = new PasswordService();
const hash = await service.hash('Una-clave-segura-2026');
assert.match(hash, /^\$argon2id\$/);
assert.equal(await service.verify(hash, 'Una-clave-segura-2026'), true);
assert.equal(await service.verify(hash, 'clave-incorrecta'), false);
assert.equal(service.needsRehash(hash), false);
});
test('PasswordService performs dummy verification for unknown users', async () => {
const service = new PasswordService();
await assert.doesNotReject(service.verifyUnknown('cualquier-clave'));
});