@@ -295,19 +295,21 @@ <h1>Credential Management Level 1</h1>
295
295
{{Credential}}'s default implementations, as appropriate for the [=credential=] type. E.g.,
296
296
[[#passwordcredential-interface]] and [[#federatedcredential-interface]].
297
297
298
- < h5 id ="algorithm-collect-creds " algorithm > 'collect credentials' internal method</ h5 >
298
+ < h5 id ="algorithm-collect-creds " algorithm > `[[CollectFromCredentialStore]]` internal method</ h5 >
299
299
< dfn for ="Credential " method export > \[[CollectFromCredentialStore]](origin, options)</ dfn > is called
300
300
with an [=environment settings object/origin=] and a {{CredentialRequestOptions}}, and returns
301
301
a set of {{Credential}} objects from the user
302
302
agent's [=credential store=] that match the options provided. If no matching {{Credential}}
303
303
objects are available, the returned set will be empty.
304
304
305
+ {{Credential}}'s default implementation of {{Credential/[[CollectFromCredentialStore]](origin, options)}}:
306
+
305
307
< ul class ="algorithm ">
306
308
1. Return an empty set.
307
309
</ ul >
308
310
309
311
310
- < h5 id ="algorithm-discover-creds " algorithm > 'discover credentials' internal method</ h5 >
312
+ < h5 id ="algorithm-discover-creds " algorithm > `[[DiscoverFromExternalSource]]` internal method</ h5 >
311
313
< dfn for ="Credential " method export > \[[DiscoverFromExternalSource]](origin, options)</ dfn > is called
312
314
with an [=environment settings object/origin=] and a {{CredentialRequestOptions}} object.
313
315
It returns a {{Credential}} if one can be
@@ -316,44 +318,56 @@ <h5 id="algorithm-discover-creds" algorithm>'discover credentials' internal meth
316
318
kind of {{Credential}} is only [=effective=] for a single use or a limited time, this
317
319
method is responsible for generating new [=credentials=] using a [=credential source=].
318
320
321
+ {{Credential}}'s default implementation of {{Credential/[[DiscoverFromExternalSource]](origin, options)}}:
322
+
319
323
< ul class ="algorithm ">
320
324
1. Return `null`.
321
325
</ ul >
322
326
323
- < h5 id ="algorithm-store-cred " algorithm > 'store a credential' internal method</ h5 >
327
+ < h5 id ="algorithm-store-cred " algorithm > `[[Store]]` internal method</ h5 >
324
328
< 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)}}:
326
332
327
333
< ul class ="algorithm ">
328
334
1. Return.
329
335
</ ul >
330
- </ section >
331
336
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)}}:
340
355
341
356
< ul class ="algorithm ">
342
357
1. Return `null`.
343
358
</ ul >
344
359
345
- < h6 id ="algorithm-construct-cred-struct "> constructCredential struct </ h6 >
360
+ < h6 id ="algorithm-construct-cred "> constructCredential Algorithm </ h6 >
346
361
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=].
348
367
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
355
369
per-[=credential=] type basis by those [=credential=] type specifications needing to
356
- employ it. E.g., see [[WEBAUTHN]].
370
+ employ it. E.g., [[WEBAUTHN]].
357
371
358
372
359
373
@@ -865,18 +879,17 @@ <h4 id="algorithm-create" algorithm>Create a `Credential`</h4>
865
879
1. Let |r| be the result of executing |interfaces|[0]'s {{Credential/[[Create]](origin, options)}}
866
880
internal method given |origin| and |options|.
867
881
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.
869
883
870
884
3. If |r| is a {{Credential}}, [=resolve=] |p| with |r|, and terminate these substeps.
871
885
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.
876
887
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:
878
889
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|.
880
893
881
894
9. Return |p|.
882
895
</ ol >
0 commit comments