Backed out 4 changesets (bug 1879154) for causing bustage on nsUserCharacteristics...
[gecko.git] / dom / webidl / CredentialManagement.webidl
blobcc67bf5f15f4189cbf80678552e0605dd0b886d7
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://w3c.github.io/webappsec-credential-management/
8  * and
9  * https://w3c.github.io/webauthn/
10  * and
11  * https://fedidcg.github.io/FedCM/
12  */
14 [Exposed=Window, SecureContext]
15 interface Credential {
16   readonly attribute USVString id;
17   readonly attribute DOMString type;
20 [Exposed=Window, SecureContext]
21 interface CredentialsContainer {
22   [NewObject]
23   Promise<Credential?> get(optional CredentialRequestOptions options = {});
24   [NewObject]
25   Promise<Credential?> create(optional CredentialCreationOptions options = {});
26   [NewObject]
27   Promise<Credential> store(Credential credential);
28   [NewObject]
29   Promise<undefined> preventSilentAccess();
32 dictionary CredentialRequestOptions {
33   CredentialMediationRequirement mediation = "optional";
34   AbortSignal signal;
35   // This is taken from the partial definition in
36   // https://w3c.github.io/webauthn/#sctn-credentialrequestoptions-extension
37   [Pref="security.webauth.webauthn"]
38   PublicKeyCredentialRequestOptions publicKey;
39   // This is taken from the partial definition in
40   // https://fedidcg.github.io/FedCM/#browser-api-credential-request-options
41   [Pref="dom.security.credentialmanagement.identity.enabled"]
42   IdentityCredentialRequestOptions identity;
45 enum CredentialMediationRequirement {
46   "silent",
47   "optional",
48   "conditional",
49   "required"
52 dictionary CredentialCreationOptions {
53   // This is taken from the partial definition in
54   // https://w3c.github.io/webauthn/#sctn-credentialcreationoptions-extension
55   [Pref="security.webauth.webauthn"]
56   PublicKeyCredentialCreationOptions publicKey;
57   AbortSignal signal;