feat: login IT con allowlist (scrypt+HMAC) + middleware protege tablero/gestion

This commit is contained in:
Nurfog committed 2026-09-09 14:30:27 -03:00
1 parent 08bf7254a1
commit 57b64af1ba
13 files changed
+392 -14

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// Genera hash scrypt para IT_USERS: node scripts/hash-password.mjs <clave>
import { scryptSync, randomBytes } from "node:crypto";
const pass = process.argv[2];
if (!pass) {
console.error("Uso: node scripts/hash-password.mjs <clave>");
process.exit(1);
}
const N = 16384;
const r = 8;
const p = 1;
const salt = randomBytes(16).toString("hex");
const hash = scryptSync(pass, Buffer.from(salt, "hex"), 64, { N, r, p }).toString("hex");
console.log(`scrypt$${N}$${r}$${p}$${salt}$${hash}`);