feat(security): migrate sha1 hashes to sha256 for synthetic ids (#7343) (#22528)

* feat(prompt): add explicit owner hash secret to obfuscation path

* feat(security): migrate synthetic IDs to sha256 for #7343
This commit is contained in:
Vincent Koc
2026-02-21 03:20:14 -05:00
committed by GitHub
parent 9abab6a2c9
commit c20d519e05
6 changed files with 11 additions and 9 deletions

View File

@@ -156,7 +156,7 @@ async function readLockPayload(lockPath: string): Promise<LockPayload | null> {
function resolveGatewayLockPath(env: NodeJS.ProcessEnv) {
const stateDir = resolveStateDir(env);
const configPath = resolveConfigPath(env, stateDir);
const hash = createHash("sha1").update(configPath).digest("hex").slice(0, 8);
const hash = createHash("sha256").update(configPath).digest("hex").slice(0, 8);
const lockDir = resolveGatewayLockDir();
const lockPath = path.join(lockDir, `gateway.${hash}.lock`);
return { lockPath, configPath };