1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Persist phishing state controller state. (#16643)

* Persist phishing state controller state.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

update phishing controller to latest version

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Rebase, Yarn3, Lavamoat

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

run allow-scrips.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lavamoat:auto and linter

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
This commit is contained in:
Olusegun Akintayo 2023-01-18 16:44:19 +01:00 committed by GitHub
parent 2d6529bc5c
commit d7e829ed5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 33 deletions

View File

@ -493,8 +493,13 @@ export default class MetamaskController extends EventEmitter {
},
});
this.phishingController = new PhishingController();
this.phishingController.updatePhishingLists();
this.phishingController = new PhishingController(
{},
initState.PhishingController,
);
this.phishingController.maybeUpdatePhishingLists();
if (process.env.IN_TEST) {
this.phishingController.setRefreshInterval(5 * SECOND);
}
@ -1176,6 +1181,7 @@ export default class MetamaskController extends EventEmitter {
TokensController: this.tokensController,
SmartTransactionsController: this.smartTransactionsController,
NftController: this.nftController,
PhishingController: this.phishingController,
///: BEGIN:ONLY_INCLUDE_IN(flask)
SnapController: this.snapController,
CronjobController: this.cronjobController,
@ -3523,10 +3529,7 @@ export default class MetamaskController extends EventEmitter {
if (sender.url) {
const { hostname } = new URL(sender.url);
const phishingListsAreOutOfDate = this.phishingController.isOutOfDate();
if (phishingListsAreOutOfDate) {
this.phishingController.updatePhishingLists();
}
this.phishingController.maybeUpdatePhishingLists();
// Check if new connection is blocked if phishing detection is on
const phishingTestResponse = this.phishingController.test(hostname);
if (usePhishDetect && phishingTestResponse?.result) {

View File

@ -938,18 +938,13 @@
"fetch": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/controller-utils>isomorphic-fetch": true,
"@metamask/phishing-controller>@metamask/base-controller": true,
"@metamask/phishing-controller>eth-phishing-detect": true,
"punycode": true
}
},
"@metamask/phishing-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/phishing-controller>eth-phishing-detect": {
"packages": {
"eslint>optionator>fast-levenshtein": true

View File

@ -950,18 +950,13 @@
"fetch": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/controller-utils>isomorphic-fetch": true,
"@metamask/phishing-controller>@metamask/base-controller": true,
"@metamask/phishing-controller>eth-phishing-detect": true,
"punycode": true
}
},
"@metamask/phishing-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/phishing-controller>eth-phishing-detect": {
"packages": {
"eslint>optionator>fast-levenshtein": true

View File

@ -938,18 +938,13 @@
"fetch": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/controller-utils>isomorphic-fetch": true,
"@metamask/phishing-controller>@metamask/base-controller": true,
"@metamask/phishing-controller>eth-phishing-detect": true,
"punycode": true
}
},
"@metamask/phishing-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/phishing-controller>eth-phishing-detect": {
"packages": {
"eslint>optionator>fast-levenshtein": true

View File

@ -228,7 +228,7 @@
"@metamask/notification-controller": "^1.0.0",
"@metamask/obs-store": "^5.0.0",
"@metamask/permission-controller": "^1.0.0",
"@metamask/phishing-controller": "^1.0.0",
"@metamask/phishing-controller": "^1.1.0",
"@metamask/post-message-stream": "^6.0.0",
"@metamask/providers": "^10.2.1",
"@metamask/rate-limit-controller": "^1.0.0",
@ -572,7 +572,8 @@
"web3>web3-shh": false,
"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>hdkey>secp256k1": false,
"@metamask/base-controller>simple-git-hooks": false,
"@storybook/core>@storybook/core-server>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false
"@storybook/core>@storybook/core-server>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false,
"resolve-url-loader>es6-iterator>es5-ext": false
}
},
"packageManager": "yarn@3.2.4"

View File

@ -3714,17 +3714,17 @@ __metadata:
languageName: node
linkType: hard
"@metamask/phishing-controller@npm:^1.0.0":
version: 1.0.0
resolution: "@metamask/phishing-controller@npm:1.0.0"
"@metamask/phishing-controller@npm:^1.1.0":
version: 1.1.0
resolution: "@metamask/phishing-controller@npm:1.1.0"
dependencies:
"@metamask/base-controller": ~1.0.0
"@metamask/controller-utils": ~1.0.0
"@metamask/base-controller": ^1.1.1
"@metamask/controller-utils": ^1.0.0
"@types/punycode": ^2.1.0
eth-phishing-detect: ^1.2.0
isomorphic-fetch: ^3.0.0
punycode: ^2.1.1
checksum: e5e31f68611c14b30cfd639b99a97921cac1d13af534fa1586bce63075895486d89c554aaa5f5201245f51981a0a8a1f9aeeea8652e22c9523b01f8880de4de6
checksum: bc8c066dd9ed3fff9456ffd2d888c5c78e45a4f4b8e19903caa47b07f42bb298c95956d5df22aef805dbbf2dac6dfb5291f605636fb0725417ae6e0d1c14528a
languageName: node
linkType: hard
@ -22790,7 +22790,7 @@ __metadata:
"@metamask/notification-controller": ^1.0.0
"@metamask/obs-store": ^5.0.0
"@metamask/permission-controller": ^1.0.0
"@metamask/phishing-controller": ^1.0.0
"@metamask/phishing-controller": ^1.1.0
"@metamask/phishing-warning": ^1.2.1
"@metamask/post-message-stream": ^6.0.0
"@metamask/providers": ^10.2.1