-
-
Notifications
You must be signed in to change notification settings - Fork 252
New Action on the GatorPermissionsController to Allow the Consumer to SubmitRevocation #6713
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
base: main
Are you sure you want to change the base?
Conversation
…he consumer to submitRevocation
de7e505 to
11aa3a1
Compare
- 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.
c86dca7 to
1833a20
Compare
595f36d to
0a44e3c
Compare
da91f33 to
61b8900
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add changes to CHANGELOG.md under ## [Unreleased].
| /** | ||
| * Flag indicating whether this permission has been revoked. | ||
| */ | ||
| isRevoked?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about also adding the revocationTxHash and revocationTimestamp/date. Is that meant as an update?
| * @returns A promise that resolves when the listener is set up. | ||
| */ | ||
| public async addPendingRevocation( | ||
| txId: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using RevocationParams but here you are using seperate inputs. Change this also to PendingRevocationParams
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
submitRevocationaction to the GatorPermissionsController that allows consumers (MetaMask clients) to submit permission revocations through the gator permissions provider snap. The implementation:RevocationParamstype that accepts adelegationHash(hex string) to identify the permission to revokesubmitRevocationmethod that forwards the revocation request to the gator permissions provider snap using thepermissionsProvider_submitRevocationRPC methodGatorPermissionsNotEnabledErrorandGatorPermissionsProviderError)Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
The
delegationHashparameter 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 ]
This PR depends on this other PR of the permissions-controller #6713
Checklist
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.
Note
Adds
submitRevocationandaddPendingRevocationwith transaction event handling, and supports optional filters when fetching permissions.submitRevocation(revocationParams)to forwardpermissionsProvider_submitRevocationto the Snap with errors surfaced viaGatorPermissionsProviderError.addPendingRevocation(txId, permissionContext)that listens forTransactionControllerterminal events and times out after 2h to submit revocations on confirmation.paramsinfetchAndUpdateGatorPermissionsand pass through to Snap request.transactionConfirmed/Failed/Droppedevents.RevocationParamsandPermissionProviderSubmitRevocationtoGatorPermissionsSnapRpcMethod.StoredGatorPermission{,Sanitized}with optionalisRevoked.indexand controller typings.submitRevocation, andaddPendingRevocation(confirmed/failed/dropped/timeout/error paths).