Skip to content

Commit

Permalink
Stub out @protobufjs/inquire to avoid unsafe-eval violation in CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Nov 27, 2023
1 parent e0826e6 commit ce76953
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Production:

- ensure <https://wallet.stg.oasis.io/> works
- especially features related to changes
- look at CSP errors (expect one error: blocked `eval` in `inquire`)
- look at CSP errors
- see the footer for what commit is deployed
- update `stable` branch to that commit
- `yarn install --frozen-lockfile && yarn build`
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"//": "Parcel doesn't support subpath patterns #7840. We need an alias for @ledgerhq/devices",
"alias": {
"@ledgerhq/devices": "@ledgerhq/devices/lib-es",
"@protobufjs/inquire": "./src/utils/@protobufjs/inquire.js",
"locales": "./src/locales",
"utils": "./src/utils",
"app": "./src/app",
Expand Down
4 changes: 4 additions & 0 deletions src/utils/@protobufjs/inquire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// We intend to run in browsers, which don't support runtime `require`.
// https://github.com/protobufjs/protobuf.js/pull/1548/files#r588874248
// Stub this out to prevent CSP spam.
module.exports = () => null;

Check failure on line 4 in src/utils/@protobufjs/inquire.js

View workflow job for this annotation

GitHub Actions / lint

Delete `;`

0 comments on commit ce76953

Please sign in to comment.