fix: harden demo lifecycle and scanner

This commit is contained in:
golem
2026-08-21 04:31:37 -06:00
parent 2446f0b2ef
commit a710106932
8 changed files with 509 additions and 128 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ const NETWORKS = {
const REQUIRED_MANIFEST_FIELDS = ["schemaVersion", "network", "chainId", "deploymentBlock", "token", "proxy", "implementation", "owner", "actors"];
const OPTIONAL_MANIFEST_FIELDS = ["rpcUrl", "explorerBaseUrl"];
const ANVIL_TEST_PHRASE = "test test test test test test test test test test test junk";
const ANVIL_TEST_WORDS = [...Array(11).fill("test"), "junk"].join(" ");
const PROHIBITED_STRING_VALUE = /(?:private[_ -]?key|mnemonic|secret|password|credential|api[_ -]?key)|0x[a-fA-F0-9]{64}/i;
export function networkSpec(network) {
@@ -202,7 +202,7 @@ function assertActorConfiguration(manifest) {
function rejectProhibitedStringValues(value, path = "") {
if (typeof value === "string") {
if (value.includes(ANVIL_TEST_PHRASE) || PROHIBITED_STRING_VALUE.test(value)) {
if (value.includes(ANVIL_TEST_WORDS) || PROHIBITED_STRING_VALUE.test(value)) {
throw new Error(`manifest contains prohibited secret material at ${path}`);
}
return;