Re: WebAuthn WebIDL Questions

On 10/29/16, 6:04 PM, "Adam Powers" <adam@fidoalliance.org> wrote:
>Hey guys, Iım not a WebIDL expert but as Iım reading through our WebIDL
>to create tests I have a few questions:
>
>1. Iım assuming that the members of ScopedCredentialOptions and
>AssertionOptions should be nullable types, similar to the example in
>WebIDL 2.2: https://heycam.github.io/webidl/#issue-4d2fc4e6 , right?

Well, all of those two dictionaries' members are optional since they are
not declared "required", AFAIU. Rather than pass members with NULL values,
the caller can just not include such members (?)


>2. According to WebIDL 3.6 interfaces without [NoInterfaceObject] must
>show up on the global `window` object:
>https://heycam.github.io/webidl/#es-interfaces . Do we want to declare
>the WebAuthentication interface with [NoInterfaceObject], since it is
>behaving
>as a singleton? Note that this is how the geolocation and indexeddb
>interfaces are defined.

Hixie says that the above suggestion or the way we are presently declaring
the interface are equivalent -- and his answer is specifically in regard
to the geolocation API..

  
https://lists.w3.org/Archives/Public/public-script-coord/2014JanMar/0161.ht
ml 

however, see also http://darobin.github.io/api-design-cookbook/ wherin the
use of [NoInterfaceObject] is deprecated.


>3. Should [SecureContext] only apply to interfaces with operations and /
>or operations themselves (see the note in Secure Contexts Section 2.1:
>https://www.w3.org/TR/secure-contexts/#integration-idl )?

Mike West said to use [SecureContext] on all webauthn interface
declarations..

  https://github.com/w3c/webauthn/issues/146


>4. Why are ScopedCredentialInfo, WebAuthnAssertion, WebAuthnAttestation,
>and ScopedCredential interfaces instead of dictionaries?

from Vijay a while back..

  According to the Web IDL spec, dictionaries are passed by
  value while interfaces represent objects and are therefore
  essentially references. The attestation structures are defined
  as dictionaries - it would seem more natural and performant
  to have them defined as interfaces instead.

  In general, style guides such as
  http://darobin.github.io/api-design-cookbook/ tend to recommend
  the use of dictionaries when one is defining property bags to
  serve as input parameters to methods, and interfaces when one
  is defining return values.

additionally, interface attributes cannot themselves be dictionaries..

  https://heycam.github.io/webidl/#dfn-attribute



HTH,

=JeffH

Received on Sunday, 30 October 2016 18:38:00 UTC