Skip to content

Commit

Permalink
Remove a bunch of unnecessary dfns and anchors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Feb 22, 2017
1 parent ce7925c commit 0ac1661
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions index.bs
Expand Up @@ -56,12 +56,12 @@ spec: HTML51; urlPrefix: http://www.w3.org/TR/html51/; for: web
spec: WebCryptoAPI; urlPrefix: https://www.w3.org/TR/WebCryptoAPI/; for: web
type: dfn
text: normalizing an algorithm; url: dfn-normalize-an-algorithm

spec: Encoding; urlPrefix: https://www.w3.org/TR/encoding/;
type: dfn
text: UTF-8 Encoded; url: utf-8-encode
</pre> <!-- class=anchors -->

<pre class="link-defaults">
spec:webidl; type:interface; text:Promise
</pre>


# Introduction # {#intro}

Expand Down Expand Up @@ -174,7 +174,7 @@ This specification relies on several other underlying specifications.
:: This specification describes the syntax of all CBOR-encoded data using the CBOR Data Definition Language (CDDL) [[!CDDL]].

: DOM
:: <dfn>DOMException</dfn> and the DOMException values used in this specification are defined in [[!DOM4]].
:: {{DOMException}} and the DOMException values used in this specification are defined in [[!DOM4]].

: HTML
:: The concepts of <a link-for='web'>current settings object</a>, <a link-for='web'>origin</a>,
Expand All @@ -187,7 +187,7 @@ This specification relies on several other underlying specifications.

: Web IDL
:: Many of the interface definitions and all of the IDL in this specification depend on [[!WebIDL-1]]. This updated version of
the Web IDL standard adds support for <dfn>Promises</dfn>, which are now the preferred mechanism for asynchronous
the Web IDL standard adds support for {{Promise}}s, which are now the preferred mechanism for asynchronous
interaction in all new web APIs.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
Expand Down Expand Up @@ -333,7 +333,7 @@ where a single [RP] maintains multiple origins.

The client facilitates these security measures by providing correct origins and RP IDs to the authenticator for each
operation. Since this is an integral part of the WebAuthn security model, user agents MUST only expose this API to callers in
<dfn>secure contexts</dfn>, as defined in [[secure-contexts]].
[=secure contexts=].

