Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 143 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -762,24 +762,156 @@ <h3>
To <dfn data-dfn-for="credential request coordinator">prepare credential
requests</dfn> given a [=Document=] |document:Document|, a sequence of
{{DigitalCredentialGetRequest}} or {{DigitalCredentialCreateRequest}}
|requests|, a {{Promise}} |promise:Promise|, and an optional
objects |requests|, a {{Promise}} |promise:Promise|, and an optional
{{AbortSignal}} |signal:AbortSignal|:
</p>
<ol>
<li>
<aside class="issue">
See <a href=
"https://github.com/w3c-fedid/digital-credentials/pull/420">Pull
request #420</a>.
</aside>
<ol class="algorithm">
<li>Let |global| be |document|'s [=relevant global object=].
</li>
<li>If the [=credential request coordinator=] is not in the "[=credential
request coordinator/idle=]" [=credential request coordinator/interaction
state=]:
<ol>
<li>[=Queue a global task=] on the [=DOM manipulation task source=]
given |global| to [=reject=] |promise| with an
{{"NotAllowedError"}} {{DOMException}}.
</li>
<li>Return.
</li>
</ol>
</li>
<li>Assert: the [=credential request coordinator=]'s [=credential request
coordinator/active promise=] is `null`.
</li>
<li>Set the [=credential request coordinator=]'s [=credential request
coordinator/active promise=] to |promise|.
</li>
<li>If |signal| was passed:
<ol>
<li>Set the [=credential request coordinator=]'s [=credential request
coordinator/abort signal=] to |signal|.
</li>
<li>Let |abortAlgorithm| be the following algorithm:
<ol>
<li>If the [=credential request coordinator=]'s [=credential
request coordinator/active promise=] is not |promise|, return.
</li>
<li>[=credential request coordinator/Abort the credential
request=] |signal|'s [=AbortSignal/abort reason=].
</li>
</ol>
</li>
<li>Set the [=credential request coordinator=]'s [=credential request
coordinator/abort algorithm=] to |abortAlgorithm|.
</li>
<li>[=AbortSignal/Add=] |abortAlgorithm| to |signal|.
</li>
</ol>
</li>
<li>Let |validatedRequests| be a new empty [=list=].
</li>
<li>[=List/For each=] |request| of |requests|:
<ol>
<li>Let |protocol| be |request|'s
{{DigitalCredentialGetRequest/protocol}}, if |request| is a
{{DigitalCredentialGetRequest}}, or |request|'s
{{DigitalCredentialCreateRequest/protocol}}, if |request| is a
{{DigitalCredentialCreateRequest}}.
</li>
<li>If |protocol| does not equal any [=enumeration value=] in
{{DigitalCredentialProtocol}}, [=iteration/continue=].
</li>
<li>If the [=user agent=] does not allow |protocol|,
[=iteration/continue=].
</li>
<li>Let |validatedRequest| be the result of validating |request|'s
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>Let |validatedRequest| be the result of validating |request|'s
<li>Let |validatedRequestOrException| be the result of validating |request|'s

[=digital credential/request data=] according to |request|'s
[=digital credential/presentation protocol=] or other criteria.
Validation requirements are protocol-specific and are outside the
scope of this specification.
<aside class="note" title="Validation details outside scope">
<p>
Validation includes verifying |request|'s [=digital
credential/request data=] conforms to the requirements of the
specified [=digital credential/presentation protocol=]. Please
refer to the specification of the specific [=digital
credential/presentation protocol=] for details, including
potential reasons for validation failure, and any security and
privacy considerations that need to be considered by
implementers during validation.
</p>
<p>
In addition to protocol-defined requirements, a [=user agent=]
might apply additional validation criteria based on local
policy, configuration, or evolving security considerations. For
example, a [=user agent=] might reject a request that (a) seeks
particular credential attributes, (b) uses or requires
cryptographic algorithms the [=user agent=] is configured not
to accept (e.g., as part of algorithm agility or a transition
to post-quantum schemes), or (c) relies on certificates or
trust anchors that are not accepted by the [=user agent=]'s
configured trust decisions.
</p>
</aside>
</li>
<li>If |validatedRequest| is an [=exception=]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>If |validatedRequest| is an [=exception=]:
<li>If |validatedRequestOrException| is an [=exception=]:

<ol>
<li>[=credential request coordinator/Complete credential request
with=] |promise| and |validatedRequest|.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with=] |promise| and |validatedRequest|.
with error=] passing |promise| and |validatedRequestOrException|.

</li>
<li>Return.
</li>
</ol>
</li>
<li>[=list/Append=] |validatedRequest| to |validatedRequests|.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>[=list/Append=] |validatedRequest| to |validatedRequests|.
<li>[=list/Append=] |validatedRequestOrException| to |validatedRequests|.

</li>
</ol>
</li>
<li>If |validatedRequests| [=list/is empty=]:
<ol>
<li>[=credential request coordinator/Complete credential request
with=] |promise| and a newly created {{TypeError}}.
</li>
<li>Return.
</li>
</ol>
</li>
<li>If |signal| was passed and |signal| is [=AbortSignal/aborted=]:
<ol>
<li>Let |error| be |signal|'s [=AbortSignal/abort reason=].
</li>
<li>[=credential request coordinator/Complete credential request
with=] |promise| and |error|.
</li>
<li>Return.
</li>
</ol>
</li>
<li>Set the [=credential request coordinator=] [=credential request
coordinator/interaction state=] to "[=credential request
coordinator/requesting=]".
</li>
<li>[=credential request coordinator/Present the credential request=]
with |document|, |validatedRequests|, and |signal|.
</li>
</ol>
<h3>
Abort the credential request
</h3>
<p>
To be written.
To <dfn data-dfn-for="credential request coordinator">abort the
credential request</dfn> given a [=Document=] |document:Document| and a
JavaScript value |error|:
</p>
<ol class="algorithm">
<li>
<aside class="issue" title="Coming soon">
See <a href=
"https://github.com/w3c-fedid/digital-credentials/pull/462">Add
"Abort the credential request" algorithm</a>.
</aside>
</li>
</ol>
<h3>
Complete credential request with error
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Complete credential request with error
Reject request with error

</h3>
Expand Down Expand Up @@ -833,7 +965,8 @@ <h3>
Present the credential request
</h3>
<p>
To be written.
<dfn data-dfn-for="credential request coordinator">Present the credential
request</dfn> to be written.
</p><!--
// MARK: The Digital Credentials API
-->
Expand Down