-
Notifications
You must be signed in to change notification settings - Fork 32
Define "prepare credential requests" algorithm #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [=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=]: | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| <ol> | ||||||
| <li>[=credential request coordinator/Complete credential request | ||||||
| with=] |promise| and |validatedRequest|. | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| </li> | ||||||
| <li>Return. | ||||||
marcoscaceres marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| </li> | ||||||
| </ol> | ||||||
| </li> | ||||||
| <li>[=list/Append=] |validatedRequest| to |validatedRequests|. | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| </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 | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| </h3> | ||||||
|
|
@@ -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 | ||||||
| --> | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.