148 lines
6.4 KiB
Diff
148 lines
6.4 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Sun, 4 Sep 2022 18:47:58 +0200
|
|
Subject: Re-introduce kWebAuthCable
|
|
|
|
This reverts commit ebfd987a57bf4a58588760e8a4342b4fffef36f2.
|
|
|
|
Feature is disabled by default.
|
|
|
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
|
---
|
|
.../authenticator_dialog_view_browsertest.cc | 7 +++++++
|
|
.../webauthn/authenticator_dialog_browsertest.cc | 7 +++++++
|
|
.../webauthn/chrome_webauthn_browsertest.cc | 2 ++
|
|
.../webauth/authenticator_impl_unittest.cc | 15 +++++++++++++--
|
|
content/public/common/content_features.cc | 7 +++++++
|
|
content/public/common/content_features.h | 1 +
|
|
6 files changed, 37 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
|
|
--- a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
|
|
+++ b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
|
|
@@ -111,6 +111,12 @@ class TestSheetView : public AuthenticatorRequestSheetView {
|
|
|
|
class AuthenticatorDialogViewTest : public DialogBrowserTest {
|
|
public:
|
|
+ void SetUp() override {
|
|
+ // Enable all upcoming features to excerise them for tests.
|
|
+ scoped_feature_list_.InitWithFeatures({features::kWebAuthCable}, {});
|
|
+ DialogBrowserTest::SetUp();
|
|
+ }
|
|
+
|
|
// DialogBrowserTest:
|
|
void ShowUi(const std::string& name) override {
|
|
dialog_model_ = std::make_unique<AuthenticatorRequestDialogModel>(
|
|
@@ -173,6 +179,7 @@ class AuthenticatorDialogViewTest : public DialogBrowserTest {
|
|
}
|
|
}
|
|
|
|
+ base::test::ScopedFeatureList scoped_feature_list_;
|
|
std::unique_ptr<AuthenticatorRequestDialogModel> dialog_model_;
|
|
};
|
|
|
|
diff --git a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc
|
|
--- a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc
|
|
+++ b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc
|
|
@@ -49,6 +49,12 @@ class AuthenticatorDialogTest : public DialogBrowserTest,
|
|
AuthenticatorDialogTest(const AuthenticatorDialogTest&) = delete;
|
|
AuthenticatorDialogTest& operator=(const AuthenticatorDialogTest&) = delete;
|
|
|
|
+ void SetUp() override {
|
|
+ // Enable all upcoming features so that people can see the UI.
|
|
+ scoped_feature_list_.InitWithFeatures({features::kWebAuthCable}, {});
|
|
+ DialogBrowserTest::SetUp();
|
|
+ }
|
|
+
|
|
// DialogBrowserTest:
|
|
void ShowUi(const std::string& test_name) override {
|
|
// Strip trailing feature param state.
|
|
@@ -353,6 +359,7 @@ class AuthenticatorDialogTest : public DialogBrowserTest,
|
|
std::unique_ptr<AuthenticatorRequestDialogModel> model_;
|
|
base::RepeatingTimer timer_;
|
|
int bio_samples_remaining_ = 5;
|
|
+ base::test::ScopedFeatureList scoped_feature_list_;
|
|
};
|
|
|
|
INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(AuthenticatorDialogTest);
|
|
diff --git a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc
|
|
--- a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc
|
|
+++ b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc
|
|
@@ -493,6 +493,7 @@ IN_PROC_BROWSER_TEST_F(WebAuthnCableExtension, ServerLinkExperiments) {
|
|
class WebAuthnCableSecondFactor : public WebAuthnBrowserTest {
|
|
public:
|
|
WebAuthnCableSecondFactor() {
|
|
+ scoped_feature_list_.InitWithFeatures({features::kWebAuthCable}, {});
|
|
// This makes it a little easier to compare against.
|
|
trace_ << std::endl;
|
|
}
|
|
@@ -753,6 +754,7 @@ class WebAuthnCableSecondFactor : public WebAuthnBrowserTest {
|
|
};
|
|
|
|
protected:
|
|
+ base::test::ScopedFeatureList scoped_feature_list_;
|
|
std::ostringstream trace_;
|
|
AuthenticatorRequestDialogModel* model_ = nullptr;
|
|
};
|
|
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc
|
|
--- a/content/browser/webauth/authenticator_impl_unittest.cc
|
|
+++ b/content/browser/webauth/authenticator_impl_unittest.cc
|
|
@@ -1222,7 +1222,12 @@ TEST_F(AuthenticatorImplTest, OversizedCredentialId) {
|
|
}
|
|
}
|
|
|
|
-TEST_F(AuthenticatorImplTest, NoSilentAuthenticationForCable) {
|
|
+class AuthenticatorImplCableFlagSetTest : public AuthenticatorImplTest {
|
|
+ private:
|
|
+ base::test::ScopedFeatureList scoped_feature_list_{features::kWebAuthCable};
|
|
+};
|
|
+
|
|
+TEST_F(AuthenticatorImplCableFlagSetTest, NoSilentAuthenticationForCable) {
|
|
// https://crbug.com/954355
|
|
NavigateAndCommit(GURL(kTestOrigin1));
|
|
|
|
@@ -3048,7 +3053,13 @@ TEST_F(AuthenticatorContentBrowserClientTest, FilteringFailsOpen) {
|
|
AuthenticatorStatus::SUCCESS);
|
|
}
|
|
|
|
-TEST_F(AuthenticatorContentBrowserClientTest,
|
|
+class AuthenticatorContentBrowserClientWithCableFlagTest
|
|
+ : public AuthenticatorContentBrowserClientTest {
|
|
+ private:
|
|
+ base::test::ScopedFeatureList scoped_feature_list_{features::kWebAuthCable};
|
|
+};
|
|
+
|
|
+TEST_F(AuthenticatorContentBrowserClientWithCableFlagTest,
|
|
MakeCredentialRequestStartedCallback) {
|
|
NavigateAndCommit(GURL(kTestOrigin1));
|
|
mojo::Remote<blink::mojom::Authenticator> authenticator =
|
|
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
|
--- a/content/public/common/content_features.cc
|
|
+++ b/content/public/common/content_features.cc
|
|
@@ -1319,6 +1319,13 @@ BASE_FEATURE(kWebAssemblyTrapHandler,
|
|
#endif
|
|
);
|
|
|
|
+// Controls whether CTAP2 devices can communicate via the WebAuthentication API
|
|
+// using pairingless BLE protocol.
|
|
+// https://w3c.github.io/webauthn
|
|
+BASE_FEATURE(kWebAuthCable,
|
|
+ "WebAuthenticationCable", // must be disabled
|
|
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default in Bromite
|
|
+
|
|
// Controls whether WebAuthn conditional UI requests are supported.
|
|
BASE_FEATURE(kWebAuthConditionalUI,
|
|
"WebAuthenticationConditionalUI",
|
|
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
|
|
--- a/content/public/common/content_features.h
|
|
+++ b/content/public/common/content_features.h
|
|
@@ -308,6 +308,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebOtpBackendAuto);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebPayments);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcUseGpuMemoryBufferVideoFrames);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUICodeCache);
|
|
+CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebAuthCable);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUsb);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebXr);
|
|
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebXrArModule);
|
|
--
|
|
2.25.1
|