@metamask/phishing-controller
Advanced tools
Comparing version 5.0.0 to 6.0.0
@@ -9,2 +9,7 @@ # Changelog | ||
## [6.0.0] | ||
### Changed | ||
- **BREAKING:** Remove fallback phishing configuration ([#1527](https://github.com/MetaMask/core/pull/1527)) | ||
- The default configuration is now blank. A custom initial configuration can still be specified via the constructor to preserve the old behavior. | ||
## [5.0.0] | ||
@@ -74,3 +79,4 @@ ### Changed | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@5.0.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@6.0.0...HEAD | ||
[6.0.0]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@5.0.0...@metamask/phishing-controller@6.0.0 | ||
[5.0.0]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@4.0.0...@metamask/phishing-controller@5.0.0 | ||
@@ -77,0 +83,0 @@ [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@3.0.0...@metamask/phishing-controller@4.0.0 |
@@ -1,2 +0,3 @@ | ||
import { BaseController, BaseConfig, BaseState } from '@metamask/base-controller'; | ||
import type { BaseConfig, BaseState } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
/** | ||
@@ -3,0 +4,0 @@ * @type ListTypes |
@@ -39,7 +39,6 @@ "use strict"; | ||
exports.PhishingController = exports.phishingListKeyNameMap = exports.ListNames = exports.ListKeys = exports.METAMASK_HOTLIST_DIFF_URL = exports.METAMASK_STALELIST_URL = exports.STALELIST_REFRESH_INTERVAL = exports.HOTLIST_REFRESH_INTERVAL = exports.METAMASK_HOTLIST_DIFF_FILE = exports.METAMASK_STALELIST_FILE = exports.PHISHING_CONFIG_BASE_URL = void 0; | ||
const punycode_1 = require("punycode/"); | ||
const config_json_1 = __importDefault(require("eth-phishing-detect/src/config.json")); | ||
const detector_1 = __importDefault(require("eth-phishing-detect/src/detector")); | ||
const base_controller_1 = require("@metamask/base-controller"); | ||
const controller_utils_1 = require("@metamask/controller-utils"); | ||
const detector_1 = __importDefault(require("eth-phishing-detect/src/detector")); | ||
const punycode_1 = require("punycode/"); | ||
const utils_1 = require("./utils"); | ||
@@ -110,13 +109,3 @@ exports.PHISHING_CONFIG_BASE_URL = 'https://phishing-detection.metafi.codefi.network'; | ||
this.defaultState = { | ||
phishingLists: [ | ||
{ | ||
allowlist: config_json_1.default.whitelist, | ||
blocklist: config_json_1.default.blacklist, | ||
fuzzylist: config_json_1.default.fuzzylist, | ||
tolerance: config_json_1.default.tolerance, | ||
version: config_json_1.default.version, | ||
name: ListNames.MetaMask, | ||
lastUpdated: 0, | ||
}, | ||
], | ||
phishingLists: [], | ||
whitelist: [], | ||
@@ -206,3 +195,3 @@ hotlistLastFetched: 0, | ||
const punycodeOrigin = (0, punycode_1.toASCII)(origin); | ||
if (this.state.whitelist.indexOf(punycodeOrigin) !== -1) { | ||
if (this.state.whitelist.includes(punycodeOrigin)) { | ||
return { result: false, type: 'all' }; // Same as whitelisted match returned by detector.check(...). | ||
@@ -220,3 +209,3 @@ } | ||
const { whitelist } = this.state; | ||
if (whitelist.indexOf(punycodeOrigin) !== -1) { | ||
if (whitelist.includes(punycodeOrigin)) { | ||
return; | ||
@@ -223,0 +212,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Hotlist, ListKeys, PhishingListState } from './PhishingController'; | ||
import type { Hotlist, ListKeys, PhishingListState } from './PhishingController'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Fetches current epoch time in seconds. |
{ | ||
"name": "@metamask/phishing-controller", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "Maintains a periodically updated list of approved and unapproved website origins", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@metamask/base-controller": "^3.0.0", | ||
"@metamask/controller-utils": "^4.0.0", | ||
"@metamask/base-controller": "^3.2.0", | ||
"@metamask/controller-utils": "^4.3.0", | ||
"@types/punycode": "^2.1.0", | ||
@@ -36,0 +36,0 @@ "eth-phishing-detect": "^1.2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71883
694