Skip to content

feat: add originMetadata to submitRequest - #615

Merged
FrederikBolding merged 13 commits into
mainfrom
fb/add-origin-metadata
Aug 7, 2026
Merged

feat: add originMetadata to submitRequest#615
FrederikBolding merged 13 commits into
mainfrom
fb/add-origin-metadata

Conversation

@FrederikBolding

@FrederikBolding FrederikBolding commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

Add an optional originMetadata field to submitRequest, which will be passed along in keyrings that are using at least platform version 12. This field can be used when using transports where the origin itself isn't verifiable.

https://consensyssoftware.atlassian.net/browse/WPC-1195


Note

Medium Risk
Touches signing request routing and origin attribution across v1/v2 Snap keyrings; incorrect version gating could omit or leak metadata to incompatible Snaps, but behavior is covered by platform-version checks and tests.

Overview
Adds optional originMetadata on keyring submitRequest / KeyringRequest, with transport and selfReportedOrigin, so Snaps can reason about callers when the plain origin is not trustworthy (e.g. WalletConnect).

SnapKeyring and SnapKeyringV1 accept originMetadata and forward it only when the Snap platform is ≥ 12.0.0; older platforms get origin only (7.0.0–11.x) or neither field (< 7.0.0), via new toKeyringRequestWithoutOriginMetadata, submitRequestWithoutOriginMetadata, and updated toKeyringRequestWithoutOrigin (also strips originMetadata). EthKeyringV1Adapter always sends originMetadata: null on internal submits.

Coverage is extended across bridge, internal API, snap client, and v2 SnapKeyring paths.

Reviewed by Cursor Bugbot for commit 8f3bfe8. Bugbot is set up for automated code reviews on this repo. Configure here.

@FrederikBolding FrederikBolding changed the title feat: Add originMetadata to submitRequest feat: add originMetadata to submitRequest Aug 6, 2026
@FrederikBolding
FrederikBolding marked this pull request as ready for review August 6, 2026 14:47
@FrederikBolding
FrederikBolding requested a review from a team as a code owner August 6, 2026 14:47
@FrederikBolding
FrederikBolding force-pushed the fb/add-origin-metadata branch from c080046 to 6556609 Compare August 7, 2026 08:23
@FrederikBolding
FrederikBolding requested a review from ccharly August 7, 2026 08:25

@ccharly ccharly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@FrederikBolding
FrederikBolding added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 63322fc Aug 7, 2026
24 checks passed
@FrederikBolding
FrederikBolding deleted the fb/add-origin-metadata branch August 7, 2026 13:12
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