feat: Gator Permissions Revocation#37209
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
I have read the CLA Document and I hereby sign the CLA |
app/scripts/controller-init/gator-permissions/gator-permissions-controller-init.ts
Show resolved
Hide resolved
caae5e5 to
d86abc2
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
- @metamask/gator-permissios-controller - @metamask/signature-controller - @metamask/permissions-kernel-controller - @metamask/shielf-controller
d86abc2 to
cda6628
Compare
Builds ready [cda6628]
UI Startup Metrics (1234 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [edb9b9c]
UI Startup Metrics (1207 ± 93 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
@metamaskbot update-policies |
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [74114e7]
UI Startup Metrics (1202 ± 99 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…rPermissions When revoking an already-disabled permission, the hook returns null and setTransactionId(null?.id) sets transactionId to undefined. The useEffect hook now checks that transactionId is defined before attempting navigation to avoid calling navigateToId(undefined).
…k/metamask-extension into feat/add-revocation-flow
Builds ready [5baf41d]
UI Startup Metrics (1175 ± 97 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
davidmurdoch
left a comment
There was a problem hiding this comment.
Policy file changes look good.
As does the metamask-controller.js integration.
I didn't review beyond those domains.
Builds ready [233483c]
UI Startup Metrics (1242 ± 92 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|

Overview
This PR adds a complete revocation flow for gator permissions, including delegation status checking and transaction handling.
Key Changes
1. Enhanced Gator Permissions Controller
isDelegationDisabledfunction to check if a delegation is already disabled on-chainfetchAndUpdateGatorPermissionsto accept optional parameters for filtering2. Background API Integration
callmethod: New API method inmetamask-controller.jsto handleeth_callrequestsTransactionController:transactionConfirmedevent to allowed events3. Delegation Utilities
encodeDisabledDelegationsCheckanddecodeDisabledDelegationsResultfor on-chain delegation status checking4. Revocation Flow Improvements
Changelog
CHANGELOG entry: Enabled revocation flow of advance permissions
Technical Details
Files Modified:
app/scripts/metamask-controller.js: Addedcallmethod for RPC requestsapp/scripts/controller-init/messengers/gator-permissions/gator-permissions-controller-messenger.ts: Added transaction confirmed eventui/store/controller-actions/gator-permissions-controller.ts: Enhanced with delegation checking and improved APIui/hooks/gator-permissions/useRevokeGatorPermissions.ts: Added delegation status checkingshared/lib/delegation/delegation.ts: New delegation utility functionsKey Features:
Testing
Note
Adds full Gator permissions revocation flow with on-chain disabled checks, background/controller APIs, UI hooks, and config/policy updates.
apimethods:addPendingRevocation,submitRevocation, and parameterizedfetchAndUpdateGatorPermissions.checkDelegationDisabledviametamask-controller.js(performseth_call), and wire to NetworkController.transactionConfirmed,transactionFailed,transactionDropped.useRevokeGatorPermissions: resolve network client per permission, pre-check on-chain disabled state, calladdPendingRevocation/submitRevocation, handle batch revocations (filter already-disabled), and navigate on pending confirmation.useGatorPermissions: callfetchAndUpdateGatorPermissions({ isRevoked: false }).addPendingRevocation,submitRevocation,checkDelegationDisabled; updatefetchAndUpdateGatorPermissionsto accept params.encodeDisabledDelegationsCheckanddecodeDisabledDelegationsResultfordisabledDelegations(bytes32)calls.GATOR_PERMISSIONS_REVOCATION_ENABLEDfor Flask build.setTimeout/clearTimeoutfor@metamask/gator-permissions-controller.@metamask/gator-permissions-controllerto^0.4.0(lockfile updated); update@metamask/shield-controller.pendingRevocationsto state shape; e2e navigation adjusted.Written by Cursor Bugbot for commit 233483c. This will update automatically on new commits. Configure here.