Skip to content

Add new permissionsProvider_getGrantedPermissions RPC #108

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

Merged

Conversation

V00D00-child
Copy link
Member

@V00D00-child V00D00-child commented Jul 10, 2025

Description

Expose a new RPC method permissionsProvider_getGrantedPermissions to be used by Metamask clients to retrieve granted permissions for all sites.

Related issues

Related to: Persisting Granted Permissions with MM Profile Sync
Required by(MM Extension): Feat/gator permissions revoke UI
Required by(MM Core): feat: add gator permissions controller

Manual testing steps

Exiting functionally should behave as expected. To test the new RPC method, a local build of MaskMeta is required with a request made to gator-snap. See code snippet below for more context:

// Make call to gator-snap new RPC methods directly inside MetaMask extension, the method is only accessible by metamask clients
// Code below needs to be run in the context of the MetaMask extension
 const sampleResponse = (await handleSnapRequest({
          snapId: 'local:http://localhost:8082/', // this would be @metamask/gator-permissions-snap in prod
          origin: 'metamask',
          handler: 'onRpcRequest',
          request: {
            jsonrpc: '2.0',
            method: 'permissionsProvider_getGrantedPermissions',
          },
   })) as { id: string };
  console.log('sampleResponse(to gator-snap):', sampleResponse);

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@V00D00-child V00D00-child marked this pull request as ready for review July 11, 2025 19:05
@V00D00-child V00D00-child requested a review from a team as a code owner July 11, 2025 19:05
@V00D00-child V00D00-child changed the title [DRAFT] Add new permissionsProvider_getGrantedPermissions RPC Add new permissionsProvider_getGrantedPermissions RPC Jul 11, 2025
MoMannn
MoMannn previously approved these changes Jul 17, 2025
Copy link
Contributor

@MoMannn MoMannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@V00D00-child V00D00-child merged commit 81ec887 into main Jul 17, 2025
16 checks passed
@V00D00-child V00D00-child deleted the feat/expose-rpc-to-metamask-for-fetching-stored-permissions branch July 17, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants