Skip to content

Commit b3bf4ee

Browse files
JeffHJeffH
authored andcommitted
incorp changes suggested by mikewest and jyasskin up thru new line 895
1 parent 09a8650 commit b3bf4ee

File tree

1 file changed

+42
-29
lines changed

1 file changed

+42
-29
lines changed

index.src.html

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,21 @@ <h1>Credential Management Level 1</h1>
295295
{{Credential}}'s default implementations, as appropriate for the [=credential=] type. E.g.,
296296
[[#passwordcredential-interface]] and [[#federatedcredential-interface]].
297297

298-
<h5 id="algorithm-collect-creds" algorithm>'collect credentials' internal method</h5>
298+
<h5 id="algorithm-collect-creds" algorithm>`[[CollectFromCredentialStore]]` internal method</h5>
299299
<dfn for="Credential" method export>\[[CollectFromCredentialStore]](origin, options)</dfn> is called
300300
with an [=environment settings object/origin=] and a {{CredentialRequestOptions}}, and returns
301301
a set of {{Credential}} objects from the user
302302
agent's [=credential store=] that match the options provided. If no matching {{Credential}}
303303
objects are available, the returned set will be empty.
304304

305+
{{Credential}}'s default implementation of {{Credential/[[CollectFromCredentialStore]](origin, options)}}:
306+
305307
<ul class="algorithm">
306308
1. Return an empty set.
307309
</ul>
308310

309311

310-
<h5 id="algorithm-discover-creds" algorithm>'discover credentials' internal method</h5>
312+
<h5 id="algorithm-discover-creds" algorithm>`[[DiscoverFromExternalSource]]` internal method</h5>
311313
<dfn for="Credential" method export>\[[DiscoverFromExternalSource]](origin, options)</dfn> is called
312314
with an [=environment settings object/origin=] and a {{CredentialRequestOptions}} object.
313315
It returns a {{Credential}} if one can be
@@ -316,44 +318,56 @@ <h5 id="algorithm-discover-creds" algorithm>'discover credentials' internal meth
316318
kind of {{Credential}} is only [=effective=] for a single use or a limited time, this
317319
method is responsible for generating new [=credentials=] using a [=credential source=].
318320

321+
{{Credential}}'s default implementation of {{Credential/[[DiscoverFromExternalSource]](origin, options)}}:
322+
319323
<ul class="algorithm">
320324
1. Return `null`.
321325
</ul>
322326

323-
<h5 id="algorithm-store-cred" algorithm>'store a credential' internal method</h5>
327+
<h5 id="algorithm-store-cred" algorithm>`[[Store]]` internal method</h5>
324328
<dfn for="Credential" method export>\[[Store]](credential)</dfn> is called with a {{Credential}},
325-
and returns once {{Credential}} is persisted to the [=credential store=]:
329+
and returns once {{Credential}} is persisted to the [=credential store=].
330+
331+
{{Credential}}'s default implementation of {{Credential/[[Store]](credential)}}:
326332

327333
<ul class="algorithm">
328334
1. Return.
329335
</ul>
330-
</section>
331336

332-
<h5 id="algorithm-create-cred" algorithm>'create a credential' internal method"</h5>
333-
<dfn for="Credential" method export>\[[Create]](origin, options)</dfn> is called with
334-
with an [=environment settings object/origin=] and a {{CredentialCreationOptions}},
335-
and returns either a {{Credential}}, if one can be created,
336-
or `null` if no credential was created,
337-
or a [=constructCredential=] [=struct=],
338-
or an error if creation fails due to exceptional situations
339-
(for example, incorrect options could produce a {{TypeError}}):
337+
<h5 id="algorithm-create-cred" algorithm>`[[Create]]` internal method</h5>
338+
<dfn for="Credential" method export>\[[Create]](origin, options)</dfn> is called
339+
[=in parallel=] with an [=environment settings object/origin=] and a {{CredentialCreationOptions}},
340+
and either:
341+
342+
* creates a {{Credential}}, or,
343+
* does not create a credential and returns `null`, or,
344+
* returns an error if creation fails due to exceptional situations
345+
(for example, incorrect options could produce a {{TypeError}}).
346+
347+
When creating a {{Credential}}, it will either:
348+
349+
* directly return a {{Credential}} (in which case it accomplished everything while
350+
running [=in parallel=]), or,
351+
* return a [=constructCredential=] algorithm which yields a {{Credential}} when
352+
subsequently invoked from a [=task=].
353+
354+
{{Credential}}'s default implementation of {{Credential/[[Create]](origin, options)}}:
340355

341356
<ul class="algorithm">
342357
1. Return `null`.
343358
</ul>
344359

345-
<h6 id="algorithm-construct-cred-struct">constructCredential struct</h6>
360+
<h6 id="algorithm-construct-cred">constructCredential Algorithm</h6>
346361

347-
<dfn>constructCredential</dfn> is a [=struct=] whose single [=item=] is a [=constructCredentialCallback=]:
362+
A <dfn>constructCredential</dfn> algorithm is a [=queue=] of steps
363+
to be invoked by a [=task=] from the [=DOM manipulation task source=].
364+
[=constructCredential=]'s purpose is to construct an [=interface object=] derived
365+
from {{Credential}}, given a [=current settings object=]'s
366+
[=environment settings object/global object=].
348367

349-
: <code><dfn>constructCredentialCallback</dfn></code>
350-
:: A Web IDL {{Function}} [=callback function type=] value, whose purpose is to construct,
351-
on the main [=event loop=], an [=interface object=] derived from {{Credential}}, given
352-
a [=current settings object=]'s [=environment settings object/global object=].
353-
354-
Note: <code>[=constructCredentialCallback=]</code>'s functionality is defined on a
368+
Note: <code>[=constructCredential=]</code>'s algorithm steps are defined on a
355369
per-[=credential=] type basis by those [=credential=] type specifications needing to
356-
employ it. E.g., see [[WEBAUTHN]].
370+
employ it. E.g., [[WEBAUTHN]].
357371

358372

359373

@@ -865,18 +879,17 @@ <h4 id="algorithm-create" algorithm>Create a `Credential`</h4>
865879
1. Let |r| be the result of executing |interfaces|[0]'s {{Credential/[[Create]](origin, options)}}
866880
internal method given |origin| and |options|.
867881

868-
2. If |r| is an [=exception=], [=reject=] |p| with |r|, and terminate these substeps.
882+
2. If |r| is an [=exception=] or `null`, [=reject=] |p| with |r|, and terminate these substeps.
869883

870884
3. If |r| is a {{Credential}}, [=resolve=] |p| with |r|, and terminate these substeps.
871885

872-
4. Assert: |r| is a <code>[=constructCredential=]</code> [=struct=].
873-
874-
5. Let |result| be the result of [=queue a task|queuing a task=] to run
875-
<code>|r|.[=constructCredentialCallback=]</code> given |global|, using the [=DOM manipulation task source=].
886+
4. Assert: |r| is a <code>[=constructCredential=]</code> algorithm.
876887

877-
6. If |result| is an [=exception=], [=reject=] |p| with |result| and terminate these substeps.
888+
5. [=Queue a task=] on |global|'s [=DOM manipulation task source=] to run the following substeps:
878889

879-
7. [=Resolve=] |p| with |result|.
890+
1. Let |result| be the result of [=promise-calling=] |r| given |global|.
891+
2. If |result| is an [=exception=], [=reject=] |p| with |result| and terminate these substeps.
892+
3. [=Resolve=] |p| with |result|.
880893

881894
9. Return |p|.
882895
</ol>

0 commit comments

Comments
 (0)