Skip to content

Conversation

hanzel98
Copy link

@hanzel98 hanzel98 commented Sep 24, 2025

Explanation

What is the current state of things and why does it need to change?

The GatorPermissionsController currently provides functionality to fetch, enable, disable, and decode gator permissions, but it lacks the ability to revoke permissions. This missing capability prevents MetaMask clients from providing users with a complete permission management experience where they can not only grant permissions but also revoke them when needed.

What is the solution your changes offer and how does it work?

This PR adds a new submitRevocation action to the GatorPermissionsController that allows consumers (MetaMask clients) to submit permission revocations through the gator permissions provider snap. The implementation:

  • Adds a new RevocationParams type that accepts a delegationHash (hex string) to identify the permission to revoke
  • Implements a submitRevocation method that forwards the revocation request to the gator permissions provider snap using the permissionsProvider_submitRevocation RPC method
  • Includes proper error handling using existing error types (GatorPermissionsNotEnabledError and GatorPermissionsProviderError)
  • Follows the established patterns in the controller for action registration and snap communication

Are there any changes whose purpose might not obvious to those unfamiliar with the domain?

The delegationHash parameter is a unique identifier for ERC-7715 delegations/permissions that allows the snap to locate and revoke the specific permission. This hash-based approach is standard in the ERC-7715 delegation framework for permission management.

References

[Related to ]

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note: The changelog item should be checked off after updating the CHANGELOG.md file, and the last item can be checked as N/A since this is a new feature addition with no breaking changes.

@hanzel98 hanzel98 requested a review from a team as a code owner September 24, 2025 16:32
@hanzel98 hanzel98 self-assigned this Sep 24, 2025
@hanzel98 hanzel98 marked this pull request as draft September 24, 2025 16:40
@hanzel98 hanzel98 force-pushed the chore/revokation-rpc-request branch from de7e505 to 11aa3a1 Compare September 24, 2025 16:43
- Add RevocationParams type with delegationHash field
- Add PermissionProviderSubmitRevocation RPC method enum
- Implement submitRevocation method with proper error handling
- Add comprehensive test suite with 100% coverage
- Export new types in public API

This enables MetaMask clients to submit permission revocations through
the gator permissions provider snap using the permissionsProvider_submitRevocation
RPC method.
@hanzel98 hanzel98 force-pushed the chore/revokation-rpc-request branch from c86dca7 to 1833a20 Compare September 24, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant