Skip to content

Commit ce1d105

Browse files
committed
add Web Authentication types
1 parent 17d343a commit ce1d105

File tree

3 files changed

+283
-0
lines changed

3 files changed

+283
-0
lines changed

baselines/dom.generated.d.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions {
133133
processorOptions?: any;
134134
}
135135

136+
interface AuthenticationExtensionsClientOutputs {
137+
appid?: boolean;
138+
authnSel?: boolean;
139+
exts?: AuthenticationExtensionsSupported;
140+
loc?: Coordinates;
141+
txAuthGeneric?: ArrayBuffer;
142+
txAuthSimple?: string;
143+
uvi?: ArrayBuffer;
144+
uvm?: UvmEntries;
145+
}
146+
136147
interface BiquadFilterOptions extends AudioNodeOptions {
137148
Q?: number;
138149
detune?: number;
@@ -2265,6 +2276,35 @@ declare var AudioWorkletNode: {
22652276
new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode;
22662277
};
22672278

2279+
interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
2280+
readonly authenticatorData: ArrayBuffer;
2281+
readonly signature: ArrayBuffer;
2282+
readonly userHandle: ArrayBuffer | null;
2283+
}
2284+
2285+
declare var AuthenticatorAssertionResponse: {
2286+
prototype: AuthenticatorAssertionResponse;
2287+
new(): AuthenticatorAssertionResponse;
2288+
};
2289+
2290+
interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
2291+
readonly attestationObject: ArrayBuffer;
2292+
}
2293+
2294+
declare var AuthenticatorAttestationResponse: {
2295+
prototype: AuthenticatorAttestationResponse;
2296+
new(): AuthenticatorAttestationResponse;
2297+
};
2298+
2299+
interface AuthenticatorResponse {
2300+
readonly clientDataJSON: ArrayBuffer;
2301+
}
2302+
2303+
declare var AuthenticatorResponse: {
2304+
prototype: AuthenticatorResponse;
2305+
new(): AuthenticatorResponse;
2306+
};
2307+
22682308
interface BarProp {
22692309
readonly visible: boolean;
22702310
}
@@ -11786,6 +11826,18 @@ declare var PromiseRejectionEvent: {
1178611826
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
1178711827
};
1178811828

