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
259 changes: 259 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,265 @@ <h2>
This section is a work in progress as this document evolves.
</p>
</section>
<section id="user-agent-automation" data-cite="webdriver">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: let ReSpec handle the id generation.

Suggested change
<section id="user-agent-automation" data-cite="webdriver">
<section data-cite="webdriver">

<h2>
User Agent Automation
</h2>
<p>
For the purposes of user agent automation and web application testing,
this document defines a number of [[WebDriver]] [=extension commands=].
</p>
<section id="webdriver-extension-capability">
<h3>
Digital Credentials WebDriver Extension Capability
</h3>
<p>
In order to advertise the availability of [=extension commands=]
defined below, a new extension capability is defined.
</p>
<table class="data">
<thead>
<tr>
<th>
Capability
</th>
<th>
Key
</th>
<th>
Value Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Virtual Wallet Support
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Virtual Wallet Support
Virtual Credential Manager Support

Copy link
Collaborator

Choose a reason for hiding this comment

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

We haven't really used "wallet" formally... we've stuck to holder... so I wonder if this should be "virtual holder"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timcappalli I am aware of your preferences to use "Credential Manager" instead of holder or wallet, but I think we should do this holistically in the whole spec at one time if we decide to. I won't start with the testing.

@marcoscaceres Yes, I can see we haven't used wallet formally, but given this API is exposed to web developers as well as browser engineers, I believe "wallet" is the more widely-used term in the ecosystem.
"holder" might be even more confusing IMHO.
We can also add a definition to wallet in this section. WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Discussed with @mohamedamir and drafted:
#386

And hopefully that covers the "manager" aspect that @timcappalli would like included in the definition, while giving us a well understood concept by developer and implementers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think "virtual (whatever)" is not accurate and will be misunderstood.

Better might be "software (whatever)" (even if it's implemented on hardware, it's still software doing the lifting).

Rather than Virtual Credential Manager Support, I would suggest Support for Software Credential Managers or perhaps Support for Agentic Credential Managers.

</td>
<td>
`digital-credentials:virtualWallet`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`digital-credentials:virtualWallet`
`digital-credentials:virtualHolder`

</td>
<td>
[=boolean=]
</td>
<td>
Indicates whether the endpoint node supports all Virtual Wallet
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Indicates whether the endpoint node supports all Virtual Wallet
Indicates whether the endpoint node supports all Virtual Credential Manager

commands.
</td>
</tr>
</tbody>
</table>
<p>
When <a data-cite="webdriver#dfn-validate-capabilities">validating
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: avoid using data-cite... if something hasn't been exported from Web Driver, we should send a PR to web driver to export the definition we need.

capabilities</a>, the extension-specific substeps to validate
`digital-credentials:virtualWallet` with `value` are the following:
</p>
<ol class="algorithm">
<li>If `value` is not a [=boolean=], return a [=error|WebDriver
error=] with a [=error code|WebDriver error code=] [=invalid
argument=].
</li>
<li>Otherwise, let `deserialized` be set to `value`.
</li>
</ol>
<p>
When <a data-cite="webdriver#dfn-matching-capabilities">matching
capabilities</a>, the extension-specific steps to match
`digital-credentials:virtualWallet` with `value` are the following:
</p>
<ol class="algorithm">
<li>If `value is <code>true` and the <a data-cite=
"webdriver#dfn-endpoint-node">endpoint node</a> does not support any
of the Virtual Wallet commands, the match is unsuccessful.</code>
</li>
<li>
<code>Otherwise, the match is successful.</code>
</li>
</ol>
</section>
<section id="virtual-wallet-commands">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<section id="virtual-wallet-commands">
<section id="virtual-cm-commands">

Copy link
Collaborator

Choose a reason for hiding this comment

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

Best to avoid acronyms 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how much acronym avoidance matters in fragment identifiers, but it still might be better to abbreviate somewhat less, perhaps as —

Suggested change
<section id="virtual-wallet-commands">
<section id="virtual-cred-mgr-commands">

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can leave ReSpec to generate the ids. It knows best.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Pro-tip: you can also omit the section tag (ReSpec adds it automatically)

<h3>
<code>Virtual Wallet Commands</code>
</h3>
<p>
<code>The following commands allow controlling the behavior of a
virtual wallet for testing purposes. These commands affect the
<dfn>next wallet behavior</dfn> of the next
`navigator.credentials.get({digital: ...})` or
`navigator.credentials.create({digital: ...})` call.</code>
</p>
<section id="set-wallet-response">
<h4>
<code><dfn>Set Wallet Response</dfn></code>
</h4>
<p>
<code>The [=Set Wallet Response=] [[WebDriver]] [=extension
command=] configures the virtual wallet to respond with a specific
data payload, simulating a user successfully completing the
flow.</code>
</p>
<table class="data">
<thead>
<tr>
<th>
HTTP Method
</th>
<th>
URI Template
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
`POST`
</td>
<td>
<code>/session/{session
id}/digital-credentials/response</code>
</td>
</tr>
</tbody>
</table>
<p>
The parameters object is a JSON <a data-cite=
"webdriver#dfn-object">Object</a> with the following key:
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above... we should get "object" exported from Web Driver.

