Bug 1819713 - remove PublicKeyCredential::IsExternalCTAP2SecurityKeySupported. r=keeler,webidl,smaug

Telemetry shows no use of this method since it was deprecated in 121.

Differential Revision: https://phabricator.services.mozilla.com/D200738
This commit is contained in:
John Schanck 2024-02-06 20:59:18 +00:00
parent 2344d3ba26
commit db62ec84ae
5 changed files with 0 additions and 71 deletions

View File

@ -18,10 +18,6 @@
#include "mozilla/dom/WebAuthnManager.h"
#include "nsCycleCollectionParticipant.h"
#ifdef XP_WIN
# include "WinWebAuthnService.h"
#endif
#ifdef MOZ_WIDGET_ANDROID
# include "mozilla/MozPromise.h"
# include "mozilla/java/GeckoResultNatives.h"
@ -147,31 +143,6 @@ already_AddRefed<Promise> PublicKeyCredential::IsConditionalMediationAvailable(
return promise.forget();
}
/* static */
already_AddRefed<Promise>
PublicKeyCredential::IsExternalCTAP2SecurityKeySupported(GlobalObject& aGlobal,
ErrorResult& aError) {
RefPtr<Promise> promise =
Promise::Create(xpc::CurrentNativeGlobal(aGlobal.Context()), aError);
if (aError.Failed()) {
return nullptr;
}
#ifdef XP_WIN
if (WinWebAuthnService::AreWebAuthNApisAvailable()) {
promise->MaybeResolve(true);
} else {
promise->MaybeResolve(StaticPrefs::security_webauthn_ctap2());
}
#elif defined(MOZ_WIDGET_ANDROID)
promise->MaybeResolve(false);
#else
promise->MaybeResolve(StaticPrefs::security_webauthn_ctap2());
#endif
return promise.forget();
}
void PublicKeyCredential::GetClientExtensionResults(
AuthenticationExtensionsClientOutputs& aResult) {
aResult = mClientExtensionOutputs;

View File

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

View File

@ -66,8 +66,6 @@ skip-if = [
"win11_2009", # Bug 1718296 (Windows 10 1903+ has its own window and U2F that we cannot control with tests.)
]
["test_webauthn_isexternalctap2securitykeysupported.html"]
["test_webauthn_isplatformauthenticatoravailable.html"]
["test_webauthn_loopback.html"]

View File

@ -1,30 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<head>
<title>Test for W3C Web Authentication isExternalCTAP2SecurityKeySupported</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="u2futil.js"></script>
<script type="text/javascript" src="pkijs/common.js"></script>
<script type="text/javascript" src="pkijs/asn1.js"></script>
<script type="text/javascript" src="pkijs/x509_schema.js"></script>
<script type="text/javascript" src="pkijs/x509_simpl.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<h1>Test for W3C Web Authentication isExternalCTAP2SecurityKeySupported</h1>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1526023">Mozilla Bug 1526023</a>
<script class="testbody" type="text/javascript">
"use strict";
add_task(async function test_external_key_support() {
PublicKeyCredential.isExternalCTAP2SecurityKeySupported()
.then(aResult => ok(true, `Should always return either true or false: ${aResult}`))
.catch(aProblem => ok(false, `We shouldn't get here: ${aProblem}`))
});
</script>
</body>
</html>

View File

@ -78,13 +78,6 @@ partial interface PublicKeyCredential {
[NewObject] static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable();
};
[SecureContext]
partial interface PublicKeyCredential {
// isExternalCTAP2SecurityKeySupported will be removed in Bug 1819713.
[NewObject, Deprecated="IsExternalCTAP2SecurityKeySupported"]
static Promise<boolean> isExternalCTAP2SecurityKeySupported();
};
[SecureContext]
partial interface PublicKeyCredential {
[Throws, Pref="security.webauthn.enable_json_serialization_methods"] static PublicKeyCredentialCreationOptions parseCreationOptionsFromJSON(PublicKeyCredentialCreationOptionsJSON options);