Skip to content

Commit

Permalink
Attempt to define rules for when encoding fails
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Jun 10, 2022
1 parent b1b5fd1 commit 88bd8fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ that are returned to the caller when a new credential is created, or a new asser

: {{PublicKeyCredential/toJSON()}}
:: This operation returns {{RegistrationResponseJSON}} or {{AuthenticationResponseJSON}},
which are [=JSON types=] mirroring {{PublicKeyCredential}}, suitable for submission to a
which are [=JSON type=] representations mirroring {{PublicKeyCredential}}, suitable for submission to a
[=[RP]=] server as an `application/json` payload. The [=client=] is in charge of
[serializing values to JSON types as usual](https://webidl.spec.whatwg.org/#idl-tojson-operation),
but MUST take additional steps to first encode any {{ArrayBuffer}} values to {{DOMString}} values
Expand Down Expand Up @@ -2468,6 +2468,10 @@ also apply to any [=client extension inputs=] processed by the [=client=].
"WebAuthn Extension Identifiers" registry [[!IANA-WebAuthn-Registries]] but not defined in
[[#sctn-extensions]].

If the [=client=] encounters any issues parsing any of the [=JSON type=] representations then it
MUST return an error code equivalent to "{{EncodingError}}" with a description of the incompatible
value and terminate the operation.

<xmp class="idl">
partial interface PublicKeyCredential {
static PublicKeyCredentialCreationOptions parseCreationOptionsFromJSON(PublicKeyCredentialCreationOptionsJSON options);
Expand Down Expand Up @@ -2522,6 +2526,10 @@ also apply to any [=client extension inputs=] processed by the [=client=].
"WebAuthn Extension Identifiers" registry [[!IANA-WebAuthn-Registries]] but not defined in
[[#sctn-extensions]].

If the [=client=] encounters any issues parsing any of the [=JSON type=] representations then it
MUST return an error code equivalent to "{{EncodingError}}" with a description of the incompatible
value and terminate the operation.

<xmp class="idl">
partial interface PublicKeyCredential {
static PublicKeyCredentialRequestOptions parseRequestOptionsFromJSON(PublicKeyCredentialRequestOptionsJSON options);
Expand Down

0 comments on commit 88bd8fb

Please sign in to comment.