Closed rekmarks closed 1 month ago
Supersedes: #2398
We are moving our permission middleware ahead of all RPC method implementations in the extension (https://github.com/MetaMask/metamask-extension/pull/24472) and mobile (https://github.com/MetaMask/metamask-mobile/pull/9521). This breaks the current implementation of wallet_invokeSnap, which assumes that it's called before the permission middleware (which calls the implementation of wallet_snap, which is a restricted method).
wallet_invokeSnap
wallet_snap
This PR refactors wallet_invokeSnap to use an invokeSnap() hook, intended to be PermissionController.executeRestrictedMethod() bound to the requesting origin and 'wallet_snap'.
invokeSnap()
PermissionController.executeRestrictedMethod()
'wallet_snap'
Supersedes: #2398
We are moving our permission middleware ahead of all RPC method implementations in the extension (https://github.com/MetaMask/metamask-extension/pull/24472) and mobile (https://github.com/MetaMask/metamask-mobile/pull/9521). This breaks the current implementation of
wallet_invokeSnap
, which assumes that it's called before the permission middleware (which calls the implementation ofwallet_snap
, which is a restricted method).This PR refactors
wallet_invokeSnap
to use aninvokeSnap()
hook, intended to bePermissionController.executeRestrictedMethod()
bound to the requesting origin and'wallet_snap'
.