Skip to content

Commit

Permalink
Update endowments
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Nov 28, 2024
1 parent b577d05 commit 4e6bbf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/core/Engine/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,10 @@ export class Engine {

this.snapController = new SnapController({
environmentEndowmentPermissions: Object.values(EndowmentPermissions),
excludedPermissions: {
...ExcludedSnapPermissions,
...ExcludedSnapEndowments,
},
featureFlags: {
requireAllowlist,
allowLocalSnaps,
Expand Down
12 changes: 10 additions & 2 deletions app/core/Snaps/permissions/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
// TODO: Figure out which permissions should be disabled at this point
export const ExcludedSnapPermissions = Object.freeze([]);
export const ExcludedSnapEndowments = Object.freeze([]);
export const ExcludedSnapPermissions = Object.freeze({
eth_accounts:
'eth_accounts is disabled. For more information please see https://github.com/MetaMask/snaps/issues/990.',
});
export const ExcludedSnapEndowments = Object.freeze({});

export const EndowmentPermissions = Object.freeze({
'endowment:network-access': 'endowment:network-access',
'endowment:transaction-insight': 'endowment:transaction-insight',
'endowment:cronjob': 'endowment:cronjob',
'endowment:ethereum-provider': 'endowment:ethereum-provider',
'endowment:rpc': 'endowment:rpc',
'endowment:webassembly': 'endowment:webassembly',
'endowment:lifecycle-hooks': 'endowment:lifecycle-hooks',
'endowment:page-home': 'endowment:page-home',
'endowment:signature-insight': 'endowment:signature-insight',
'endowment:name-lookup': 'endowment:name-lookup',
'endowment:keyring': 'endowment:keyring',
} as const);
///: END:ONLY_INCLUDE_IF

0 comments on commit 4e6bbf1

Please sign in to comment.