Bug 1813778 - implement WebAuthn isConditionalMediationAvailable. r=keeler,webidl,saschanaz

Differential Revision: https://phabricator.services.mozilla.com/D188137
This commit is contained in:
John Schanck 2023-09-20 17:33:46 +00:00
Родитель cf93dd51b7
Коммит d15bfcf389
4 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -145,6 +145,19 @@ PublicKeyCredential::IsUserVerifyingPlatformAuthenticatorAvailable(
return promise.forget();
}
/* static */
already_AddRefed<Promise> PublicKeyCredential::IsConditionalMediationAvailable(
GlobalObject& aGlobal, ErrorResult& aError) {
RefPtr<Promise> promise =
Promise::Create(xpc::CurrentNativeGlobal(aGlobal.Context()), aError);
if (aError.Failed()) {
return nullptr;
}
// Support for conditional mediation will be added in Bug 1838932
promise->MaybeResolve(false);
return promise.forget();
}
/* static */
already_AddRefed<Promise>
PublicKeyCredential::IsExternalCTAP2SecurityKeySupported(GlobalObject& aGlobal,

Просмотреть файл

@ -49,6 +49,9 @@ class PublicKeyCredential final : public Credential {
IsUserVerifyingPlatformAuthenticatorAvailable(GlobalObject& aGlobal,
ErrorResult& aError);
static already_AddRefed<Promise> IsConditionalMediationAvailable(
GlobalObject& aGlobal, ErrorResult& aError);
static already_AddRefed<Promise> IsExternalCTAP2SecurityKeySupported(
GlobalObject& aGlobal, ErrorResult& aError);

Просмотреть файл

@ -15,6 +15,7 @@ interface PublicKeyCredential : Credential {
[SameObject, Throws] readonly attribute ArrayBuffer rawId;
[SameObject] readonly attribute AuthenticatorResponse response;
AuthenticationExtensionsClientOutputs getClientExtensionResults();
[NewObject] static Promise<boolean> isConditionalMediationAvailable();
[Throws] object toJSON();
};

Просмотреть файл

@ -1,6 +1,3 @@
[conditional-mediation.https.html]
[Conditional mediation supported]
expected: FAIL
[Conditional mediation not supported]
expected: FAIL