metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Stop implementing RPC methods ahead of the permission middleware

Open rekmarks opened this issue 1 year ago • 0 comments

Ref: https://github.com/MetaMask/metamask-mobile/issues/9492

Some RPC methods, e.g. wallet_switchEthereumChain and wallet_addEthereumChain, are implemented ahead of the permission middleware. This makes it difficult to keep track of our restricted vs. unrestricted methods, while also literally circumventing our permission system. Instead, we should reorder our json-rpc-engine middleware stack such that every method hits the permission middleware, and all unrestricted methods have to be enumerated in this list.

rekmarks avatar May 01 '24 17:05 rekmarks