LavaMoat Node update and various small enhancements (#12239)

* lavamoat - update lavamoat-node and relevant policy + two handy patches

* test/e2e - add timeout known to be flaky

* lavamoat-viz - rename npm script
feature/default_network_editable
kumavis 3 years ago committed by GitHub
parent 20eb35be4e
commit d9d20160d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/scripts/create-lavamoat-viz.sh
  2. 201
      lavamoat/node/policy.json
  3. 4
      package.json
  4. 18
      patches/abort-controller+3.0.0.patch
  5. 11
      patches/regenerator-runtime+0.13.7.patch
  6. 3
      test/e2e/tests/contract-interactions.spec.js
  7. 30
      yarn.lock

@ -11,7 +11,7 @@ BUILD_DEST="./build-artifacts/build-viz/"
mkdir -p "${BUILD_DEST}" mkdir -p "${BUILD_DEST}"
# generate lavamoat debug config # generate lavamoat debug config
yarn lavamoat:debug yarn lavamoat:debug:build
# generate viz # generate viz
npx lavamoat-viz --dest "${BUILD_DEST}" npx lavamoat-viz --dest "${BUILD_DEST}"

@ -1008,16 +1008,6 @@
"buffer-equal": true "buffer-equal": true
} }
}, },
"are-we-there-yet": {
"builtin": {
"events.EventEmitter": true,
"util.inherits": true
},
"packages": {
"delegates": true,
"readable-stream": true
}
},
"arr-diff": { "arr-diff": {
"packages": { "packages": {
"arr-flatten": true, "arr-flatten": true,
@ -1377,7 +1367,6 @@
"anymatch": true, "anymatch": true,
"async-each": true, "async-each": true,
"braces": true, "braces": true,
"fsevents": true,
"glob-parent": true, "glob-parent": true,
"inherits": true, "inherits": true,
"is-binary-path": true, "is-binary-path": true,
@ -1629,16 +1618,6 @@
"through2": true "through2": true
} }
}, },
"detect-libc": {
"builtin": {
"child_process.spawnSync": true,
"fs.readdirSync": true,
"os.platform": true
},
"globals": {
"process.env": true
}
},
"detective": { "detective": {
"packages": { "packages": {
"acorn-node": true, "acorn-node": true,
@ -2175,45 +2154,6 @@
"process.version": true "process.version": true
} }
}, },
"fsevents": {
"builtin": {
"events.EventEmitter": true,
"fs.stat": true,
"path.join": true,
"util.inherits": true
},
"globals": {
"__dirname": true,
"process.nextTick": true,
"process.platform": true,
"setImmediate": true
},
"native": true,
"packages": {
"node-pre-gyp": true
}
},
"gauge": {
"builtin": {
"util.format": true
},
"globals": {
"clearInterval": true,
"process": true,
"setImmediate": true,
"setInterval": true
},
"packages": {
"aproba": true,
"console-control-strings": true,
"has-unicode": true,
"object-assign": true,
"signal-exit": true,
"string-width": true,
"strip-ansi": true,
"wide-align": true
}
},
"get-assigned-identifiers": { "get-assigned-identifiers": {
"builtin": { "builtin": {
"assert.equal": true "assert.equal": true
@ -2575,16 +2515,6 @@
"process.argv": true "process.argv": true
} }
}, },
"has-unicode": {
"builtin": {
"os.type": true
},
"globals": {
"process.env.LANG": true,
"process.env.LC_ALL": true,
"process.env.LC_CTYPE": true
}
},
"has-value": { "has-value": {
"packages": { "packages": {
"get-value": true, "get-value": true,
@ -2738,11 +2668,6 @@
"is-plain-object": true "is-plain-object": true
} }
}, },
"is-fullwidth-code-point": {
"packages": {
"number-is-nan": true
}
},
"is-glob": { "is-glob": {
"packages": { "packages": {
"is-extglob": true "is-extglob": true
@ -3138,56 +3063,6 @@
"setTimeout": true "setTimeout": true
} }
}, },
"node-pre-gyp": {
"builtin": {
"events.EventEmitter": true,
"fs.existsSync": true,
"fs.readFileSync": true,
"fs.renameSync": true,
"path.dirname": true,
"path.existsSync": true,
"path.join": true,
"path.resolve": true,
"url.parse": true,
"url.resolve": true,
"util.inherits": true
},
"globals": {
"__dirname": true,
"console.log": true,
"process.arch": true,
"process.cwd": true,
"process.env": true,
"process.platform": true,
"process.version.substr": true,
"process.versions": true
},
"packages": {
"detect-libc": true,
"nopt": true,
"npmlog": true,
"rimraf": true,
"semver": true
}
},
"nopt": {
"builtin": {
"path": true,
"stream.Stream": true,
"url": true
},
"globals": {
"console": true,
"process.argv": true,
"process.env.DEBUG_NOPT": true,
"process.env.NOPT_DEBUG": true,
"process.platform": true
},
"packages": {
"abbrev": true,
"osenv": true
}
},
"normalize-path": { "normalize-path": {
"packages": { "packages": {
"remove-trailing-separator": true "remove-trailing-separator": true
@ -3203,22 +3078,6 @@
"once": true "once": true
} }
}, },
"npmlog": {
"builtin": {
"events.EventEmitter": true,
"util": true
},
"globals": {
"process.nextTick": true,
"process.stderr": true
},
"packages": {
"are-we-there-yet": true,
"console-control-strings": true,
"gauge": true,
"set-blocking": true
}
},
"object-copy": { "object-copy": {
"packages": { "packages": {
"copy-descriptor": true, "copy-descriptor": true,
@ -3285,54 +3144,6 @@
"readable-stream": true "readable-stream": true
} }
}, },
"os-homedir": {
"builtin": {
"os.homedir": true
},
"globals": {
"process.env": true,
"process.getuid": true,
"process.platform": true
}
},
"os-tmpdir": {
"globals": {
"process.env.SystemRoot": true,
"process.env.TEMP": true,
"process.env.TMP": true,
"process.env.TMPDIR": true,
"process.env.windir": true,
"process.platform": true
}
},
"osenv": {
"builtin": {
"child_process.exec": true,
"path": true
},
"globals": {
"process.env.COMPUTERNAME": true,
"process.env.ComSpec": true,
"process.env.EDITOR": true,
"process.env.HOSTNAME": true,
"process.env.PATH": true,
"process.env.PROMPT": true,
"process.env.PS1": true,
"process.env.Path": true,
"process.env.SHELL": true,
"process.env.USER": true,
"process.env.USERDOMAIN": true,
"process.env.USERNAME": true,
"process.env.VISUAL": true,
"process.env.path": true,
"process.nextTick": true,
"process.platform": true
},
"packages": {
"os-homedir": true,
"os-tmpdir": true
}
},
"parent-module": { "parent-module": {
"packages": { "packages": {
"callsites": true "callsites": true
@ -3915,12 +3726,6 @@
"process": true "process": true
} }
}, },
"set-blocking": {
"globals": {
"process.stderr": true,
"process.stdout": true
}
},
"set-value": { "set-value": {
"packages": { "packages": {
"extend-shallow": true, "extend-shallow": true,
@ -4122,7 +3927,6 @@
}, },
"string-width": { "string-width": {
"packages": { "packages": {
"code-point-at": true,
"emoji-regex": true, "emoji-regex": true,
"is-fullwidth-code-point": true, "is-fullwidth-code-point": true,
"strip-ansi": true "strip-ansi": true
@ -4699,11 +4503,6 @@
"isexe": true "isexe": true
} }
}, },
"wide-align": {
"packages": {
"string-width": true
}
},
"write": { "write": {
"builtin": { "builtin": {
"fs.createWriteStream": true, "fs.createWriteStream": true,

@ -65,7 +65,7 @@
"update-changelog": "auto-changelog update", "update-changelog": "auto-changelog update",
"generate:migration": "./development/generate-migration.sh", "generate:migration": "./development/generate-migration.sh",
"lavamoat:auto": "lavamoat ./development/build/index.js --writeAutoPolicy", "lavamoat:auto": "lavamoat ./development/build/index.js --writeAutoPolicy",
"lavamoat:debug": "lavamoat ./development/build/index.js --writeAutoPolicyDebug" "lavamoat:debug:build": "lavamoat ./development/build/index.js --writeAutoPolicyDebug"
}, },
"resolutions": { "resolutions": {
"**/regenerator-runtime": "^0.13.7", "**/regenerator-runtime": "^0.13.7",
@ -287,7 +287,7 @@
"jest": "^26.6.3", "jest": "^26.6.3",
"jsdom": "^11.2.0", "jsdom": "^11.2.0",
"koa": "^2.7.0", "koa": "^2.7.0",
"lavamoat": "^5.3.1", "lavamoat": "^5.3.4",
"lavamoat-viz": "^6.0.9", "lavamoat-viz": "^6.0.9",
"lockfile-lint": "^4.0.0", "lockfile-lint": "^4.0.0",
"loose-envify": "^1.4.0", "loose-envify": "^1.4.0",

@ -0,0 +1,18 @@
diff --git a/node_modules/abort-controller/browser.js b/node_modules/abort-controller/browser.js
index b0c5ec3..c8c8018 100644
--- a/node_modules/abort-controller/browser.js
+++ b/node_modules/abort-controller/browser.js
@@ -2,12 +2,7 @@
"use strict"
/*eslint-disable @mysticatea/prettier */
-const { AbortController, AbortSignal } =
- typeof self !== "undefined" ? self :
- typeof window !== "undefined" ? window :
- /* otherwise */ undefined
+const { AbortController } = globalThis;
/*eslint-enable @mysticatea/prettier */
module.exports = AbortController
-module.exports.AbortSignal = AbortSignal
-module.exports.default = AbortController

@ -1,5 +1,5 @@
diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js
index 547b8c6..c53a471 100644 index 547b8c6..885626e 100644
--- a/node_modules/regenerator-runtime/runtime.js --- a/node_modules/regenerator-runtime/runtime.js
+++ b/node_modules/regenerator-runtime/runtime.js +++ b/node_modules/regenerator-runtime/runtime.js
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
@ -65,3 +65,12 @@ index 547b8c6..c53a471 100644
function pushTryEntry(locs) { function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] }; var entry = { tryLoc: locs[0] };
@@ -733,7 +734,7 @@ var runtime = (function (exports) {
));
try {
- regeneratorRuntime = runtime;
+ globalThis.regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just

@ -1,5 +1,5 @@
const { strict: assert } = require('assert'); const { strict: assert } = require('assert');
const { withFixtures } = require('../helpers'); const { withFixtures, regularDelayMs } = require('../helpers');
describe('Deploy contract and call contract methods', function () { describe('Deploy contract and call contract methods', function () {
let windowHandles; let windowHandles;
@ -91,6 +91,7 @@ describe('Deploy contract and call contract methods', function () {
'MetaMask Notification', 'MetaMask Notification',
windowHandles, windowHandles,
); );
await driver.delay(regularDelayMs);
await driver.clickElement({ text: 'Confirm', tag: 'button' }); await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.waitUntilXWindowHandles(2); await driver.waitUntilXWindowHandles(2);
await driver.switchToWindow(extension); await driver.switchToWindow(extension);

@ -17418,6 +17418,17 @@ lavamoat-core@^10.0.1:
merge-deep "^3.0.2" merge-deep "^3.0.2"
resolve "^1.15.1" resolve "^1.15.1"
lavamoat-core@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/lavamoat-core/-/lavamoat-core-11.0.0.tgz#d1decbabae0429149fb7bbeb7f8a74fa054dbdf9"
integrity sha512-D/ULw8cbQ+0Rr/2IT38XedH8CWZsfIy0WThJHLjPbxwdPuHasFw9GHs88vjYv7a6UJ1uac8x5mhyOlbGoOJcIw==
dependencies:
fromentries "^1.2.0"
json-stable-stringify "^1.0.1"
lavamoat-tofu "^6.0.0"
merge-deep "^3.0.2"
resolve "^1.15.1"
lavamoat-tofu@^5.1.3: lavamoat-tofu@^5.1.3:
version "5.1.3" version "5.1.3"
resolved "https://registry.yarnpkg.com/lavamoat-tofu/-/lavamoat-tofu-5.1.3.tgz#8e89a7ac206f3b2dc9c8ea52ecfd4f92f90285ae" resolved "https://registry.yarnpkg.com/lavamoat-tofu/-/lavamoat-tofu-5.1.3.tgz#8e89a7ac206f3b2dc9c8ea52ecfd4f92f90285ae"
@ -17426,6 +17437,14 @@ lavamoat-tofu@^5.1.3:
"@babel/parser" "^7.10.1" "@babel/parser" "^7.10.1"
"@babel/traverse" "^7.10.1" "@babel/traverse" "^7.10.1"
lavamoat-tofu@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lavamoat-tofu/-/lavamoat-tofu-6.0.0.tgz#26d37c14864eb98df247195c5419a3a762ef650b"
integrity sha512-tgXf+/lplow/Ao2cOsbQ4ZqTuKBLwNnSSjPFIiGAHAM6xs+c+jEr60UAqOflyBg94VOE47G6o8zYZOAylZpUrw==
dependencies:
"@babel/parser" "^7.10.1"
"@babel/traverse" "^7.10.1"
lavamoat-viz@^6.0.9: lavamoat-viz@^6.0.9:
version "6.0.9" version "6.0.9"
resolved "https://registry.yarnpkg.com/lavamoat-viz/-/lavamoat-viz-6.0.9.tgz#ddec64becdf62448f7d0ea57c5258246ee14304c" resolved "https://registry.yarnpkg.com/lavamoat-viz/-/lavamoat-viz-6.0.9.tgz#ddec64becdf62448f7d0ea57c5258246ee14304c"
@ -17438,16 +17457,17 @@ lavamoat-viz@^6.0.9:
serve-handler "^6.1.3" serve-handler "^6.1.3"
yargs "^16.0.0" yargs "^16.0.0"
lavamoat@^5.3.1: lavamoat@^5.3.4:
version "5.3.1" version "5.3.4"
resolved "https://registry.yarnpkg.com/lavamoat/-/lavamoat-5.3.1.tgz#66f140210f406c69ec58f18ebcd827b52e3a3276" resolved "https://registry.yarnpkg.com/lavamoat/-/lavamoat-5.3.4.tgz#cf0778a5fc8b2bc14bce79d46dc730df3d8c21ad"
integrity sha512-XXMDX7dV2lKEymlC3+rAAWp7/j1Qe+j2lgyRMvg1xI2Vux24iW837grHDIyx1qs7LOhu5F98Z772z7jmGjBjfg== integrity sha512-0p7B8+6Hs/WGlkBaVQl6RGdAlYd0pL6eFTh6/Oc3kdyi4wVc2Fz5vFOJqrZi8XkvjMuCLln7udYbiCapr74yZQ==
dependencies: dependencies:
"@babel/code-frame" "^7.10.4" "@babel/code-frame" "^7.10.4"
"@babel/highlight" "^7.10.4"
bindings "^1.5.0" bindings "^1.5.0"
htmlescape "^1.1.1" htmlescape "^1.1.1"
json-stable-stringify "^1.0.1" json-stable-stringify "^1.0.1"
lavamoat-core "^10.0.1" lavamoat-core "^11.0.0"
lavamoat-tofu "^5.1.3" lavamoat-tofu "^5.1.3"
node-gyp-build "^4.2.3" node-gyp-build "^4.2.3"
object.fromentries "^2.0.2" object.fromentries "^2.0.2"

Loading…
Cancel
Save