Digital Credentials: ignore unknown digital credential types#55603
Conversation
|
EWS run on previous version of this PR (hash fe794ee) Details
|
fe794ee to
fa884f4
Compare
|
EWS run on previous version of this PR (hash fa884f4) Details |
| case IdentityCredentialProtocol::OrgIsoMdoc: { | ||
| auto result = convertDictionary<MobileDocumentRequest>(*globalObject, request.data.get()); | ||
| if (result.hasException(scope)) [[unlikely]] | ||
| return Exception { ExceptionCode::ExistingExceptionError }; | ||
| return DigitalCredentialRequestTypes { WTF::InPlaceType<MobileDocumentRequest>, result.releaseReturnValue() }; | ||
| return std::optional<UnvalidatedDigitalCredentialRequest> { DigitalCredentialRequestTypes { WTF::InPlaceType<MobileDocumentRequest>, result.releaseReturnValue() } }; |
There was a problem hiding this comment.
Do we really need all this wrapper boilerplate?
There was a problem hiding this comment.
Managed to minimize some of the boilerplate. But yes, need some because ExceptionOr expects it to be fairly explicit.
| PASS navigator.credentials.get() API rejects if there are no credential request for same-origin iframe. | ||
| FAIL navigator.credentials.get() API rejects if there are no credential request for same-origin iframe. promise_rejects_js: function "function() { throw e; }" threw object "NotAllowedError: The document is not focused." ("NotAllowedError") expected instance of function "function TypeError() { | ||
| [native code] | ||
| }" ("TypeError") |
There was a problem hiding this comment.
Seems like the test should be fixed?
There was a problem hiding this comment.
I'll take a look, but I'm pretty sure this is https://bugs.webkit.org/show_bug.cgi?id=278553 😢
There was a problem hiding this comment.
Yeah, the test is doing the right thing... it's calling focus()... just WebKit is not focusing it :/
fa884f4 to
5375ea2
Compare
|
EWS run on previous version of this PR (hash 5375ea2) Details
|
5375ea2 to
620d14f
Compare
|
EWS run on previous version of this PR (hash 620d14f) Details
|
620d14f to
0c1a8a5
Compare
|
EWS run on previous version of this PR (hash 0c1a8a5) Details
|
0c1a8a5 to
22fef8b
Compare
|
EWS run on current version of this PR (hash 22fef8b) Details |
rdar://166673454 https://bugs.webkit.org/show_bug.cgi?id=304158 Reviewed by Anne van Kesteren. WebKit relied on the IdentityCredentialProtocol.idl enum to prevent requests with unknown protocols being processed. However, this prevented unknown protocols from being ignored gracefully, as required by this spec change: w3c-fedid/digital-credentials#372 We now gracefully ignore unknown protocols by filtering them out, rather than throwing an error. We also now show a console warning, so developers are aware of ignored protocols. Includes upstream web platform test commit: web-platform-tests/wpt@2d00123 Tests: http/tests/digital-credentials/digital-credential-console-messages.https.html http/wpt/identity/digital-credential-protocol-filtering.https.html * LayoutTests/http/tests/digital-credentials/digital-credential-console-messages.https-expected.txt: Added. * LayoutTests/http/tests/digital-credentials/digital-credential-console-messages.https.html: Added. * LayoutTests/http/wpt/identity/digital-credential-protocol-filtering.https-expected.txt: Added. * LayoutTests/http/wpt/identity/digital-credential-protocol-filtering.https.html: Added. * LayoutTests/imported/w3c/web-platform-tests/digital-credentials/create.tentative.https.html: * LayoutTests/imported/w3c/web-platform-tests/digital-credentials/get.tentative.https.html: * LayoutTests/imported/w3c/web-platform-tests/digital-credentials/support/helper.js: * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/ios-18/TestExpectations: * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/ios/imported/w3c/web-platform-tests/digital-credentials/get.tentative.https-expected.txt: * LayoutTests/platform/mac-sequoia/TestExpectations: * LayoutTests/platform/mac-wk1/TestExpectations: * LayoutTests/platform/visionos/TestExpectations: * LayoutTests/platform/win/TestExpectations: * LayoutTests/platform/wpe/TestExpectations: * Source/WebCore/Modules/identity/DigitalCredential.cpp: (WebCore::convertProtocolString): (WebCore::jsToCredentialRequest): (WebCore::DigitalCredential::convertObjectsToDigitalPresentationRequests): * Source/WebCore/Modules/identity/DigitalCredentialRequest.h: * Source/WebCore/Modules/identity/DigitalCredentialRequest.idl: Canonical link: https://commits.webkit.org/305257@main
22fef8b to
b2e1c11
Compare
|
Committed 305257@main (b2e1c11): https://commits.webkit.org/305257@main Reviewed commits have been landed. Closing PR #55603 and removing active labels. |
🛠 ios-apple
b2e1c11
22fef8b
🛠 wpe🛠 win🧪 wpe-wk2🧪 win-tests🧪 api-wpe🧪 gtk-wk2🛠 mac-safer-cpp