fix(deploy): avoid source guard self-match
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -69,7 +69,9 @@ export async function releaseManifest(dist, sourceCommit) {
|
||||
}
|
||||
publicPath(child);
|
||||
const bytes = await fs.readFile(path.join(dist, child));
|
||||
if (bytes.includes(Buffer.from('PRIVATE KEY-----'))) fail(`Private-key material in artifact: ${child}`);
|
||||
// Build the sentinel in memory so this guardrail can itself be included in
|
||||
// the server-validated source snapshot without looking like a PEM body.
|
||||
if (bytes.includes(Buffer.from(['PRIVATE', ' KEY-----'].join('')))) fail(`Private-key material in artifact: ${child}`);
|
||||
files[child] = { sha256: sha256(bytes), size: bytes.length };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user