Bug 1382888 - WebAuthn objects should use [SameObject] r=qdot
authorJ.C. Jones <jjones@mozilla.com>
Fri, 21 Jul 2017 10:56:50 -0700
changeset 412638 811510fdb51a8fd65dfb61ba4297efa797756208
parent 412637 f4d41c4d2246f2cc055ebc718e59ae6512c3f707
child 412639 6937dd73cff9140ed70d86c9631fc1f5932406e9
push id62
push userfmarier@mozilla.com
push dateFri, 28 Jul 2017 00:58:35 +0000
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"
 };