Repository navigation
feat: Add originMetadata to requests - #4093
Merged
Merged
Conversation
FrederikBolding
force-pushed
the
fb/add-origin-metadata
branch
from
August 5, 2026 10:14
a7d0d59 to
992ae4b
Compare
FrederikBolding
force-pushed
the
fb/add-origin-metadata
branch
from
August 5, 2026 10:42
157e037 to
5a770b9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4093 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 428 429 +1
Lines 12485 12495 +10
Branches 1975 1976 +1
=======================================
+ Hits 12310 12320 +10
Misses 175 175 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GuillaumeRx
reviewed
Aug 7, 2026
| case HandlerType.OnActive: | ||
| case HandlerType.OnInactive: | ||
| return { origin }; | ||
| return { origin, originMetadata }; |
Contributor
There was a problem hiding this comment.
Why do we get originMetadata on these ? 🤔
Member
Author
There was a problem hiding this comment.
I was thinking in case we ever allow installation/update of Snaps on mobile, we would want to pass originMetadata there as well. Though we could remove this for now.
Contributor
There was a problem hiding this comment.
I don't mind keeping it, that makes sense
GuillaumeRx
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an
originMetadatafield to handlers arguments that also containorigin. This should only be used when the origin is using a non-verifiable transport.https://consensyssoftware.atlassian.net/browse/WPC-1195
Note
Medium Risk
Touches the full inbound RPC path to Snaps and expands handler APIs; behavior is backward-compatible (optional field, null default) but Snaps may start relying on self-reported origin data for UX or policy.
Overview
Introduces
OriginMetadatainsnaps-sdk(transport,selfReportedOrigin) and threads optionaloriginMetadatafrom multichain routing andSnapControllerthroughExecutionServiceinto the snap executor.Snap handlers that already receive
originnow also getoriginMetadata: OriginMetadata | null(defaults tonullwhen omitted):onRpcRequest,onKeyringRequest,onProtocolRequest, and lifecycle hooks (onInstall,onUpdate,onStart,onActive,onInactive). JSDoc states this is for transports that cannot verify the origin.SnapRpcHookArgs,snapRpcvalidation, andgetHandlerArgumentsare updated accordingly; simulation/jest expectations includeoriginMetadata: nullwhen not provided. Browser tests cover passing metadata through multiple handler types.Reviewed by Cursor Bugbot for commit ff3d47c. Bugbot is set up for automated code reviews on this repo. Configure here.