1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 12:47:14 +01:00
metamask-extension/app/scripts/flask/snaps-blocklist.js
David Drazic 2754f7e7ed
Add changes to support blocking Snaps by source shasum (#15830)
Refactor code and add unit tests for blocklist

Add small fix for undefined

Update property names

Structural refactoring

Refactor and improve unit tests

Add comment that explains part of snaps blocking logic

Refactor blocklist utility
2022-09-23 18:56:46 +02:00

25 lines
595 B
JavaScript

/**
* Represents a list of Snaps that are not allowed to be used.
* Can be blocked by [ID, VERSION] or SHASUM of a source code (or both).
*
* Example:
* {
* id: 'npm:@consensys/snap-id',
* versionRange: '<0.1.11',
* shasum: 'TEIbWsAyQe/8rBNXOHx3bOP9YF61PIPP/YHeokLchJE=',
* },
* {
* shasum: 'eCYGZiYvZ3/uxkKI3npfl79kTQXS/5iD9ojsBS4A3rI=',
* },
*/
export const SNAP_BLOCKLIST = [
{
id: 'npm:@consensys/starknet-snap',
versionRange: '<0.1.11',
},
{
// @consensys/starknet-snap v:0.1.10
shasum: 'A83r5/ZIcKuKwuAnQHHByVFCuofj7jGK5hOStmHY6A0=',
},
];