Skip to content

Commit fbd9dac

Browse files
committed
CREDENTIAL: Cleanup 'request credential'.
Closes #289.
1 parent 10d856a commit fbd9dac

File tree

2 files changed

+69
-17
lines changed

2 files changed

+69
-17
lines changed

specs/credentialmanagement/index.html

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,13 +1751,42 @@ <h4 class="heading settled" data-level="4.1.1" id="request-credential"><span cla
17511751

17521752

17531753
<li>
1754-
Let <var>type</var> be lowest common ancestor interface of the types
1755-
referenced in <var>types</var>.
1754+
Let <var>types</var> be an empty set.
1755+
1756+
1757+
1758+
<li>
1759+
For each <var>key</var> in <var>options</var>:
1760+
1761+
1762+
<ol>
1763+
1764+
<li>
1765+
Let <var>interface</var> be the interface whose name is
1766+
<var>key</var>, or <code>null</code> if no interface’s name
1767+
matches.
1768+
1769+
1770+
1771+
<li>
1772+
If <var>interface</var> is not <code>null</code>, insert
1773+
<var>interface</var> into <var>possible types</var>.
1774+
1775+
1776+
1777+
</ol>
1778+
1779+
1780+
1781+
1782+
<li>
1783+
Let <var>type</var> be the lowest common ancestor interface of the
1784+
interfaces contained in <var>types</var>.
17561785

17571786

1758-
<p class="issue" id="issue-6005a2a4"><a class="self-link" href="#issue-6005a2a4"></a> This is terribly hand-wavey. The intent is
1759-
clear, but I need to do the work to walk through the list of DOMStrings
1760-
and convert them to interfaces and etc. Busywork for later. <a href="https://github.com/w3c/webappsec/issues/289">&lt;https://github.com/w3c/webappsec/issues/289></a></p>
1787+
<p class="note" role="note">Note: That is, given a set containing <code class="idl"><a data-link-type="idl" href="#passwordcredential">PasswordCredential</a></code> and
1788+
<code class="idl"><a data-link-type="idl" href="#federatedcredential">FederatedCredential</a></code>, <var>type</var> will be
1789+
<code class="idl"><a data-link-type="idl" href="#originboundcredential">OriginBoundCredential</a></code>.</p>
17611790

17621791

17631792

@@ -1784,9 +1813,15 @@ <h4 class="heading settled" data-level="4.1.1" id="request-credential"><span cla
17841813

17851814
<dl>
17861815

1816+
<dt><code class="idl"><a data-link-type="idl" href="#federatedcredential">FederatedCredential</a></code>
1817+
1818+
17871819
<dt><code class="idl"><a data-link-type="idl" href="#originboundcredential">OriginBoundCredential</a></code>
17881820

17891821

1822+
<dt><code class="idl"><a data-link-type="idl" href="#passwordcredential">PasswordCredential</a></code>
1823+
1824+
17901825
<dd>
17911826

17921827
<ol>
@@ -2103,7 +2138,7 @@ <h4 class="heading settled" data-level="4.2.2" id="request-originboundcredential
21032138
</span><a class="self-link" href="#request-originboundcredential-without-mediation"></a></h4>
21042139

21052140

2106-
<p>This algorithm accepts an <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6454#section-3.2">origin</a> (<var>origin</var>), a sequence of
2141+
<p>This algorithm accepts an <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6454#section-3.2">origin</a> (<var>origin</var>), a set of
21072142
type names (<var>types</var>) and an <code class="idl"><a data-link-type="idl" href="#dictdef-credentialrequestoptions">CredentialRequestOptions</a></code> dictionary
21082143
(<var>options</var>), and returns either a single <code class="idl"><a data-link-type="idl" href="#originboundcredential">OriginBoundCredential</a></code>
21092144
object <strong>if and only if</strong> one can be provided without user
@@ -2167,7 +2202,7 @@ <h4 class="heading settled" data-level="4.2.3" id="request-originboundcredential
21672202
</span><a class="self-link" href="#request-originboundcredential-with-mediation"></a></h4>
21682203

21692204

