Skip to content

Commit e67bdf6

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

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

index.html

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,41 @@ <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 a [=dictionary=], then:
710+
<ol>
711+
<li>Let |request| be |requests|'s
712+
{{DigitalCredentialGetRequest/data}} [=converted to an idl
713+
value|converted=] to that dictionary. [=exception/throw|Rethrow=]
714+
any exceptions.
715+
</li>
716+
</ol>
717+
</li>
718+
<li>Otherwise, let |request| be |requests|'s
719+
{{DigitalCredentialGetRequest/data}}.
720+
</li>
721+
<li>Validate |request| against any validation rules set forth in
722+
the corresponding [=registry/link|specification=]. If any of
723+
|request|'s members are invalid, [=exception/throw=] a
724+
{{TypeError}}.
725+
</li>
699726
</ol>
700727
</li>
701728
<li>

0 commit comments

Comments
 (0)