From e24d18cd12dd7270eb3ef74ec4c58085d04d44a2 Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Wed, 14 Sep 2022 02:02:43 +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 9ca61f95e59c..6d5e2fe4a51e 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