-
Notifications
You must be signed in to change notification settings - Fork 28
Get steps #372
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
Draft
marcoscaceres
wants to merge
7
commits into
main
Choose a base branch
from
get_steps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Get steps #372
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e8b28fb
Refine discoverFromExternalSource
marcoscaceres 9dad7f0
fixup
marcoscaceres a47c818
move request for ui elsewhere
marcoscaceres 8fcc411
more robust error handling
marcoscaceres 1e35e6f
make checks optional
marcoscaceres ba40d9c
Merge branch 'main' into get_steps
marcoscaceres 02350e3
Merge branch 'main' into get_steps
marcoscaceres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -756,6 +756,17 @@ <h3> | |
| [[\DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors) | ||
| internal method | ||
| </h3> | ||
| <aside class="note" title= | ||
| "How is the DiscoverFromExternalSource() internal method invoked?"> | ||
| <p> | ||
| The [[[credential-management-1]]] specification defines the | ||
| {{CredentialsContainer/get()}} method, which runs the [=request a | ||
| credential=] algorithm. If no exceptions are raised, that algorithm | ||
| eventualy invokes the {{DigitalCredential}}'s | ||
| {{DigitalCredential/[[DiscoverFromExternalSource]](origin, options, | ||
| sameOriginWithAncestors)}} internal method. | ||
| </p> | ||
| </aside> | ||
| <p> | ||
| When invoked, the <dfn class="export" data-dfn-for= | ||
| "DigitalCredential">[[\DiscoverFromExternalSource]](origin, options, | ||
|
|
@@ -778,23 +789,65 @@ <h3> | |
| <li>Let |requests| be |options|'s {{CredentialRequestOptions/digital}}'s | ||
| {{DigitalCredentialRequestOptions/requests}} member. | ||
| </li> | ||
| <li>If |requests| is empty, [=exception/throw=] a {{TypeError}}. | ||
| <li>If |requests| [=list/is empty=], [=exception/throw=] a {{TypeError}}. | ||
| </li> | ||
| <li>[=List/For each=] |request| of |requests|: | ||
| <ol> | ||
| <li>[=serialize a JavaScript value to a JSON string|Serialize=] | ||
| |request| to a JSON string. [=exception/throw|Re-throw=] any | ||
| [=exception=]. | ||
| </li> | ||
| <li>Let |protocol| be |request|'s | ||
| {{DigitalCredentialGetRequest/protocol}}. | ||
| </li> | ||
| <li>Optionally, if |protocol| is unknown to the user agent, | ||
| [=exception/throw=] a {{TypeError}}. | ||
| <aside class="note"> | ||
| <p> | ||
| Implementations can represent [=digital credential/exchange | ||
| protocols=] as an [=enumeration=], which by the processing | ||
| rules of WebIDL results in a {{TypeError}}. | ||
| </p> | ||
| </aside> | ||
| </li> | ||
| <li>If |protocol| is not supported by the user agent, | ||
| [=exception/throw=] a {{"NotSupportedError"}} {{DOMException}}. | ||
| </li> | ||
| <li>If |protocol| is not allowed by the user agent for security | ||
| reasons, [=exception/throw=] a {{"SecurityError"}} {{DOMException}}. | ||
| </li> | ||
|
Comment on lines
+813
to
+818
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. Discussed with @mohamedamir, these can probably also be dropped on the floor. |
||
| <li>If the [=registry/link|specification=] corresponding to | ||
| |protocol| defines an IDL [=dictionary=] for [=converted to an idl | ||
| value|conversion=]: | ||
| <ol> | ||
| <li>Let |converted| be |request|'s | ||
| {{DigitalCredentialGetRequest/data}} [=converted to an idl | ||
| value|converted=] to that dictionary. [=exception/throw|Rethrow=] | ||
| any exceptions. | ||
| </li> | ||
| </ol> | ||
| </li> | ||
| <li>Otherwise, let |data| be |request|'s | ||
| {{DigitalCredentialGetRequest/data}}. | ||
| </li> | ||
| <li>Optionally, validate |data| against any validation rules set | ||
| forth in the corresponding [=registry/link|specification=]. If any of | ||
| |data|'s members are invalid, [=exception/throw=] a {{TypeError}}. | ||
| </li> | ||
| </ol> | ||
| </li> | ||
| <li> | ||
| <aside class="issue"> | ||
| Details of how to actually get the [=digital credential=] are | ||
| forthcoming. | ||
| </aside> | ||
| <li>Let |coordinator| be the [=credential request coordinator=] | ||
| associated with |document|'s [=top-level traversable=]. | ||
| </li> | ||
| <li>Let |signal| be |options|'s {{CredentialRequestOptions/signal}}, if | ||
| present. | ||
| </li> | ||
| <li>Let |result| be the result of awaiting the [=present credential | ||
| request UI=] algorithm, passing |document|, |requests|, and |signal|. | ||
| </li> | ||
| <li>If |result| is an [=exception=], [=exception/throw=] that exception. | ||
| </li> | ||
| <li>Return a {{DigitalCredential}}. | ||
| <li>Return |result|. | ||
| </li> | ||
| </ol><!-- | ||
| // MARK: [[Store]]() | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @mohamedamir. The unknown protocol should be dropped on the floor.