Bug 1854550 - pt 10. Allow LOG() with zero extra arguments r=glandium
[gecko.git] / dom / webauthn / nsIWebAuthnService.idl
blob65f4a6ddd18b9b46e5f404131dae599ec92e53fa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
7 #include "nsIWebAuthnArgs.idl"
8 #include "nsIWebAuthnPromise.idl"
10 [scriptable, uuid(6c4ecd9f-57c0-4d7d-8080-bf6e4d499f8f)]
11 interface nsICredentialParameters : nsISupports
13 readonly attribute ACString credentialId;
14 readonly attribute bool isResidentCredential;
15 readonly attribute ACString rpId;
16 readonly attribute ACString privateKey;
17 readonly attribute ACString userHandle;
18 readonly attribute uint32_t signCount;
22 [scriptable, uuid(e236a9b4-a26f-11ed-b6cc-07a9834e19b1)]
23 interface nsIWebAuthnService : nsISupports
25 void makeCredential(
26 in uint64_t aTransactionId,
27 in uint64_t browsingContextId,
28 in nsIWebAuthnRegisterArgs args,
29 in nsIWebAuthnRegisterPromise promise);
31 void getAssertion(
32 in uint64_t aTransactionId,
33 in uint64_t browsingContextId,
34 in nsIWebAuthnSignArgs args,
35 in nsIWebAuthnSignPromise promise);
37 // Cancel the ongoing transaction and any prompts that are shown, but do not reject
38 // its promise. This is used by the IPC parent when it receives an abort signal.
39 // The IPC child has already rejected the promises at this point.
40 [noscript] void reset();
42 // Cancel the ongoing transaction. Reject its promise, but do not cancel
43 // prompts. This is used by WebAuthnPromptHelper when the user hits the
44 // "cancel" button.
45 void cancel(in uint64_t aTransactionId);
47 void pinCallback(in uint64_t aTransactionId, in ACString aPin);
48 void resumeMakeCredential(in uint64_t aTransactionId, in bool aForceNoneAttestation);
49 void selectionCallback(in uint64_t aTransactionId, in uint64_t aIndex);
51 // Adds a virtual (software) authenticator for use in tests (particularly
52 // tests run via WebDriver). See
53 // https://w3c.github.io/webauthn/#sctn-automation-add-virtual-authenticator.
54 uint64_t addVirtualAuthenticator(
55 in ACString protocol,
56 in ACString transport,
57 in bool hasResidentKey,
58 in bool hasUserVerification,
59 in bool isUserConsenting,
60 in bool isUserVerified);
62 // Removes a previously-added virtual authenticator, as identified by its
63 // id. See
64 // https://w3c.github.io/webauthn/#sctn-automation-remove-virtual-authenticator
65 void removeVirtualAuthenticator(in uint64_t authenticatorId);
67 // Adds a credential to a previously-added authenticator. See
68 // https://w3c.github.io/webauthn/#sctn-automation-add-credential
69 void addCredential(
70 in uint64_t authenticatorId,
71 in ACString credentialId,
72 in bool isResidentCredential,
73 in ACString rpId,
74 in ACString privateKey,
75 in ACString userHandle,
76 in uint32_t signCount);
78 // Gets all credentials that have been added to a virtual authenticator.
79 // See https://w3c.github.io/webauthn/#sctn-automation-get-credentials
80 Array<nsICredentialParameters> getCredentials(in uint64_t authenticatorId);
82 // Removes a credential from a virtual authenticator. See
83 // https://w3c.github.io/webauthn/#sctn-automation-remove-credential
84 void removeCredential(in uint64_t authenticatorId, in ACString credentialId);
86 // Removes all credentials from a virtual authenticator. See
87 // https://w3c.github.io/webauthn/#sctn-automation-remove-all-credentials
88 void removeAllCredentials(in uint64_t authenticatorId);
90 // Sets the "isUserVerified" bit on a virtual authenticator. See
91 // https://w3c.github.io/webauthn/#sctn-automation-set-user-verified
92 void setUserVerified(in uint64_t authenticatorId, in bool isUserVerified);