Skip to content

Commit 533464b

Browse files
committed
Add request validation
1 parent 4624c60 commit 533464b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

index.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,38 @@ <h3>
688688
<li>Let |requests| be |options|'s {{CredentialRequestOptions/digital}}'s
689689
{{DigitalCredentialRequestOptions/requests}} member.
690690
</li>
691-
<li>If |requests| is empty, [=exception/throw=] a {{TypeError}}.
691+
<li>If |requests| [=list/is empty=], [=exception/throw=] a {{TypeError}}.
692692
</li>
693693
<li>[=List/For each=] |request| of |requests|:
694694
<ol>
695695
<li>[=serialize a JavaScript value to a JSON string|Serialize=]
696696
|request| to a JSON string. [=exception/throw|Re-throw=] any
697697
[=exception=].
698698
</li>
699+
<li>Let |protocol| be |requests|'s
700+
{{DigitalCredentialGetRequest/protocol}}.
701+
</li>
702+
<li>If |protocol| is not allowed by the user agent,
703+
[=exception/throw=] a {{NotSupportedError}} {{DOMException}}.
704+
</li>
705+
<li>If the [=registry/link|specification=] corresponding to
706+
|protocol| defines a [=dictionary=], then:
707+
<ol>
708+
<li>Let |request| be |requests|'s
709+
{{DigitalCredentialGetRequest/data}} [=converted to an idl
710+
value|converted=] to that dictionary. [=exception/throw|Rethrow=]
711+
any exceptions.
712+
</li>
713+
</ol>
714+
</li>
715+
<li>Otherwise, let |request| be |requests|'s
716+
{{DigitalCredentialGetRequest/data}}.
717+
</li>
718+
<li>Validate |request| against any validation rules set forth in
719+
the corresponding [=registry/link|specification=]. If any of
720+
|request|'s members are invalid, [=exception/throw=] a
721+
{{TypeError}}.
722+
</li>
699723
</ol>
700724
</li>
701725
<li>

0 commit comments

Comments
 (0)