Skip to content

feat(gator-permissions): add Gator Permissions deep link#40995

Closed
mj-kiwi wants to merge 7 commits intomainfrom
feat/gator-permissions-deeplink
Closed

feat(gator-permissions): add Gator Permissions deep link#40995
mj-kiwi wants to merge 7 commits intomainfrom
feat/gator-permissions-deeplink

Conversation

@mj-kiwi
Copy link
Contributor

@mj-kiwi mj-kiwi commented Mar 18, 2026

Description

This PR adds support for the Gator Permissions deep link route, allowing users to navigate directly to the Gator Permissions page with specified parameters. The implementation includes a new route handler that validates and processes type and site query parameters, with comprehensive validation to ensure only valid URLs are passed through.

Key features:

  • New /gator-permissions route with query parameter validation
  • Support for token-transfer type parameter
  • Origin validation using the URL standard API (validates protocol and origin format)
  • Proper error handling for missing or invalid parameters
  • Extensive test coverage for all validation scenarios

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Added Gator Permissions deep link support for token transfer operations

Related issues

Fixes:

Manual testing steps

  1. Build the extension with yarn start:flask or appropriate build command
  2. Navigate to the Gator Permissions page using the deep link: https://link.metamask.io/gator-permissions?type=token-transfer&site=http://localhost:8000
  3. Verify that the page loads correctly with the provided parameters
  4. Test with invalid parameters to ensure proper error handling and fallback behavior

Screenshots/Recordings

Before

After

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.

Note

Low Risk
Low risk: adds a new deep-link route with strict parameter validation and test coverage, with no changes to existing routing behavior beyond registering the new path.

Overview
Adds a new deep link route '/gator-permissions' that resolves to /gator-permissions/:type/:site, validating required type (currently only token-transfer) and site (must be an http/https origin) before constructing the destination path.

Updates i18n strings for the new page title key and registers the route in the deep-link routes index, with comprehensive unit tests covering valid, missing, and invalid query parameter cases.

Extends .github/CODEOWNERS to assign the Delegation team ownership for the new gator-permissions areas.

Written by Cursor Bugbot for commit 3bea1d7. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-delegation MetaMask Delegation Team label Mar 18, 2026
@mj-kiwi mj-kiwi marked this pull request as ready for review March 18, 2026 04:41
@mj-kiwi mj-kiwi requested a review from a team as a code owner March 18, 2026 05:06
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [bdbfb72]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account34827251995382519
total34827251995382519
Confirm Txconfirm_tx6033602260491160356049
total6033602260491160356049
Bridge User Actionsbridge_load_page24819432849270328
bridge_load_asset_picker22118925527248255
bridge_search_token74270376524758765
total1236120912572012571257
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup16121335201112216871810
load13381105163310914141521
domContentLoaded13291100162610914041512
domInteractive3419131232996
firstPaint191771634194235293
backgroundConnect23721031916243269
firstReactRender22135472237
initialActions108114
loadScripts1111875139810711871278
setupStore1586281729
numNetworkReqs393185154076
Power User HomeuiStartup5078198713935207463118346
load13441130199214413961628
domContentLoaded13211124191713713611583
domInteractive45202984935152
firstPaint2239346396291384
backgroundConnect16663287483159725294629
firstReactRender25165062837
initialActions105113
loadScripts1091922164612711321334
setupStore18762102131
numNetworkReqs1698329244190256
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212192232221223
srpButtonToSrpForm9896100299100
confirmSrpToPwForm23232402324
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen61959766827628668
openAccountMenuToAccountListLoaded2917290129441629162944
total3899388039442638933944
Onboarding New WalletcreateWalletToSocialScreen2202192201220220
srpButtonToPwForm1091081101109110
createPwToRecoveryScreen889089
skipBackupToMetricsScreen39374014040
agreeButtonToOnboardingSuccess17161701717
doneButtonToAssetList49748452214503522
total89287291816896918
Asset DetailsassetClickToPriceChart79758338183
total79758338183
Solana Asset DetailsassetClickToPriceChart1117918440124184
total1117918440124184
Import Srp HomeloginToHomeScreen2281224023544322732354
openAccountMenuAfterLogin564068116368
homeAfterImportWithNewWallet2326227723753823502375
total4663461647113947114711
Send TransactionsopenSendPageFromHome492370175870
selectTokenToSendFormLoaded35244483944
reviewTransactionToConfirmationPage1163109612054812051205
total1245114313007213001300
SwapopenSwapPageFromHome1053115043132150
fetchAndDisplaySwapQuotes2696268427121227102712
total2801274328604028162860
🌐 Dapp Page Load Benchmarks

