Skip to content

feat: add capabilities to keyring endowment#3903

Open
hmalik88 wants to merge 13 commits intomainfrom
hm/add-keyring-capabilities
Open

feat: add capabilities to keyring endowment#3903
hmalik88 wants to merge 13 commits intomainfrom
hm/add-keyring-capabilities

Conversation

@hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Mar 19, 2026

Adding capabilities to the keyring endowment as part of keyring v2 work (https://github.com/MetaMask/decisions/blob/main/decisions/core/0006-keyring-interface.md)


Note

Medium Risk
Expands the endowment:keyring permission/manifest surface with a new validated caveat, which could impact permission granting/validation and downstream keyring behavior if mis-specified or inconsistently interpreted.

Overview
Adds optional capabilities support to the endowment:keyring permission by introducing a new keyringCapabilities caveat, updating the endowment specification/mapper, and exporting getKeyringCaveatCapabilities to read it from permissions.

Updates @metamask/snaps-utils to include SnapCaveatType.KeyringCapabilities plus a new KeyringCapabilitiesStruct/assertIsKeyringCapabilities, and extends manifest validation and SDK InitialPermissions typings to accept a capabilities object under endowment:keyring. Tests and snapshots are updated accordingly (plus minor coverage threshold bump).

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

@hmalik88 hmalik88 changed the title feature: add capabilities to keyring endowment feat: add capabilities to keyring endowment Mar 19, 2026
@socket-security
Copy link

socket-security bot commented Mar 19, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@hmalik88 hmalik88 marked this pull request as ready for review March 20, 2026 15:07
@hmalik88 hmalik88 requested a review from a team as a code owner March 20, 2026 15:07
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.

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.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.56%. Comparing base (17136ba) to head (5f1946d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3903   +/-   ##
=======================================
  Coverage   98.55%   98.56%           
=======================================
  Files         425      425           
  Lines       12358    12381   +23     
  Branches     1935     1938    +3     
=======================================
+ Hits        12180    12203   +23     
  Misses        178      178           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants