Skip to content

feat: incoming message origin validation for react native - #477

Draft
michaeljsXu wants to merge 9 commits into
mainfrom
07-15-feat_incoming_message_origin_validation_for_react_native
Draft

feat: incoming message origin validation for react native#477
michaeljsXu wants to merge 9 commits into
mainfrom
07-15-feat_incoming_message_origin_validation_for_react_native

Conversation

@michaeljsXu

@michaeljsXu michaeljsXu commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

Expose allowedMessageOrigins and a typed onMessageRejected callback through the React Native API. The callback remains in JavaScript while serializable configuration crosses the native bridge, supports replacement and removal, and is cleaned up by teardown().

Both native bridges emit the same {origin, message, reason} payload, and getConfig() round-trips configured origins and the current JavaScript callback.

How to test

From platforms/react-native:

pnpm test modules/@shopify/checkout-kit-react-native/tests/index.test.ts --runInBand
pnpm module typecheck
pnpm module api:dump

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Jul 15, 2026

michaeljsXu commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

}

if (config.hasKey("allowedMessageOrigins")) {
configuration.setAllowedMessageOrigins(toStringSet(config.getArray("allowedMessageOrigins")));

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.

It looks like both native SDKs are still pinned to 4.0.0-alpha.2, which predates the APIs used by the Android and iOS bridges in this PR. Could we update both pins once compatible native releases are available so normal consumer builds pick up these APIs?

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.

This still depends on compatible native SDK releases. I am keeping this PR in draft and leaving the thread open until both exact pins can be updated and normal dependency resolution passes.

@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 4fc84ea to 3d231ce Compare July 31, 2026 11:43
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch 2 times, most recently from a5483f8 to f5614eb Compare July 31, 2026 13:16
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch 2 times, most recently from f3cbfbc to a23236f Compare July 31, 2026 13:41
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from f5614eb to 3be5ff9 Compare July 31, 2026 13:41
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from a23236f to 7a8303d Compare August 3, 2026 11:55
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 3be5ff9 to 3c1706a Compare August 3, 2026 11:55
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 7a8303d to 194c4cb Compare August 3, 2026 12:12
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 3c1706a to 336928d Compare August 3, 2026 12:12
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 194c4cb to 9b666d9 Compare August 3, 2026 12:16
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 336928d to 6032726 Compare August 3, 2026 12:16
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 9b666d9 to a989701 Compare August 3, 2026 14:42
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch 2 times, most recently from c05fb85 to eb60315 Compare August 3, 2026 15:40
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from a989701 to 3f57e0a Compare August 3, 2026 15:40
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from eb60315 to 1f34aef Compare August 3, 2026 15:43
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 3f57e0a to 11a49d2 Compare August 3, 2026 15:43
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 1f34aef to 4b6d715 Compare August 4, 2026 11:45
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch 2 times, most recently from 3c28064 to 2110ba0 Compare August 5, 2026 10:27
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 4b6d715 to 48ff991 Compare August 5, 2026 10:27
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_ios branch from 2110ba0 to c94b042 Compare August 5, 2026 12:44
@tiagocandido
tiagocandido force-pushed the 07-15-feat_incoming_message_origin_validation_for_react_native branch from 48ff991 to 5af0ce4 Compare August 5, 2026 12:44
Base automatically changed from 07-15-feat_incoming_message_origin_validation_for_ios to main August 5, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants