From 2e88060e73e3a2ce3bf1238fb11f0363934353eb Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Tue, 13 Sep 2022 14:47:58 +0000 Subject: [PATCH] Bug 1782080 - Generalize preference gates of the Credential Management API, r=dveditz,emilio I'm looking to implement the FedCM browser API, which hooks into the Credentail Management API. Just cleaning up a few preference-gates in webidl and adding new preferences to use as gates. Differential Revision: https://phabricator.services.mozilla.com/D153586 --- dom/webidl/CredentialManagement.webidl | 22 ++++++++++++++++------ modules/libpref/init/StaticPrefList.yaml | 6 ++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dom/webidl/CredentialManagement.webidl b/dom/webidl/CredentialManagement.webidl index 99758d8f1796..55da5376183e 100644 --- a/dom/webidl/CredentialManagement.webidl +++ b/dom/webidl/CredentialManagement.webidl @@ -5,15 +5,19 @@ * * The origin of this IDL file is * https://www.w3.org/TR/credential-management-1/ + * and + * https://w3c.github.io/webauthn/ + * and + * https://fedidcg.github.io/FedCM/ */ -[Exposed=Window, SecureContext, Pref="security.webauth.webauthn"] +[Exposed=Window, SecureContext] interface Credential { readonly attribute USVString id; readonly attribute DOMString type; }; -[Exposed=Window, SecureContext, Pref="security.webauth.webauthn"] +[Exposed=Window, SecureContext] interface CredentialsContainer { [NewObject] Promise get(optional CredentialRequestOptions options = {}); @@ -26,13 +30,19 @@ interface CredentialsContainer { }; dictionary CredentialRequestOptions { - // FIXME: bug 1493860: should this "= {}" be here? - PublicKeyCredentialRequestOptions publicKey = {}; + // This is taken from the partial definition in + // https://w3c.github.io/webauthn/#sctn-credentialrequestoptions-extension + [Pref="security.webauth.webauthn"] + PublicKeyCredentialRequestOptions publicKey; + [Pref="dom.security.credentialmanagement.identity.enabled"] + IdentityCredentialRequestOptions identity; AbortSignal signal; }; dictionary CredentialCreationOptions { - // FIXME: bug 1493860: should this "= {}" be here? - PublicKeyCredentialCreationOptions publicKey = {}; + // This is taken from the partial definition in + // https://w3c.github.io/webauthn/#sctn-credentialcreationoptions-extension + [Pref="security.webauth.webauthn"] + PublicKeyCredentialCreationOptions publicKey; AbortSignal signal; }; diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index a4676b51b112..863cd4e0e987 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3638,6 +3638,12 @@ value: false mirror: always +# pref controls `identity` credentials being exposed +- name: dom.security.credentialmanagement.identity.enabled + type: bool + value: false + mirror: always + # Whether or not selection events on text controls are enabled. - name: dom.select_events.textcontrols.selectionchange.enabled type: bool