CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 137
Proposed addition: validate .data on construction #976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lgtm! |
Would it be useful to export a (Also, I assume this change doesn't obsolete the (Also also, reminder - |
@stephenmcgruer, yes to all of the above... the spec actually does need quite an editorial overhaul. We have various issues like #889, #814, and #767 - so it would be great to actually add more hooks as needed. However, if it's ok, I'd like to do that as a followup to this 🙏 |
Ack, sgtm. I'm happy to send a follow-on PR myself for the bit I care about most (having a |
@dcrousso, the working group is just wrapping up publishing the spec a W3C Recommendation (hopefully in the next 2 weeks). Right after we publish the Recommendation, we will immediately republish the specification with this amendment. |
https://bugs.webkit.org/show_bug.cgi?id=233292 <rdar://problem/85736007> Reviewed by Andy Estes. Source/WebCore: This will allow developers to replace any `ApplePaySession.supportsVersion` check(s) by attempting to create a `PaymentRequest` object with data specific to Apple Pay. This is actually an improvement, because it'll also allow developers to catch most errors in that data earlier, as previously any errors would only be thrown when `show()` is called. Spec: <w3c/payment-request#976> Test: http/tests/ssl/applepay/PaymentRequest.https.html * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): * Modules/paymentrequest/PaymentHandler.h: Adjust `PaymentHandler::convertData` to take a `Document` so that additional validation can be performed on the provided payment method(s) (e.g. check the Apple Pay version). * Modules/applepay/PaymentRequestValidator.h: * Modules/applepay/PaymentRequestValidator.mm: (WebCore::PaymentRequestValidator::validate): Allow callers to choose what fields to validate. This is needed because when the `ApplePaySessionPaymentRequest` created/converted when validating the payment method data in the `PaymentRequest` constructor isn't able to get fields from the `PaymentRequest` as it hasn't been created yet. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convertAndValidateApplePayRequest): (WebCore::ApplePayPaymentHandler::convertData): (WebCore::ApplePayPaymentHandler::show): * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.h: * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.cpp: (WebCore::convertAndValidateApplePayAMSUIRequest): (WebCore::ApplePayAMSUIPaymentHandler::convertData): LayoutTests: * http/tests/ssl/applepay/PaymentRequest.https.html: * http/tests/ssl/applepay/PaymentRequest.https-expected.txt: Canonical link: https://commits.webkit.org/244794@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Landed in WebKit https://trac.webkit.org/changeset/286452/webkit .... still blocked on REC progress. 🔜 |
https://bugs.webkit.org/show_bug.cgi?id=233292 <rdar://problem/85736007> Reviewed by Andy Estes. Source/WebCore: This will allow developers to replace any `ApplePaySession.supportsVersion` check(s) by attempting to create a `PaymentRequest` object with data specific to Apple Pay. This is actually an improvement, because it'll also allow developers to catch most errors in that data earlier, as previously any errors would only be thrown when `show()` is called. Spec: <w3c/payment-request#976> Test: http/tests/ssl/applepay/PaymentRequest.https.html * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): * Modules/paymentrequest/PaymentHandler.h: Adjust `PaymentHandler::convertData` to take a `Document` so that additional validation can be performed on the provided payment method(s) (e.g. check the Apple Pay version). * Modules/applepay/PaymentRequestValidator.h: * Modules/applepay/PaymentRequestValidator.mm: (WebCore::PaymentRequestValidator::validate): Allow callers to choose what fields to validate. This is needed because when the `ApplePaySessionPaymentRequest` created/converted when validating the payment method data in the `PaymentRequest` constructor isn't able to get fields from the `PaymentRequest` as it hasn't been created yet. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convertAndValidateApplePayRequest): (WebCore::ApplePayPaymentHandler::convertData): (WebCore::ApplePayPaymentHandler::show): * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.h: * Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.cpp: (WebCore::convertAndValidateApplePayAMSUIRequest): (WebCore::ApplePayAMSUIPaymentHandler::convertData): LayoutTests: * http/tests/ssl/applepay/PaymentRequest.https.html: * http/tests/ssl/applepay/PaymentRequest.https-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This reverts commit b6b0630.
closes #975
The following tasks have been completed:
Modified Web platform tests- not testable, as it's for proprietary/arbitrary method data types.Implementation commitment:
Optional, impact on Payment Handler spec?
Preview | Diff
Preview | Diff