Bug 1382888 - WebAuthn objects should use [SameObject] r?qdot draft
authorJ.C. Jones <jjones@mozilla.com>
Fri, 21 Jul 2017 10:56:50 -0700 (2017-07-21)
changeset 613127 e5b8338e9c91adfec0914d73ca1095ea08bf77d1
parent 613116 e99e3e62cfa8bbc7d430f64d4fbdf77ffb81e979
child 638627 c7833ba183e9992ffdb91e2d653b7b02054cb16f
push id69743
push userbmo:jjones@mozilla.com
push dateFri, 21 Jul 2017 18:09:55 +0000 (2017-07-21)
reviewersqdot
bugs1382888
milestone56.0a1
Bug 1382888 - WebAuthn objects should use [SameObject] r?qdot Most of the WebIDL objects for the current editor's draft of Web Authentication are annotated as [SameObject], which won't affect interop based on WD-05 [1]. We should go ahead and annotate ours that way. [1] https://w3c.github.io/webauthn/#idl-index MozReview-Commit-ID: 2T2YR3g66nC
dom/webidl/WebAuthentication.webidl
--- a/dom/webidl/WebAuthentication.webidl
+++ b/dom/webidl/WebAuthentication.webidl
@@ -6,30 +6,30 @@
  * The origin of this IDL file is
  * https://www.w3.org/TR/webauthn/
  */
 
 /***** Interfaces to Data *****/
 
 [SecureContext, Pref="security.webauth.webauthn"]
 interface PublicKeyCredential : Credential {
-    readonly attribute ArrayBuffer           rawId;
-    readonly attribute AuthenticatorResponse response;
+    [SameObject] readonly attribute ArrayBuffer           rawId;
+    [SameObject] readonly attribute AuthenticatorResponse response;
     // Extensions are not supported yet.
-    // readonly attribute AuthenticationExtensions clientExtensionResults;
+    // [SameObject] readonly attribute AuthenticationExtensions clientExtensionResults;
 };
 
 [SecureContext, Pref="security.webauth.webauthn"]
 interface AuthenticatorResponse {
-    readonly attribute ArrayBuffer clientDataJSON;
+    [SameObject] readonly attribute ArrayBuffer clientDataJSON;
 };
 
 [SecureContext, Pref="security.webauth.webauthn"]
 interface AuthenticatorAttestationResponse : AuthenticatorResponse {
-    readonly attribute ArrayBuffer attestationObject;
+    [SameObject] readonly attribute ArrayBuffer attestationObject;
 };
 
 dictionary PublicKeyCredentialParameters {
     required PublicKeyCredentialType  type;
     required WebAuthnAlgorithmID algorithm; // NOTE: changed from AllgorithmIdentifier because typedef (object or DOMString) not serializable
 };
 
 dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity {
@@ -94,18 +94,18 @@ dictionary PublicKeyCredentialDescriptor
     required BufferSource id;
     sequence<WebAuthnTransport>   transports;
 };
 
 typedef (boolean or DOMString) WebAuthnAlgorithmID; // Fix when upstream there's a definition of how to serialize AlgorithmIdentifier
 
 [SecureContext, Pref="security.webauth.webauthn"]
 interface AuthenticatorAssertionResponse : AuthenticatorResponse {
-    readonly attribute ArrayBuffer      authenticatorData;
-    readonly attribute ArrayBuffer      signature;
+    [SameObject] readonly attribute ArrayBuffer      authenticatorData;
+    [SameObject] readonly attribute ArrayBuffer      signature;
 };
 
 // Renamed from "Transport" to avoid a collision with U2F
 enum WebAuthnTransport {
     "usb",
     "nfc",
     "ble"
 };