Skip to content

fix: Add wallet_snap permission middleware#39805

Merged
Mrtenz merged 2 commits intogr/bump-snaps-v142from
mrtenz/add-middleware
Feb 5, 2026
Merged

fix: Add wallet_snap permission middleware#39805
Mrtenz merged 2 commits intogr/bump-snaps-v142from
mrtenz/add-middleware

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Feb 4, 2026

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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

Medium Risk
Touches the RPC middleware stack and permission gating for snaps, so ordering/compatibility issues could block or mis-handle snap requests, but the change is small and localized.

Overview
Adds the wallet_snap permission middleware into the background JSON-RPC engine by importing createWalletSnapPermissionMiddleware from @metamask/snaps-rpc-methods and pushing it onto the engine.

Wraps the new middleware with asLegacyMiddleware (from @metamask/json-rpc-engine/v2) and installs it before the legacy eth_accounts handler and the main permission middleware, ensuring wallet_snap permission checks run early in the request pipeline.

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

Cursor Bugbot reviewed your changes and found no issues for commit bba6809

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 4, 2026

Builds ready [bba6809]
📊 Page Load Benchmark Results

Current Commit: bba6809 | Date: 2/4/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±51ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±49ms) 🟢 | historical mean value: 723ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 51ms 1.01s 1.32s 1.07s 1.32s
domContentLoaded 725ms 49ms 699ms 1.00s 753ms 1.00s
firstPaint 78ms 13ms 64ms 200ms 84ms 200ms
firstContentfulPaint 78ms 13ms 64ms 200ms 84ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@Mrtenz Mrtenz merged commit 84fc525 into gr/bump-snaps-v142 Feb 5, 2026
57 of 182 checks passed
@Mrtenz Mrtenz deleted the mrtenz/add-middleware branch February 5, 2026 09:40
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants