feat: incoming message origin validation for react native - #477
feat: incoming message origin validation for react native#477michaeljsXu wants to merge 9 commits into
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| } | ||
|
|
||
| if (config.hasKey("allowedMessageOrigins")) { | ||
| configuration.setAllowedMessageOrigins(toStringSet(config.getArray("allowedMessageOrigins"))); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
4fc84ea to
3d231ce
Compare
a5483f8 to
f5614eb
Compare
f3cbfbc to
a23236f
Compare
f5614eb to
3be5ff9
Compare
a23236f to
7a8303d
Compare
3be5ff9 to
3c1706a
Compare
7a8303d to
194c4cb
Compare
3c1706a to
336928d
Compare
194c4cb to
9b666d9
Compare
336928d to
6032726
Compare
9b666d9 to
a989701
Compare
c05fb85 to
eb60315
Compare
a989701 to
3f57e0a
Compare
eb60315 to
1f34aef
Compare
3f57e0a to
11a49d2
Compare
1f34aef to
4b6d715
Compare
3c28064 to
2110ba0
Compare
4b6d715 to
48ff991
Compare
2110ba0 to
c94b042
Compare
48ff991 to
5af0ce4
Compare

What changes are you making?
Expose
allowedMessageOriginsand a typedonMessageRejectedcallback 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 byteardown().Both native bridges emit the same
{origin, message, reason}payload, andgetConfig()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