11829+
interface PublicKeyCredential extends Credential {
11830+
readonly rawId: ArrayBuffer;
11831+
readonly response: AuthenticatorResponse;
11832+
getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
11833+
}
11834+
11835+
declare var PublicKeyCredential: {
11836+
prototype: PublicKeyCredential;
11837+
new(): PublicKeyCredential;
11838+
isUserVerifyingPlatformAuthenticatorAvailable(): Promise<boolean>;
11839+
};
11840+
1178911841
/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
1179011842
interface PushManager {
1179111843
getSubscription(): Promise<PushSubscription | null>;
@@ -18735,6 +18787,9 @@ type ConstrainBoolean = boolean | ConstrainBooleanParameters;
1873518787
type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
1873618788
type PerformanceEntryList = PerformanceEntry[];
1873718789
type VibratePattern = number | number[];
18790+
type AuthenticationExtensionsSupported = string[];
18791+
type UvmEntry = number[];
18792+
type UvmEntries = UvmEntry[];
1873818793
type AlgorithmIdentifier = string | Algorithm;
1873918794
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1874018795
type BigInteger = Uint8Array;
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
[SecureContext, Exposed=Window]
2+
interface PublicKeyCredential : Credential {
3+
[SameObject] readonly attribute ArrayBuffer rawId;
4+
[SameObject] readonly attribute AuthenticatorResponse response;
5+
AuthenticationExtensionsClientOutputs getClientExtensionResults();
6+
};
7+
8+
partial dictionary CredentialCreationOptions {
9+
PublicKeyCredentialCreationOptions publicKey;
10+
};
11+
12+
partial dictionary CredentialRequestOptions {
13+
PublicKeyCredentialRequestOptions publicKey;
14+
};
15+
16+
partial interface PublicKeyCredential {
17+
static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable();
18+
};
19+
20+
[SecureContext, Exposed=Window]
21+
interface AuthenticatorResponse {
22+
[SameObject] readonly attribute ArrayBuffer clientDataJSON;
23+
};
24+
25+
[SecureContext, Exposed=Window]
26+
interface AuthenticatorAttestationResponse : AuthenticatorResponse {
27+
[SameObject] readonly attribute ArrayBuffer attestationObject;
28+
};
29+
30+
[SecureContext, Exposed=Window]
31+
interface AuthenticatorAssertionResponse : AuthenticatorResponse {
32+
[SameObject] readonly attribute ArrayBuffer authenticatorData;
33+
[SameObject] readonly attribute ArrayBuffer signature;
34+
[SameObject] readonly attribute ArrayBuffer? userHandle;
35+
};
36+
37+
dictionary PublicKeyCredentialParameters {
38+
required PublicKeyCredentialType type;
39+
required COSEAlgorithmIdentifier alg;
40+
};
41+
42+
dictionary PublicKeyCredentialCreationOptions {
43+
required PublicKeyCredentialRpEntity rp;
44+
required PublicKeyCredentialUserEntity user;
45+
46+
required BufferSource challenge;
47+
required sequence<PublicKeyCredentialParameters> pubKeyCredParams;
48+
49+
unsigned long timeout;
50+
sequence<PublicKeyCredentialDescriptor> excludeCredentials = [];
51+
AuthenticatorSelectionCriteria authenticatorSelection;
52+
AttestationConveyancePreference attestation = "none";
53+
AuthenticationExtensionsClientInputs extensions;
54+
};
55+
56+
dictionary PublicKeyCredentialEntity {
57+
required DOMString name;
58+
USVString icon;
59+
};
60+
61+
dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity {
62+
DOMString id;
63+
};
64+
65+
dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity {
66+
required BufferSource id;
67+
required DOMString displayName;
68+
};
69+
70+
dictionary AuthenticatorSelectionCriteria {
71+
AuthenticatorAttachment authenticatorAttachment;
72+
boolean requireResidentKey = false;
73+
UserVerificationRequirement userVerification = "preferred";
74+
};
75+
76+
enum AuthenticatorAttachment {
77+
"platform",
78+
"cross-platform"
79+
};
80+
81+
enum AttestationConveyancePreference {
82+
"none",
83+
"indirect",
84+
"direct"
85+
};
86+
87+
dictionary PublicKeyCredentialRequestOptions {
88+
required BufferSource challenge;
89+
unsigned long timeout;
90+
USVString rpId;
91+
sequence<PublicKeyCredentialDescriptor> allowCredentials = [];
92+
UserVerificationRequirement userVerification = "preferred";
93+
AuthenticationExtensionsClientInputs extensions;
94+
};
95+
96+
dictionary AuthenticationExtensionsClientInputs {
97+
};
98+
99+
dictionary AuthenticationExtensionsClientOutputs {
100+
};
101+
102+
typedef record<DOMString, DOMString> AuthenticationExtensionsAuthenticatorInputs;
103+
104+
dictionary CollectedClientData {
105+
required DOMString type;
106+
required DOMString challenge;
107+
required DOMString origin;
108+
TokenBinding tokenBinding;
109+
};
110+
111+
dictionary TokenBinding {
112+
required TokenBindingStatus status;
113+
DOMString id;
114+
};
115+
116+
enum TokenBindingStatus { "present", "supported" };
117+
118+
enum PublicKeyCredentialType {
119+
"public-key"
120+
};
121+
122+
dictionary PublicKeyCredentialDescriptor {
123+
required PublicKeyCredentialType type;
124+
required BufferSource id;
125+
sequence<AuthenticatorTransport> transports;
126+
};
127+
128+
enum AuthenticatorTransport {
129+
"usb",
130+
"nfc",
131+
"ble",
132+
"internal"
133+
};
134+
135+
typedef long COSEAlgorithmIdentifier;
136+
137+
enum UserVerificationRequirement {
138+
"required",
139+
"preferred",
140+
"discouraged"
141+
};
142+
143+
partial dictionary AuthenticationExtensionsClientInputs {
144+
USVString appid;
145+
};
146+
147+
partial dictionary AuthenticationExtensionsClientOutputs {
148+
boolean appid;
149+
};
150+
151+
partial dictionary AuthenticationExtensionsClientInputs {
152+
USVString txAuthSimple;
153+
};
154+
155+
partial dictionary AuthenticationExtensionsClientOutputs {
156+
USVString txAuthSimple;
157+
};
158+
159+
dictionary txAuthGenericArg {
160+
required USVString contentType; // MIME-Type of the content, e.g., "image/png"
161+
required ArrayBuffer content;
162+
};
163+
164+
partial dictionary AuthenticationExtensionsClientInputs {
165+
txAuthGenericArg txAuthGeneric;
166+
};
167+
168+
partial dictionary AuthenticationExtensionsClientOutputs {
169+
ArrayBuffer txAuthGeneric;
170+
};
171+
172+
typedef sequence<AAGUID> AuthenticatorSelectionList;
173+
174+
partial dictionary AuthenticationExtensionsClientInputs {
175+
AuthenticatorSelectionList authnSel;
176+
};
177+
178+
typedef BufferSource AAGUID;
179+
180+
partial dictionary AuthenticationExtensionsClientOutputs {
181+
boolean authnSel;
182+
};
183+
184+
partial dictionary AuthenticationExtensionsClientInputs {
185+
boolean exts;
186+
};
187+
188+
typedef sequence<USVString> AuthenticationExtensionsSupported;
189+
190+
partial dictionary AuthenticationExtensionsClientOutputs {
191+
AuthenticationExtensionsSupported exts;
192+
};
193+
194+
partial dictionary AuthenticationExtensionsClientInputs {
195+
boolean uvi;
196+
};
197+
198+
partial dictionary AuthenticationExtensionsClientOutputs {
199+
ArrayBuffer uvi;
200+
};
201+
202+
partial dictionary AuthenticationExtensionsClientInputs {
203+
boolean loc;
204+
};
205+
206+
partial dictionary AuthenticationExtensionsClientOutputs {
207+
Coordinates loc;
208+
};
209+
210+
partial dictionary AuthenticationExtensionsClientInputs {
211+
boolean uvm;
212+
};
213+
214+
typedef sequence<unsigned long> UvmEntry;
215+
typedef sequence<UvmEntry> UvmEntries;
216+
217+
partial dictionary AuthenticationExtensionsClientOutputs {
218+
UvmEntries uvm;
219+
};
220+
221+
dictionary authenticatorBiometricPerfBounds{
222+
float FAR;
223+
float FRR;
224+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@
359359
"url": "https://webaudio.github.io/web-audio-api/",
360360
"title": "Web Audio"
361361
},
362+
{
363+
"url": "https://www.w3.org/TR/2019/REC-webauthn-1-20190304/",
364+
"title": "Web Authentication"
365+
},
362366
{
363367
"url": "https://wicg.github.io/BackgroundSync/spec/",
364368
"title": "Web Background Synchronization"

0 commit comments

Comments
 (0)