The Web Authentication API is defined by the union of the Web IDL fragments presented in the following sections. A combined IDL listing is given in the [[#idl-index]]. The API is defined as a part of the <a>Navigator</a> interface:

Expand Down Expand Up @@ -377,6 +377,7 @@ created credential.

This method takes the following parameters:

<ul dfn-type="argument" dfn-for="WebAuthentication/makeCredential(accountInformation, cryptoParameters, attestationChallenge, options)">
- The <dfn>accountInformation</dfn> parameter specifies information about the user account for which the credential is being
created. This is meant for later use by the authenticator when it needs to prompt the user to select a credential. An
authenticator is only required to store one credential for any given value of {{accountInformation}}. Specifically, if an
Expand All @@ -395,30 +396,32 @@ This method takes the following parameters:
- The <dfn>attestationChallenge</dfn> parameter contains a challenge intended to be used for generating the newly created
credential's attestation object.

- The optional <dfn dfn-for="makeCredential()">options</dfn> parameter specifies additional options, as described in
- The optional <dfn>options</dfn> parameter specifies additional options, as described in
[[#credential-options]].

</ul>

When this method is invoked, the user agent MUST execute the following algorithm:

1. If the {{ScopedCredentialOptions/timeout}} member of {{options}} is <a>present</a>, check if its value lies within a reasonable range as defined by
the platform and if not, correct it to the closest value lying within that range. Set |adjustedTimeout| to this adjusted
value. If {{ScopedCredentialOptions/timeout}} was not specified, then set |adjustedTimeout| to a platform-specific
default.

2. Let |promise| be a new <a data-lt="Promises">Promise</a>. Return |promise| and start a timer for |adjustedTimeout| milliseconds.
2. Let |promise| be [=a new Promise=]. Return |promise| and start a timer for |adjustedTimeout| milliseconds.
Then asynchronously continue executing the following steps. If any fatal error is encountered in this process other than the
ones enumerated below, cancel the timer, reject |promise| with a DOMException whose name is "UnknownError", and terminate
this algorithm.

3. Set |callerOrigin| to the <a link-for='web'>current settings object</a>'s <a link-for='web'>origin</a>. If |callerOrigin| is
an <a link-for='web'>opaque origin</a>, reject |promise| with a <a>DOMException</a> whose name is "NotAllowedError", and
an <a link-for='web'>opaque origin</a>, reject |promise| with a {{DOMException}} whose name is "NotAllowedError", and
terminate this algorithm. Otherwise,
- If the {{ScopedCredentialOptions/rpId}} member of {{options}} is not <a>present</a>, then set |rpId| to |callerOrigin|.
- If the {{ScopedCredentialOptions/rpId}} member of {{options}} is <a>present</a>, then invoke the procedure used for
<a>relaxing the same-origin restriction</a> by setting the `document.domain` attribute, using
{{ScopedCredentialOptions/rpId}} as the given value but without changing the current document's `domain`. If no errors
are thrown, set |rpId| to the value of `host` as computed by this procedure. Otherwise, reject |promise| with a
<a>DOMException</a> whose name is "SecurityError", and terminate this algorithm.
{{DOMException}} whose name is "SecurityError", and terminate this algorithm.

4. Process each element of {{cryptoParameters}} using the following steps, to produce a new sequence |normalizedParameters|.
- Let |current| be the currently selected element of {{cryptoParameters}}.
Expand Down Expand Up @@ -471,7 +474,7 @@ When this method is invoked, the user agent MUST execute the following algorithm
remove its entry from the list.
- Resolve |promise| with |value| and terminate this algorithm.

12. Reject |promise| with a <a>DOMException</a> whose name is "NotAllowedError", and terminate this algorithm.
12. Reject |promise| with a {{DOMException}} whose name is "NotAllowedError", and terminate this algorithm.

During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and
authorizing an authenticator.
Expand All @@ -488,31 +491,34 @@ a credential even if one is present, for example to maintain privacy.

This method takes the following parameters:

<ul dfn-type="argument" dfn-for="WebAuthentication/getAssertion(assertionChallenge, options)">
- The <dfn>assertionChallenge</dfn> parameter contains a challenge that the selected authenticator is expected to sign to
produce the assertion.

- The optional <dfn dfn-for="getAssertion()">options</dfn> parameter specifies additional options, as described in
- The optional <dfn>options</dfn> parameter specifies additional options, as described in
[[#assertion-options]].

</ul>

When this method is invoked, the user agent MUST execute the following algorithm:

1. If the {{AssertionOptions/timeout}} member of {{options}} is <a>present</a>, check if its value lies within a reasonable range as defined by the
platform and if not, correct it to the closest value lying within that range. Set |adjustedTimeout| to this adjusted value.
If {{AssertionOptions/timeout}} was not specified, then set |adjustedTimeout| to a platform-specific default.

2. Let |promise| be a new <a data-lt="Promises">Promise</a>. Return |promise| and start a timer for |adjustedTimeout| milliseconds.
2. Let |promise| be [=a new Promise=]. Return |promise| and start a timer for |adjustedTimeout| milliseconds.
Then asynchronously continue executing the following steps. If any fatal error is encountered in this process other than the
ones enumerated below, cancel the timer, reject |promise| with a DOMException whose name is "UnknownError", and terminate
this algorithm.

3. Set |callerOrigin| to the <a link-for='web'>current settings object</a>'s <a link-for='web'>origin</a>. If |callerOrigin| is
an <a link-for='web'>opaque origin</a>, reject |promise| with a <a>DOMException</a> whose name is "NotAllowedError", and
an <a link-for='web'>opaque origin</a>, reject |promise| with a {{DOMException}} whose name is "NotAllowedError", and
terminate this algorithm. Otherwise,
- If the {{AssertionOptions/rpId}} member of {{options}} is not <a>present</a>, then set |rpId| to |callerOrigin|.
- If the {{AssertionOptions/rpId}} member of {{options}} is <a>present</a>, then invoke the procedure used for <a>relaxing
the same-origin restriction</a> by setting the `document.domain` attribute, using {{AssertionOptions/rpId}} as the given
value but without changing the current document's `domain`. If no errors are thrown, set |rpId| to the value of `host`
as computed by this procedure. Otherwise, reject |promise| with a <a>DOMException</a> whose name is "SecurityError", and
as computed by this procedure. Otherwise, reject |promise| with a {{DOMException}} whose name is "SecurityError", and
terminate this algorithm.

4. If the {{AssertionOptions/extensions}} member of {{options}} is <a>present</a>, process any extensions supported by this
Expand Down Expand Up @@ -556,7 +562,7 @@ When this method is invoked, the user agent MUST execute the following algorithm
remove its entry from the list.
- Resolve |promise| with |value| and terminate this algorithm.

9. Reject |promise| with a <a>DOMException</a> whose name is "NotAllowedError", and terminate this algorithm.
9. Reject |promise| with a {{DOMException}} whose name is "NotAllowedError", and terminate this algorithm.

During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and
authorizing an authenticator with which to complete the operation.
Expand All @@ -573,7 +579,7 @@ authorizing an authenticator with which to complete the operation.
};
</pre>

<div dfn-for="ScopedCredentialInfo">
<div dfn-type="attribute" dfn-for="ScopedCredentialInfo">
This interface represents a newly-created scoped credential. It contains information about the credential that can be used
to locate it later for use, and also contains metadata that can be used by the <a>[RP]</a> to assess the strength of the
credential during registration.
Expand Down Expand Up @@ -603,7 +609,7 @@ authorizing an authenticator with which to complete the operation.
};
</pre>

<div dfn-for="Account">
<div dfn-type="dict-member" dfn-for="Account">
This dictionary is used by the caller to specify information about the user account and <a>[RP]</a> with which a credential
is to be associated. It is intended to help the authenticator in providing a friendly credential selection interface for the
user.
Expand Down Expand Up @@ -634,7 +640,7 @@ authorizing an authenticator with which to complete the operation.
};
</pre>

<div dfn-for="ScopedCredentialParameters">
<div dfn-type="dict-member" dfn-for="ScopedCredentialParameters">
This dictionary is used to supply additional parameters when creating a new credential.

The <dfn>type</dfn> member specifies the type of credential to be created.
Expand All @@ -657,7 +663,7 @@ authorizing an authenticator with which to complete the operation.
</xmp>


<div dfn-for="ScopedCredentialOptions">
<div dfn-type="dict-member" dfn-for="ScopedCredentialOptions">
This dictionary is used to supply additional options when creating a new credential. All these parameters are optional.

- The <dfn>timeout</dfn> parameter specifies a time, in milliseconds, that the caller is willing to wait for the call to
Expand Down Expand Up @@ -691,7 +697,7 @@ authorizing an authenticator with which to complete the operation.
};
</pre>

<div dfn-for="Attachment">
<div>
Clients may communicate with authenticators using a variety of mechanisms. For example, a client may use a platform-specific
API to communicate with an authenticator which is physically bound to a platform. On the other hand, a client may use a
variety of standardized cross-platform transport protocols such as Bluetooth (see [[#transport]]) to discover and
Expand Down Expand Up @@ -734,13 +740,13 @@ authorizing an authenticator with which to complete the operation.
Scoped credentials produce a cryptographic signature that provides proof of possession of a private key as well as evidence of
user consent to a specific transaction. The structure of these signatures is defined as follows.

<div dfn-for="AuthenticationAssertion">
<div dfn-type="attribute" dfn-for="AuthenticationAssertion">
The <dfn>credential</dfn> attribute represents the credential that was used to generate this assertion.

The <dfn>clientDataJSON</dfn> attribute contains the parameters sent to the authenticator by the client, in serialized form.
See [[#sec-client-data]] for the format of this parameter and how it is generated.

The <b><em>authenticatorData</em></b> attribute contains the serialized data returned by the authenticator. See
The <dfn>authenticatorData</dfn> attribute contains the serialized data returned by the authenticator. See
[[#sec-authenticator-data]].

The <dfn>signature</dfn> attribute contains the raw signature returned from the authenticator. See
Expand All @@ -759,7 +765,7 @@ user consent to a specific transaction. The structure of these signatures is def
};
</xmp>

<div dfn-for="AssertionOptions">
<div dfn-type="dict-member" dfn-for="AssertionOptions">
This dictionary is used to supply additional options when generating an assertion. All these parameters are optional.

- The optional <dfn>timeout</dfn> parameter specifies a time, in milliseconds, that the caller is willing to wait for the
Expand Down Expand Up @@ -812,7 +818,7 @@ string-valued keys. Values may be any type that has a valid encoding in JSON. It
};
</pre>

<div dfn-for="ClientData">
<div dfn-type="dict-member" dfn-for="ClientData">
The <dfn>challenge</dfn> member contains the base64url encoding of the challenge provided by the RP.

The <dfn>origin</dfn> member contains the fully qualified origin of the requester, as provided to the authenticator by
Expand All @@ -831,14 +837,14 @@ string-valued keys. Values may be any type that has a valid encoding in JSON. It

This structure is used by the client to compute the following quantities:

: <dfn>clientDataJSON</dfn>
: <dfn dfn>clientDataJSON</dfn>
:: This is the <a>UTF-8 encoded</a> JSON serialization [[RFC7159]] of a {{ClientData}} dictionary. Any valid JSON
serialization may be used by the client. This specification imposes no canonicalization requirements. Instead, the
{{ScopedCredentialInfo}} and {{AuthenticationAssertion}} structures contain the actual serializations used by the client
to generate them.

: <dfn>clientDataHash</dfn>
:: This is the hash (computed using <a>hashAlg</a>) of <a for="ClientData">clientDataJSON</a>, as constructed by the client.
: <dfn dfn>clientDataHash</dfn>
:: This is the hash (computed using {{hashAlg}}) of <a for="ClientData">clientDataJSON</a>, as constructed by the client.
</div>


Expand All @@ -850,7 +856,7 @@ string-valued keys. Values may be any type that has a valid encoding in JSON. It
};
</pre>

<div dfn-for="ScopedCredentialType">
<div dfn-type="enum-value" dfn-for="ScopedCredentialType">
This enumeration defines the valid credential types. It is an extension point; values may be added to it in the future, as
more credential types are defined. The values of this enumeration are used for versioning the Authentication Assertion and
attestation structures according to the type of the authenticator.
Expand All @@ -872,7 +878,7 @@ string-valued keys. Values may be any type that has a valid encoding in JSON. It
This interface contains the attributes that are returned to the caller when a new credential is created, and can be used later
by the caller to select a credential for use.

<div dfn-for="ScopedCredential">
<div dfn-type="attribute" dfn-for="ScopedCredential">
The <dfn>type</dfn> attribute contains a value of type {{ScopedCredentialType}}, indicating the specification and version
that this credential conforms to.

Expand All @@ -899,7 +905,7 @@ This dictionary contains the attributes that are specified by a caller when refe
the {{makeCredential()}} or {{getAssertion()}} method. It mirrors the fields of the {{ScopedCredential}} object returned by
these methods.

<div dfn-for="ScopedCredentialDescriptor">
<div dfn-type="dict-member" dfn-for="ScopedCredentialDescriptor">
The <dfn>type</dfn> member contains the type of the credential the caller is referring to.

The <dfn>id</dfn> member contains the identifier of the credential that the caller is referring to.
Expand All @@ -916,7 +922,7 @@ these methods.
};
</pre>

<div dfn-for="Transport">
<div dfn-type="enum-value" dfn-for="Transport">
Authenticators may communicate with Clients using a variety of transports. This enumeration defines a hint 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 [RP]'s best belief as to how an Authenticator may be reached. A [RP] may obtain a list of
Expand Down Expand Up @@ -2308,7 +2314,7 @@ credential. It is intended primarily for [RPS] that wish to tightly control the

: Client processing
:: This extension can only be used during {{makeCredential()}}. If the client supports the Authenticator Selection Extension, it
MUST use the first available authenticator whose AAGUID is present in the <dfn>AuthenticatorSelectionList</dfn>. If none of
MUST use the first available authenticator whose AAGUID is present in the {{AuthenticatorSelectionList}}. If none of
the available authenticators match a provided AAGUID, the client MUST select an authenticator from among the available
authenticators to generate the credential.

Expand Down

0 comments on commit 0ac1661

Please sign in to comment.