Bug 1452643 [wpt PR 9850] - Update the webauthn IDL file, a=testonly
authorLuke Bjerring <lukebjerring@users.noreply.github.com>
Mon, 09 Apr 2018 18:32:38 +0000
changeset 467228 00e7c87b8fb52ca7a87f77d64f848cce84f5cddd
parent 467227 9812726cc22fcda2295f1c34ca5d622c6acef9fc
child 467229 82a3b68b0a585db261b7bf4ddc8516616a776303
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452643
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452643 [wpt PR 9850] - Update the webauthn IDL file, a=testonly Automatic update from web-platform-testsUpdate the webauthn IDL file (#9850) * Add webauthn idl file * Simplify webauthn/interfaces.https.html test wpt-commits: 149116dc79fb5c7f4f86de58768463a49a52ddb9 wpt-pr: 9850 wpt-commits: 149116dc79fb5c7f4f86de58768463a49a52ddb9 wpt-pr: 9850
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/interfaces/webauthn.idl
testing/web-platform/tests/webauthn/interfaces.https.any.js
testing/web-platform/tests/webauthn/interfaces.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -366262,19 +366262,23 @@
     ]
    ],
    "webauthn/getcredential-timeout.https.html": [
     [
      "/webauthn/getcredential-timeout.https.html",
      {}
     ]
    ],
