Skip to content

Commit d30a7f4

Browse files
committed
Add request validation
1 parent 4624c60 commit d30a7f4

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

index.html

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,42 @@ <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 |protocol| is not supported by the user agent,
706+
[=exception/throw=] a {{NotSupportedError}} {{DOMException}}.
707+
</li>
708+
<li>If the [=registry/link|specification=] corresponding to
709+
|protocol| defines an IDL {{dictionary}} for [=converted to an idl
710+
value|conversion=]:
711+
<ol>
712+
<li>Let |request| be |requests|'s
713+
{{DigitalCredentialGetRequest/data}} [=converted to an idl
714+
value|converted=] to that dictionary. [=exception/throw|Rethrow=]
715+
any exceptions.
716+
</li>
717+
</ol>
718+
</li>
719+
<li>Otherwise, let |request| be |requests|'s
720+
{{DigitalCredentialGetRequest/data}}.
721+
</li>
722+
<li>Validate |request| against any validation rules set forth in
723+
the corresponding [=registry/link|specification=]. If any of
724+
|request|'s members are invalid, [=exception/throw=] a
725+
{{TypeError}}.
726+
</li>
699727
</ol>
700728
</li>
701729
<li>

0 commit comments

Comments
 (0)