Skip to content

Commit

Permalink
Fix #1268 Type transport strings as DOMStrings. (#1275)
Browse files Browse the repository at this point in the history
* Type transport strings as DOMStrings.

Currently transports are represented as an enum. However, WebIDL has
strict enums. (I.e. an RP which sent an unrecognised transport would
make the whole structure unparsable.) This means that every time we add
a transport, we break all existing browsers.

In order to address this, this change retypes transports as plain
DOMStrings. The AuthenticatorTransport enum still exists, but now only
as documentation and registry — not as a factor in type-checking.

* Address Emil's comment

Fixes #1268.

* Address Jeff's comments.
  • Loading branch information
agl authored and akshayku committed Aug 28, 2019
1 parent 0cc6d70 commit b75aef3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ spec:infra; type:dfn; for:map-exists; text:exists
spec:url; type:dfn; text:domain
spec:url; type:dfn; for:url; text:host
spec:url; type:dfn; text:valid domain;
spec:webidl; type:dfn; text:DOMString
spec:webidl; type:interface; text:Promise
</pre>

Expand Down Expand Up @@ -1679,7 +1680,7 @@ a numbered step. If outdented, it (today) is rendered either as a bullet in the
:: |attestationObject|

: {{AuthenticatorAttestationResponse/[[transports]]}}
:: A sequence of zero or more unique {{AuthenticatorTransport}} values, in lexicographical order, that the |authenticator| is believed to support.
:: A sequence of zero or more unique {{DOMString}}s, in lexicographical order, that the |authenticator| is believed to support. The values SHOULD be members of {{AuthenticatorTransport}}.

If a user agent does not wish to divulge this information it MAY substitute an arbitrary sequence designed to preserve privacy. This sequence MUST still be valid, i.e. lexicographically sorted and free of duplicates. For example, it may use the empty sequence. Either way, in this case the user agent takes the risk that [=[RP]=] behavior may be suboptimal.

Expand Down Expand Up @@ -2166,7 +2167,7 @@ during registration.
[SecureContext, Exposed=Window]
interface AuthenticatorAttestationResponse : AuthenticatorResponse {
[SameObject] readonly attribute ArrayBuffer attestationObject;
sequence<AuthenticatorTransport> getTransports();
sequence<DOMString> getTransports();
};
</xmp>
<div dfn-type="attribute" dfn-for="AuthenticatorAttestationResponse">
Expand All @@ -2190,7 +2191,7 @@ during registration.
:: This operation returns the value of {{AuthenticatorAttestationResponse/[[transports]]}}.

: <dfn>\[[transports]]</dfn>
:: This [=internal slot=] contains a sequence of zero or more unique {{AuthenticatorTransport}} values in lexicographical order. These values are the transports that the [=authenticator=] is believed to support, or an empty sequence if the information is unavailable.
:: This [=internal slot=] contains a sequence of zero or more unique {{DOMString}}s in lexicographical order. These values are the transports that the [=authenticator=] is believed to support, or an empty sequence if the information is unavailable. The values SHOULD be members of {{AuthenticatorTransport}} but [=[RPS]=] MUST accept unknown values.
</div>

### Web Authentication Assertion (interface <dfn interface>AuthenticatorAssertionResponse</dfn>) ### {#iface-authenticatorassertionresponse}
Expand Down Expand Up @@ -2795,7 +2796,7 @@ Note: The {{CollectedClientData}} may be extended in the future. Therefore it's
dictionary PublicKeyCredentialDescriptor {
required PublicKeyCredentialType type;
required BufferSource id;
sequence<AuthenticatorTransport> transports;
sequence<DOMString> transports;
};
</xmp>

Expand All @@ -2812,7 +2813,7 @@ parameter to the {{CredentialsContainer/create()}} or {{CredentialsContainer/get

: <dfn>transports</dfn>
:: This OPTIONAL member contains a hint as to how the [=client=] might communicate with the [=managing authenticator=] of the
[=public key credential=] the caller is referring to.
[=public key credential=] the caller is referring to. The values SHOULD be members of {{AuthenticatorTransport}} but [=client platforms=] MUST ignore unknown values.
</div>


Expand All @@ -2831,8 +2832,10 @@ parameter to the {{CredentialsContainer/create()}} or {{CredentialsContainer/get
[=Authenticators=] may implement various [[#enum-transport|transports]] for communicating with [=clients=]. This enumeration
defines hints as to how clients might communicate with a particular authenticator in order to obtain an assertion for a
specific credential. Note that these hints represent the [=[WRP]=]'s best belief as to how an authenticator may be reached. A
[=[RP]=] may obtain a list of transports hints from some [=attestation statement formats=] or via some out-of-band mechanism;
it is outside the scope of this specification to define that mechanism.
[=[RP]=] will typically learn of the supported transports for a [=public key credential=] via
{{AuthenticatorAttestationResponse/getTransports()}}.

Note: The {{AuthenticatorTransport}} enumeration is not referenced by other parts of the Web IDL because that would preclude other values from being used without updating this specification and its implementations. It is important for backwards compatibility that [=client platforms=] and [=[RPS]=] handle unknown values. Therefore it exists here for documentation and as a registry. Where transports are represented elsewhere, they are typed as {{DOMString}}s, for example in {{PublicKeyCredentialDescriptor/transports}}.

: <dfn>usb</dfn>
:: Indicates the respective [=authenticator=] can be contacted over removable USB.
Expand Down

0 comments on commit b75aef3

Please sign in to comment.