-   "webauthn/interfaces.https.html": [
-    [
-     "/webauthn/interfaces.https.html",
+   "webauthn/interfaces.https.any.js": [
+    [
+     "/webauthn/interfaces.https.any.html",
+     {}
+    ],
+    [
+     "/webauthn/interfaces.https.any.worker.html",
      {}
     ]
    ],
    "webauthn/securecontext.http.html": [
     [
      "/webauthn/securecontext.http.html",
      {}
     ]
@@ -573710,17 +573714,17 @@
    "21b54128664c5962c29fd708ebba3d8d90987f26",
    "support"
   ],
   "interfaces/webaudio.idl": [
    "43a244276b9795b137c2e46c194d56dbb957635d",
    "support"
   ],
   "interfaces/webauthn.idl": [
-   "77076f0828383c0f48f36131a81b25186622b3a3",
+   "1ae8b428644479b352fd5b1996677fd4dcdbb84b",
    "support"
   ],
   "interfaces/webidl.idl": [
    "d466ddd18ed621e15cc416863502069ffccfa5b9",
    "support"
   ],
   "interfaces/webrtc-pc.idl": [
    "a631e2e0ea0f451c64b5d5f74fe7cbeafc231b8e",
@@ -603481,18 +603485,18 @@
   "webauthn/getcredential-timeout.https.html": [
    "b8c71a3fccdf39c2e35bd34a3cd42561cac5836b",
    "testharness"
   ],
   "webauthn/helpers.js": [
    "9ce729fb89ba1863fb14dfc4d567e6b544a5238d",
    "support"
   ],
-  "webauthn/interfaces.https.html": [
-   "80609bdf53a5919205b235549cd57a859e56ee3b",
+  "webauthn/interfaces.https.any.js": [
+   "bc3e3c5a85f068efa88c4ed256cc2d270c8eca0f",
    "testharness"
   ],
   "webauthn/securecontext.http.html": [
    "7abf48e74debed79578e39934d1b84655731a3ea",
    "testharness"
   ],
   "webauthn/securecontext.https.html": [
    "9bdd7e09c7f468b9b0c106d4764d61e77b32131f",
--- a/testing/web-platform/tests/interfaces/webauthn.idl
+++ b/testing/web-platform/tests/interfaces/webauthn.idl
@@ -1,17 +1,21 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Web Authentication spec.
+// See https://w3c.github.io/webauthn/
+
 [SecureContext, Exposed=Window]
 interface PublicKeyCredential : Credential {
     [SameObject] readonly attribute ArrayBuffer              rawId;
     [SameObject] readonly attribute AuthenticatorResponse    response;
-    AuthenticationExtensions getClientExtensionResults();
+    AuthenticationExtensionsClientOutputs getClientExtensionResults();
 };
 
 partial dictionary CredentialCreationOptions {
-    MakePublicKeyCredentialOptions      publicKey;
+    PublicKeyCredentialCreationOptions      publicKey;
 };
 
 partial dictionary CredentialRequestOptions {
     PublicKeyCredentialRequestOptions      publicKey;
 };
 
 partial interface PublicKeyCredential {
     static Promise < boolean > isUserVerifyingPlatformAuthenticatorAvailable();
@@ -26,36 +30,36 @@ interface AuthenticatorResponse {
 interface AuthenticatorAttestationResponse : AuthenticatorResponse {
     [SameObject] readonly attribute ArrayBuffer      attestationObject;
 };
 
 [SecureContext, Exposed=Window]
 interface AuthenticatorAssertionResponse : AuthenticatorResponse {
     [SameObject] readonly attribute ArrayBuffer      authenticatorData;
     [SameObject] readonly attribute ArrayBuffer      signature;
-    [SameObject] readonly attribute ArrayBuffer      userHandle;
+    [SameObject] readonly attribute ArrayBuffer?     userHandle;
 };
 
 dictionary PublicKeyCredentialParameters {
     required PublicKeyCredentialType      type;
     required COSEAlgorithmIdentifier      alg;
 };
 
-dictionary MakePublicKeyCredentialOptions {
+dictionary PublicKeyCredentialCreationOptions {
     required PublicKeyCredentialRpEntity         rp;
     required PublicKeyCredentialUserEntity       user;
 
     required BufferSource                             challenge;
     required sequence<PublicKeyCredentialParameters>  pubKeyCredParams;
 
     unsigned long                                timeout;
     sequence<PublicKeyCredentialDescriptor>      excludeCredentials = [];
     AuthenticatorSelectionCriteria               authenticatorSelection;
     AttestationConveyancePreference              attestation = "none";
-    AuthenticationExtensions                     extensions;
+    AuthenticationExtensionsClientInputs         extensions;
 };
 
 dictionary PublicKeyCredentialEntity {
     required DOMString    name;
     USVString             icon;
 };
 
 dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity {
@@ -85,31 +89,41 @@ enum AttestationConveyancePreference {
 };
 
 dictionary PublicKeyCredentialRequestOptions {
     required BufferSource                challenge;
     unsigned long                        timeout;
     USVString                            rpId;
     sequence<PublicKeyCredentialDescriptor> allowCredentials = [];
     UserVerificationRequirement          userVerification = "preferred";
-    AuthenticationExtensions             extensions;
+    AuthenticationExtensionsClientInputs extensions;
 };
 
-typedef record<DOMString, any>       AuthenticationExtensions;
+dictionary AuthenticationExtensionsClientInputs {
+};
+
+dictionary AuthenticationExtensionsClientOutputs {
+};
+
+typedef record<DOMString, DOMString> AuthenticationExtensionsAuthenticatorInputs;
 
 dictionary CollectedClientData {
     required DOMString           type;
     required DOMString           challenge;
     required DOMString           origin;
-    required DOMString           hashAlgorithm;
-    DOMString                    tokenBindingId;
-    AuthenticationExtensions     clientExtensions;
-    AuthenticationExtensions     authenticatorExtensions;
+    TokenBinding                 tokenBinding;
 };
 
+dictionary TokenBinding {
+    required TokenBindingStatus status;
+    DOMString id;
+};
+
+enum TokenBindingStatus { "present", "supported", "not-supported" };
+
 enum PublicKeyCredentialType {
     "public-key"
 };
 
 dictionary PublicKeyCredentialDescriptor {
     required PublicKeyCredentialType      type;
     required BufferSource                 id;
     sequence<AuthenticatorTransport>      transports;
@@ -124,11 +138,90 @@ enum AuthenticatorTransport {
 typedef long COSEAlgorithmIdentifier;
 
 enum UserVerificationRequirement {
     "required",
     "preferred",
     "discouraged"
 };
 
-typedef sequence<AAGUID>      AuthenticatorSelectionList;
+partial dictionary AuthenticationExtensionsClientInputs {
+  USVString appid;
+};
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  boolean appid;
+};
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  USVString txAuthSimple;
+};
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  USVString txAuthSimple;
+};
+
+dictionary txAuthGenericArg {
+    required USVString contentType;    // MIME-Type of the content, e.g., "image/png"
+    required ArrayBuffer content;
+};
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  txAuthGenericArg txAuthGeneric;
+};
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  ArrayBuffer txAuthGeneric;
+};
+
+typedef sequence<AAGUID> AuthenticatorSelectionList;
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  AuthenticatorSelectionList authnSel;
+};
+
+typedef BufferSource      AAGUID;
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  boolean authnSel;
+};
 
-typedef BufferSource      AAGUID;
\ No newline at end of file
+partial dictionary AuthenticationExtensionsClientInputs {
+  boolean exts;
+};
+
+typedef sequence<USVString> AuthenticationExtensionsSupported;
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  AuthenticationExtensionsSupported exts;
+};
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  boolean uvi;
+};
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  ArrayBuffer uvi;
+};
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  boolean loc;
+};
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  Coordinates loc;
+};
+
+partial dictionary AuthenticationExtensionsClientInputs {
+  boolean uvm;
+};
+
+typedef sequence<unsigned long> UvmEntry;
+typedef sequence<UvmEntry> UvmEntries;
+
+partial dictionary AuthenticationExtensionsClientOutputs {
+  UvmEntries uvm;
+};
+
+dictionary authenticatorBiometricPerfBounds{
+    float FAR;
+    float FRR;
+    };
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webauthn/interfaces.https.any.js
@@ -0,0 +1,30 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+if (self.importScripts) {
+  importScripts('/resources/testharness.js');
+  importScripts('/resources/WebIDLParser.js', '/resources/idlharness.js');
+}
+
+// https://w3c.github.io/webauthn/
+
+promise_test(async () => {
+  const webauthnIdl = await fetch('/interfaces/webauthn.idl').then(r => r.text());
+
+  const idlArray = new IdlArray();
+  idlArray.add_idls(webauthnIdl);
+
+  // static IDL tests
+  idlArray.add_untested_idls('interface CredentialCreationOptions {};');
+  idlArray.add_untested_idls('interface CredentialRequestOptions {};');
+  idlArray.add_untested_idls("interface Navigator { };");
+  // TODO: change to "tested" for real browsers?
+  idlArray.add_untested_idls("partial interface Navigator { readonly attribute WebAuthentication authentication; };");
+  idlArray.add_objects({
+    WebAuthentication: ["navigator.authentication"]
+  });
+  idlArray.test();
+  done();
+}, 'WebAuthn interfaces.');
deleted file mode 100644
--- a/testing/web-platform/tests/webauthn/interfaces.https.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>WebAuthn WebIDL Tests</title>
-<link rel="author" title="Adam Powers" href="mailto:adam@fidoalliance.org">
-<link rel="help" href="https://w3c.github.io/webauthn/#iface-credential">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src=helpers.js></script>
-<!-- for testing WebIDL -->
-<script src=/resources/WebIDLParser.js></script>
-<script src=/resources/idlharness.js></script>
-<body></body>
-<script>
-standardSetup(function() {
-    "use strict";
-
-    // loads an IDL file from the webserver
-    function fetchIdl(idlUrl) {
-        return new Promise(function(resolve, reject) {
-            if (typeof idlUrl !== "string") {
-                return reject("fetchIdl: expected argument to be URL string");
-            }
-            var request = new XMLHttpRequest();
-            request.open("GET", idlUrl);
-            request.send();
-            request.onload = function() {
-                var idls = request.responseText;
-                return resolve(idls);
-            };
-        });
-    }
-
-    // this does the real work of running the IDL tests
-    function runIdlTests(idls) {
-        return new Promise(function(resolve, reject) {
-            var idlArray = new window.IdlArray();
-
-            // static IDL tests
-            idlArray.add_untested_idls("interface Navigator { };");
-            // TODO: change to "tested" for real browsers?
-            idlArray.add_untested_idls("partial interface Navigator { readonly attribute WebAuthentication authentication; };");
-            idlArray.add_objects({
-                WebAuthentication: ["navigator.authentication"]
-            });
-
-            // run test WebIDL tests loaded from the idls file
-            idlArray.add_idls(idls);
-            return resolve(idlArray.test());
-        });
-    }
-
-    // test harness function
-    window.promise_test(function() {
-        return fetchIdl("/interfaces/webauthn.idl") // load the IDL file ...
-            .then(function(idls) {
-                return runIdlTests(idls); // ... then run the tests.
-            });
-    }, "Validate WebAuthn IDL");
-});
-</script>