</p>
<table class="data">
<thead>
<tr>
<th>
Key
</th>
<th>
Value Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
`data`
</td>
<td>
string
</td>
<td>
The data to be returned by the wallet.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The data to be returned by the wallet.
The data to be returned by the credential manager.

</td>
</tr>
</tbody>
</table>
<p>
The [=remote end steps=] are:
</p>
<ol class="algorithm">
<li>If `parameters` is not a JSON <a data-cite=
"webdriver#dfn-object">Object</a>, or if it does not contain a
`data` property of type string, return a [=error|WebDriver error=]
with [=error code|WebDriver error code=] [=invalid argument=].
</li>
<li>Set the session's [=next wallet behavior=] to <code>{ "mode":
"respond", "data": parameters.data }</code>.
</li>
<li>Return [=success=].
</li>
</ol>
</section>
<section id="set-wallet-to-wait">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<section id="set-wallet-to-wait">
<section id="set-cm-to-wait">

<h4>
<dfn>Set Wallet to Wait</dfn>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<dfn>Set Wallet to Wait</dfn>
<dfn>Set Credential Manager to Wait</dfn>

</h4>
<p>
The [=Set Wallet to Wait=] [[WebDriver]] [=extension command=]
configures the virtual wallet to simulate a user waiting
indefinitely in the wallet UI.
Comment on lines +2320 to +2322
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The [=Set Wallet to Wait=] [[WebDriver]] [=extension command=]
configures the virtual wallet to simulate a user waiting
indefinitely in the wallet UI.
The [=Set Credential Manager to Wait=] [[WebDriver]] [=extension command=]
configures the virtual credential manager to simulate a user waiting
indefinitely in the credential manager UI.

</p>
<table class="data">
<thead>
<tr>
<th>
HTTP Method
</th>
<th>
URI Template
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
`POST`
</td>
<td>
<code>/session/{session
id}/digital-credentials/response_wait</code>
</td>
</tr>
</tbody>
</table>
<p>
The [=remote end steps=] are:
</p>
<ol class="algorithm">
<li>Set the session's [=next wallet behavior=] to <code>{ "mode":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<li>Set the session's [=next wallet behavior=] to <code>{ "mode":
<li>Set the session's [=next credential manager behavior=] to <code>{ "mode":

"wait" }</code>.
</li>
<li>Return [=success=].
</li>
</ol>
</section>
<section id="set-wallet-to-decline">
<h4>
<dfn>Set Wallet to Decline</dfn>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should say "abort" here to keep terminology consistent? (i.e., affectively this become an AbortError, right)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

YEs, but it's to simulate a user "declining" the flow.
I feel "decline" is more natural.
Let me know if you feel strongly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, "declining" is fine... was mostly an editorial suggestion.

Comment on lines +2358 to +2360
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<section id="set-wallet-to-decline">
<h4>
<dfn>Set Wallet to Decline</dfn>
<section id="set-cm-to-decline">
<h4>
<dfn>Set Credential Manager to Decline</dfn>

</h4>
<p>
The [=Set Wallet to Decline=] [[WebDriver]] [=extension command=]
configures the virtual wallet to simulate a user declining the
request.
Comment on lines +2363 to +2365
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The [=Set Wallet to Decline=] [[WebDriver]] [=extension command=]
configures the virtual wallet to simulate a user declining the
request.
The [=Set Credential Manager to Decline=] [[WebDriver]] [=extension command=]
configures the virtual credential manager to simulate a user declining the
request.

</p>
<table class="data">
<thead>
<tr>
<th>
HTTP Method
</th>
<th>
URI Template
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
`POST`
</td>
<td>
<code>/session/{session
id}/digital-credentials/response_decline</code>
</td>
</tr>
</tbody>
</table>
<p>
The [=remote end steps=] are:
</p>
<ol class="algorithm">
<li>Set the session's [=next wallet behavior=] to <code>{ "mode":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<li>Set the session's [=next wallet behavior=] to <code>{ "mode":
<li>Set the session's [=next credential manager behavior=] to <code>{ "mode":

"decline" }</code>.
</li>
<li>Return [=success=].
</li>
</ol>
</section>
</section>
</section>
<section id="idl-index"></section>
<section id="conformance"></section>
<h2 class="appendix">
Expand Down