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
--- 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"
};