From 8965b3471d03998312c8d56d7de047b92d2c18fc Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Fri, 8 Nov 2024 11:43:51 +0100 Subject: [PATCH 1/2] patch `@metamask/snaps-utils` --- ...ask-snaps-utils-npm-8.4.1-90481bac4b.patch | 26 +++++++++++++++++++ package.json | 9 +++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch diff --git a/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch b/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch new file mode 100644 index 000000000000..1c0aa8a99b3a --- /dev/null +++ b/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch @@ -0,0 +1,26 @@ +diff --git a/dist/json-rpc.cjs b/dist/json-rpc.cjs +index 6061f7b8b42f0521b0718d616e5a12a1a7520068..11d0233a7bd4b610a99da6a3d105840e88e108e6 100644 +--- a/dist/json-rpc.cjs ++++ b/dist/json-rpc.cjs +@@ -68,7 +68,7 @@ function createOriginRegExp(matcher) { + const escaped = matcher.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&'); + // Support wildcards + const regex = escaped.replace(/\\\*/gu, '.*'); +- return RegExp(`${regex}$`, 'u'); ++ return RegExp(`^${regex}$`, 'u'); + } + /** + * Check whether an origin is allowed or not using a matcher string. +diff --git a/dist/json-rpc.mjs b/dist/json-rpc.mjs +index bfa1c2dbbed46a2221ef708afdb97b15db84bc1b..81bc2150cf5d6a9bdabe8d43b04352b299bc1c4d 100644 +--- a/dist/json-rpc.mjs ++++ b/dist/json-rpc.mjs +@@ -63,7 +63,7 @@ function createOriginRegExp(matcher) { + const escaped = matcher.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&'); + // Support wildcards + const regex = escaped.replace(/\\\*/gu, '.*'); +- return RegExp(`${regex}$`, 'u'); ++ return RegExp(`^${regex}$`, 'u'); + } + /** + * Check whether an origin is allowed or not using a matcher string. diff --git a/package.json b/package.json index 26f02cebced7..f7900e85d536 100644 --- a/package.json +++ b/package.json @@ -250,7 +250,12 @@ "@metamask/network-controller@npm:^17.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch", "@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch", "@metamask/network-controller@npm:^20.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch", - "path-to-regexp": "1.9.0" + "path-to-regexp": "1.9.0", + "@metamask/snaps-utils@npm:^8.4.1": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch", + "@metamask/snaps-utils@npm:^8.3.0": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch", + "@metamask/snaps-utils@npm:^8.1.1": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch", + "@metamask/snaps-utils@npm:^8.4.0": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch", + "@metamask/snaps-utils@npm:^7.4.0": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", @@ -345,7 +350,7 @@ "@metamask/snaps-execution-environments": "^6.9.1", "@metamask/snaps-rpc-methods": "^11.5.0", "@metamask/snaps-sdk": "^6.9.0", - "@metamask/snaps-utils": "^8.4.1", + "@metamask/snaps-utils": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch", "@metamask/transaction-controller": "^38.3.0", "@metamask/user-operation-controller": "^13.0.0", "@metamask/utils": "^9.3.0", From 1e7d94a1a526b9db3c49fb0c72063ffb44b4f49f Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Fri, 8 Nov 2024 11:47:16 +0100 Subject: [PATCH 2/2] `yarn.lock` update --- yarn.lock | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 537017bab49f..a605a407bc81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6152,13 +6152,6 @@ __metadata: languageName: node linkType: hard -"@metamask/slip44@npm:^3.1.0": - version: 3.1.0 - resolution: "@metamask/slip44@npm:3.1.0" - checksum: 10/83f902c455468f1ec252d0554cd4ebf8da1fc9a27ec7199b81e265e5e8710fad86eaa71d86f24500f9db6626007ad71b1380b239e2104e7e558a061393b066fa - languageName: node - linkType: hard - "@metamask/slip44@npm:^4.0.0": version: 4.0.0 resolution: "@metamask/slip44@npm:4.0.0" @@ -6286,9 +6279,9 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-utils@npm:^7.4.0": - version: 7.8.1 - resolution: "@metamask/snaps-utils@npm:7.8.1" +"@metamask/snaps-utils@npm:8.4.1": + version: 8.4.1 + resolution: "@metamask/snaps-utils@npm:8.4.1" dependencies: "@babel/core": "npm:^7.23.2" "@babel/types": "npm:^7.23.0" @@ -6296,30 +6289,30 @@ __metadata: "@metamask/key-tree": "npm:^9.1.2" "@metamask/permission-controller": "npm:^11.0.0" "@metamask/rpc-errors": "npm:^6.3.1" - "@metamask/slip44": "npm:^3.1.0" + "@metamask/slip44": "npm:^4.0.0" "@metamask/snaps-registry": "npm:^3.2.1" - "@metamask/snaps-sdk": "npm:^6.1.0" + "@metamask/snaps-sdk": "npm:^6.9.0" "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.1.0" + "@metamask/utils": "npm:^9.2.1" "@noble/hashes": "npm:^1.3.1" "@scure/base": "npm:^1.1.1" chalk: "npm:^4.1.2" cron-parser: "npm:^4.5.0" fast-deep-equal: "npm:^3.1.3" fast-json-stable-stringify: "npm:^2.1.0" - fast-xml-parser: "npm:^4.3.4" + fast-xml-parser: "npm:^4.4.1" marked: "npm:^12.0.1" rfdc: "npm:^1.3.0" semver: "npm:^7.5.4" ses: "npm:^1.1.0" validate-npm-package-name: "npm:^5.0.0" - checksum: 10/572108aafbad970910ffb3605cf9eb4675ede0d69ff2bd37515da7f071de2065a55c73d6dc44dbe70bbd9c3ff0dfe29d40fd16badd925a4b8504db293265ca2f + checksum: 10/c68a2fe69dc835c2b996d621fd4698435475d419a85aa557aa000aae0ab7ebb68d2a52f0b28bbab94fff895ece9a94077e3910a21b16d904cff3b9419ca575b6 languageName: node linkType: hard -"@metamask/snaps-utils@npm:^8.1.1, @metamask/snaps-utils@npm:^8.3.0, @metamask/snaps-utils@npm:^8.4.0, @metamask/snaps-utils@npm:^8.4.1": +"@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch": version: 8.4.1 - resolution: "@metamask/snaps-utils@npm:8.4.1" + resolution: "@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch::version=8.4.1&hash=421c26" dependencies: "@babel/core": "npm:^7.23.2" "@babel/types": "npm:^7.23.0" @@ -6344,7 +6337,7 @@ __metadata: semver: "npm:^7.5.4" ses: "npm:^1.1.0" validate-npm-package-name: "npm:^5.0.0" - checksum: 10/c68a2fe69dc835c2b996d621fd4698435475d419a85aa557aa000aae0ab7ebb68d2a52f0b28bbab94fff895ece9a94077e3910a21b16d904cff3b9419ca575b6 + checksum: 10/cc1e10898c81361283aef46d48197177346f17febd8b005d486a9988c6a636ddf5369f7ccc8c22466091daf60fe8e1a8f6fc5790229efc15e8b4449f33a4d214 languageName: node linkType: hard @@ -19333,7 +19326,7 @@ __metadata: languageName: node linkType: hard -"fast-xml-parser@npm:^4.3.4, fast-xml-parser@npm:^4.4.1": +"fast-xml-parser@npm:^4.4.1": version: 4.4.1 resolution: "fast-xml-parser@npm:4.4.1" dependencies: @@ -26467,7 +26460,7 @@ __metadata: "@metamask/snaps-execution-environments": "npm:^6.9.1" "@metamask/snaps-rpc-methods": "npm:^11.5.0" "@metamask/snaps-sdk": "npm:^6.9.0" - "@metamask/snaps-utils": "npm:^8.4.1" + "@metamask/snaps-utils": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:8.7.0" "@metamask/transaction-controller": "npm:^38.3.0"