Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!(snaps-rpc-methods): Use hooks in wallet_invokeSnap instead of remapping the request to wallet_snap #2406

Merged
merged 2 commits into from
May 14, 2024

Conversation

rekmarks
Copy link
Member

Supersedes: #2398

We are moving our permission middleware ahead of all RPC method implementations in the extension (MetaMask/metamask-extension#24472) and mobile (MetaMask/metamask-mobile#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).

This PR refactors wallet_invokeSnap to use an invokeSnap() hook, intended to be PermissionController.executeRestrictedMethod() bound to the requesting origin and 'wallet_snap'.

@rekmarks rekmarks requested a review from a team as a code owner May 14, 2024 16:14
…nstead of remapping the request to wallet_snap
@rekmarks rekmarks merged commit 5348c82 into main May 14, 2024
151 checks passed
@rekmarks rekmarks deleted the rekm/invoke-snap-sugar-refactor branch May 14, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants