-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add per-build type LavaMoat policies (#12702)
This PR adds one LavaMoat background script policy or each build type. It also renames the build system policy directory from `node` to `build-system` to make its purpose more clear. Each build type has the original `policy-override.json` for `main` builds. The `.prettierignore` file has been updated to match the locations of the new auto-generated policy files. We need to maintain separate policies for each build type because each type will produce different bundles with different internal and external modules. Co-authored-by: Mark Stacey <[email protected]>
- Loading branch information
Showing
13 changed files
with
9,693 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
node_modules/** | ||
lavamoat/*/policy.json | ||
lavamoat/**/policy.json | ||
dist/** | ||
builds/** | ||
test-*/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
# Generate LavaMoat policies for the extension background script for each build | ||
# type. | ||
# ATTN: This may tax your device when running it locally. | ||
concurrently --kill-others-on-fail -n main,beta,flask \ | ||
"WRITE_AUTO_POLICY=1 yarn dist" \ | ||
"WRITE_AUTO_POLICY=1 yarn dist --build-type beta" \ | ||
"WRITE_AUTO_POLICY=1 yarn dist --build-type flask" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"resources": { | ||
"browser-resolve": { | ||
"packages": { | ||
"core-js": true | ||
} | ||
}, | ||
"babel-runtime": { | ||
"packages": { | ||
"@babel/runtime": true | ||
} | ||
}, | ||
"node-fetch": { | ||
"globals": { | ||
"fetch": true | ||
} | ||
}, | ||
"lodash": { | ||
"globals": { | ||
"setTimeout": true, | ||
"clearTimeout": true | ||
} | ||
}, | ||
"@ethersproject/random": { | ||
"globals": { | ||
"crypto.getRandomValues": true | ||
} | ||
}, | ||
"browser-passworder": { | ||
"globals": { | ||
"crypto": true | ||
} | ||
}, | ||
"randombytes": { | ||
"globals": { | ||
"crypto.getRandomValues": true | ||
} | ||
}, | ||
"extensionizer": { | ||
"globals": { | ||
"console": true | ||
} | ||
}, | ||
"web3": { | ||
"globals": { | ||
"XMLHttpRequest": true | ||
} | ||
}, | ||
"storage": { | ||
"globals": { | ||
"localStorage": true | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.