2170-
<p>This algorithm accepts an <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6454#section-3.2">origin</a> (<var>origin</var>), a sequence of
2205+
<p>This algorithm accepts an <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc6454#section-3.2">origin</a> (<var>origin</var>), a set of
21712206
type names (<var>types</var>) and an <code class="idl"><a data-link-type="idl" href="#dictdef-credentialrequestoptions">CredentialRequestOptions</a></code> dictionary
21722207
(<var>options</var>), and returns either a single <code class="idl"><a data-link-type="idl" href="#originboundcredential">OriginBoundCredential</a></code>
21732208
object, or <code>null</code> if none can be provided.</p>
@@ -3647,9 +3682,6 @@ <h2 class="no-num heading settled" id="issues-index"><span class="content">Issue
36473682
<div class="issue"> Monkey-patching! Hooray! Talk with Anne, et al.<a href="#issue-020f94b2"></a></div>
36483683
<div class="issue"> Currently, we’re not protecting requests with opaque bodies from
36493684
Service Worker interception. Should we?<a href="#issue-be0db764"></a></div>
3650-
<div class="issue"> This is terribly hand-wavey. The intent is
3651-
clear, but I need to do the work to walk through the list of DOMStrings
3652-
and convert them to interfaces and etc. Busywork for later. <a href="https://github.com/w3c/webappsec/issues/289">&lt;https://github.com/w3c/webappsec/issues/289></a><a href="#issue-6005a2a4"></a></div>
36533685
<div class="issue"> Add some thoughts here about when and how the API
36543686
should be used, especially with regard to <code class="idl"><a data-link-type="idl" href="#dom-credentialrequestoptions-suppressui">suppressUI</a></code>. <a href="https://github.com/w3c/webappsec/issues/290">&lt;https://github.com/w3c/webappsec/issues/290></a><a href="#issue-e1d9f1af"></a></div>
36553687
<div class="issue">

specs/credentialmanagement/index.src.html

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,12 +1102,30 @@ <h4 id="request-credential">
11021102
</ol>
11031103
</li>
11041104
<li>
1105-
Let <var>type</var> be lowest common ancestor interface of the types
1106-
referenced in <var>types</var>.
1105+
Let <var>types</var> be an empty set.
1106+
</li>
1107+
<li>
1108+
For each <var>key</var> in <var>options</var>:
11071109

1108-
ISSUE(w3c/webappsec#289): This is terribly hand-wavey. The intent is
1109-
clear, but I need to do the work to walk through the list of DOMStrings
1110-
and convert them to interfaces and etc. Busywork for later.
1110+
<ol>
1111+
<li>
1112+
Let <var>interface</var> be the interface whose name is
1113+
<var>key</var>, or <code>null</code> if no interface's name
1114+
matches.
1115+
</li>
1116+
<li>
1117+
If <var>interface</var> is not <code>null</code>, insert
1118+
<var>interface</var> into <var>possible types</var>.
1119+
</li>
1120+
</ol>
1121+
</li>
1122+
<li>
1123+
Let <var>type</var> be the lowest common ancestor interface of the
1124+
interfaces contained in <var>types</var>.
1125+
1126+
Note: That is, given a set containing {{PasswordCredential}} and
1127+
{{FederatedCredential}}, <var>type</var> will be
1128+
{{OriginBoundCredential}}.
11111129
</li>
11121130
<li>
11131131
Return a <code>Promise</code> rejected with <code>TypeMismatchError</code>
@@ -1123,7 +1141,9 @@ <h4 id="request-credential">
11231141
Switch on <var>type</var>, and execute the associated steps:
11241142

11251143
<dl>
1144+
<dt>{{FederatedCredential}}</dt>
11261145
<dt>{{OriginBoundCredential}}</dt>
1146+
<dt>{{PasswordCredential}}</dt>
11271147
<dd>
11281148
<ol>
11291149
<li>
@@ -1331,7 +1351,7 @@ <h4 id="request-originboundcredential-without-mediation">
13311351
Request a <code>OriginBoundCredential</code> <em>without</em> user mediation
13321352
</h4>
13331353

1334-
This algorithm accepts an <a>origin</a> (<var>origin</var>), a sequence of
1354+
This algorithm accepts an <a>origin</a> (<var>origin</var>), a set of
13351355
type names (<var>types</var>) and an {{CredentialRequestOptions}} dictionary
13361356
(<var>options</var>), and returns either a single {{OriginBoundCredential}}
13371357
object <strong>if and only if</strong> one can be provided without user
@@ -1376,7 +1396,7 @@ <h4 id="request-originboundcredential-with-mediation">
13761396
Request a <code>OriginBoundCredential</code> with user mediation
13771397
</h4>
13781398

1379-
This algorithm accepts an <a>origin</a> (<var>origin</var>), a sequence of
1399+
This algorithm accepts an <a>origin</a> (<var>origin</var>), a set of
13801400
type names (<var>types</var>) and an {{CredentialRequestOptions}} dictionary
13811401
(<var>options</var>), and returns either a single {{OriginBoundCredential}}
13821402
object, or <code>null</code> if none can be provided.

0 commit comments

Comments
 (0)