Centralize Swift checkout message ingress validation - #644
Open
markmur wants to merge 1 commit into
Open
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
markmur
force-pushed
the
swift-message-rejection-lifecycle
branch
from
August 14, 2026 11:44
63d2a15 to
ac84d8f
Compare
markmur
marked this pull request as ready for review
August 14, 2026 11:47
This was referenced Aug 14, 2026
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
markmur
force-pushed
the
swift-message-rejection-lifecycle
branch
from
August 18, 2026 13:02
ac84d8f to
ee4b8b8
Compare
markmur
force-pushed
the
swift-message-rejection-lifecycle
branch
from
August 18, 2026 13:25
ee4b8b8 to
56fd72d
Compare
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.

What changes are you making?
This PR centralizes Swift message admission behind an internal
CheckoutMessageIngressPolicy.Incoming WebKit messages now pass through an internal
CheckoutMessageIngressPolicybefore reaching the checkout protocol client:The WebKit-specific overload adapts authenticated frame, origin, and request URL metadata into the policy's transport-neutral
IncomingCheckoutMessagemodel. The core evaluator remains independently testable, while the WebView call site no longer assembles admission metadata itself.The policy validates that metadata before a message reaches the checkout protocol client. Keeping this decision at the native WebView boundary means the protocol client can focus on handling admitted checkout protocol messages rather than transport trust.
Rejection behavior
A rejected message means that specific input was not trusted. It does not mean the checkout session failed: checkout may be displaying an external surface that also posts messages, and unrelated page activity must not be able to terminate an otherwise healthy checkout. The rejection branch logs the warning inline and returns before protocol processing begins.
PreloadStateto.failedor evict the preload.CheckoutErroror call.onFail/checkoutDidFail(error:).Consumer API
Consumers only configure the origins they trust. The existing lifecycle APIs remain reserved for actual checkout failures:
There is no message-rejection subscription. Rejections remain an internal security signal that is warning-logged and dropped.
React Native consumer API
No React Native event or callback is added. Rejected native messages are warning-logged and dropped; they do not dispatch
onFail:Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)