Current Commit: bdbfb72 | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±53ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±61ms) 🟢 | historical mean value: 722ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 93ms (±128ms) 🟢 | historical mean value: 88ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 53ms 1.02s 1.50s 1.09s 1.50s
domContentLoaded 740ms 61ms 714ms 1.29s 777ms 1.29s
firstPaint 93ms 128ms 68ms 1.36s 92ms 1.36s
firstContentfulPaint 93ms 128ms 68ms 1.36s 92ms 1.36s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 8 Bytes (0%)
  • common: 1.18 KiB (0.01%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 18, 2026

✨ Files requiring CODEOWNER review ✨

🔒 @MetaMask/extension-security-team (1 files, +7 -0)
  • 📁 .github/
    • 📄 CODEOWNERS +7 -0

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [3bea1d7]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29126431918300319
total29126431918300319
Confirm Txconfirm_tx6069600161796360886179
total6069600161796360886179
Bridge User Actionsbridge_load_page26421332839280328
bridge_load_asset_picker2031892139208213
bridge_search_token72069774616727746
total1179111312545712391254
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14911259178610215351680
load1235101914818812791385
domContentLoaded1228101414528612741366
domInteractive3018114212788
firstPaint154721243134201297
backgroundConnect22320332116229247
firstReactRender2012110102030
initialActions108114
loadScripts102181712438510711165
setupStore1476881726
numNetworkReqs393184154077
Power User HomeuiStartup5410217413330212465748585
load13331155169312413601618
domContentLoaded13131140167811913341595
domInteractive41203274234108
firstPaint253901630229303410
backgroundConnect208530810081186932425226
firstReactRender25175452732
initialActions105113
loadScripts1083924143511211161356
setupStore1674671935
numNetworkReqs2249434258262331
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182222220222
srpButtonToSrpForm96939719797
confirmSrpToPwForm22222202222
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen65159967429673674
openAccountMenuToAccountListLoaded2918290029381429302938
total3943390939662039593966
Onboarding New WalletcreateWalletToSocialScreen2192172201219220
srpButtonToPwForm1091081101109110
createPwToRecoveryScreen888088
skipBackupToMetricsScreen38383903939
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList57949172293600722
total92171511321379921132
Asset DetailsassetClickToPriceChart685389158489
total685389158489
Solana Asset DetailsassetClickToPriceChart1053717047129170
total1053717047129170
Import Srp HomeloginToHomeScreen24652217282222826382822
openAccountMenuAfterLogin553882156182
homeAfterImportWithNewWallet2233219722823622822282
total48534463534834850015348
Send TransactionsopenSendPageFromHome32264263342
selectTokenToSendFormLoaded31303103131
reviewTransactionToConfirmationPage996760118114810761181
total1068820123814411371238
SwapopenSwapPageFromHome86631131884113
fetchAndDisplaySwapQuotes268426832685126852685
total276527592768427682768

Dapp page load benchmarks: data not available.

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: -6 Bytes (0%)
  • common: 1.17 KiB (0.01%)


const encodedSite = encodeURIComponent(site);
return {
path: `/gator-permissions/${type}/${encodedSite}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is definitely only a nit: should we lean into the public naming /advanced-permissions/ ?

@mj-kiwi
Copy link
Contributor Author

mj-kiwi commented Mar 22, 2026

Due to our decision to use a different approach to display existing permissions MetaMask/snap-7715-permissions#288, we are going to close this PR.

@mj-kiwi mj-kiwi closed this Mar 22, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-M team-delegation MetaMask Delegation Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants