From db9914854e18fa424824bec0c7626e2251be02d2 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 16 Dec 2025 21:26:21 +1100 Subject: [PATCH 1/8] Define "Present credential requests" algorithm. --- index.html | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6452e5c9..a3228267 100644 --- a/index.html +++ b/index.html @@ -661,11 +661,115 @@

To be written.

- Abort the credential request + Present the credential request

- To be written. + To present the + credential request given a [=Document=] |document|, a [=sequence=] + of validated credential requests |validatedRequests|, and an optional + {{AbortSignal}} |signal|:

+
    +
  1. Let |requestData| be [=struct=] consisting of |validatedRequests|, + |document|'s [=relevant settings object=]'s [=environment settings + object/origin=], and |document|'s [=Document/origin=]. +
  2. +
  3. Present a [=credential chooser=] with |requestData| and wait for the + user to either: +
      +
    • Select a [=digital credential=] and [=holder=] that can fulfill + the request, or +
    • +
    • Cancel the operation. +
    • +
    +
  4. +
  5. If |signal| was passed and |signal| is [=AbortSignal/aborted=]: +
      +
    1. Return. +

      + The [=abort steps=] added to |signal| handle tearing down the + [=credential chooser=]. +

      +
    2. +
    +
  6. +
  7. If the user cancels the operation or no credential was selected: +
      +
    1. [=credential request coordinator/Complete credential request with + error=] with |document| and {{"AbortError"}} {{DOMException}}. +
    2. +
    3. Return. +
    4. +
    +
  8. +
  9. If the platform returns a platform-specific |error|: +
      +
    1. Let |exception| be the appropriate {{DOMException}} for that + |error|. +
    2. +
    3. [=credential request coordinator/Complete credential request with + error=] with |document| and |exception|. +
    4. +
    5. Return. +
    6. +
    +
  10. +
  11. If a [=digital credential=] was selected by the user: +
      +
    1. Let |responseData| be a [=string=] [=digital + credential/presentation response=] or [=string=] [=digital + credential/issuance response=] returned by the [=holder=]. +
    2. +
    3. Let |protocol| be the [=digital credential/exchange protocol=] or + [=digital credential/issuance protocol=] identifier used in the + exchange. +
    4. +
    5. Let |parsedData| be the result of [=parse a JSON string to a + JavaScript value=] passing |responseData|. +
    6. +
    7. If |parsedData| is an [=exception=]: +
        +
      1. [=credential request coordinator/Complete credential request + with error=] with |document| and |parsedData|. +
      2. +
      3. Return. +
      4. +
      +
    8. +
    9. If |parsedData| is not an [=object=]: +
        +
      1. [=credential request coordinator/Complete credential request + with error=] with |document| and {{TypeError}}. +
      2. +
      3. Return. +
      4. +
      +
    10. +
    11. Let |credential| be a new {{DigitalCredential}} object with its + {{DigitalCredential/data}} set to |parsedData| and its + {{DigitalCredential/protocol}} set to |protocol|. +
    12. +
    13. [=Queue a global task=] on the [=DOM manipulation task source=] + given |document|'s [=relevant global object=] to perform the + following steps: +
        +
      1. Set the [=credential request coordinator=] [=credential + request coordinator/interaction state=] to "[=credential request + coordinator/idle=]". +
      2. +
      3. [=Resolve=] the [=credential request coordinator=]'s + [=credential request coordinator/active promise=] with + |credential|. +
      4. +
      5. Set the [=credential request coordinator=]'s [=credential + request coordinator/active promise=] to `null`. +
      6. +
      +
    14. +
    +
  12. +

Complete credential request with error

From 6f2ab6e8872a70a53730a8c7c02a35a793135e32 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 8 Jan 2026 14:19:57 +1100 Subject: [PATCH 2/8] Don't pass document and cleanup --- index.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index a3228267..eb6ccc9c 100644 --- a/index.html +++ b/index.html @@ -696,20 +696,21 @@

  • If the user cancels the operation or no credential was selected:
      +
    1. Let |error| be a newly created {{"AbortError"}} {{DOMException}}. +
    2. [=credential request coordinator/Complete credential request with - error=] with |document| and {{"AbortError"}} {{DOMException}}. + error=] |error|.
    3. Return.
  • -
  • If the platform returns a platform-specific |error|: +
  • If the platform returns a platform-specific error:
      -
    1. Let |exception| be the appropriate {{DOMException}} for that - |error|. +
    2. Let |error| be the appropriate {{DOMException}} for that error.
    3. [=credential request coordinator/Complete credential request with - error=] with |document| and |exception|. + error=] |error|.
    4. Return.
    5. @@ -731,7 +732,7 @@

    6. If |parsedData| is an [=exception=]:
      1. [=credential request coordinator/Complete credential request - with error=] with |document| and |parsedData|. + with error=] with |parsedData|.
      2. Return.
      3. @@ -739,8 +740,10 @@

      4. If |parsedData| is not an [=object=]:
          +
        1. Let |error| be a newly created {{TypeError}}. +
        2. [=credential request coordinator/Complete credential request - with error=] with |document| and {{TypeError}}. + with error=] |error|.
        3. Return.
        4. From 4a2fb73771fd0327f34241504e5bd07fe0c96e9a Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Fri, 9 Jan 2026 15:48:08 +1100 Subject: [PATCH 3/8] use new aliases and cleanup --- index.html | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index eb6ccc9c..03db9d5b 100644 --- a/index.html +++ b/index.html @@ -688,8 +688,9 @@

          1. Return.

            - The [=abort steps=] added to |signal| handle tearing down the - [=credential chooser=]. + The algorithm [=AbortSignal/add|added=] to |signal| by the + [=credential request coordinator/prepare credential requests=] + steps handle tearing down the [=credential chooser=].

          @@ -698,8 +699,8 @@

          1. Let |error| be a newly created {{"AbortError"}} {{DOMException}}.
          2. -
          3. [=credential request coordinator/Complete credential request with - error=] |error|. +
          4. [=credential request coordinator/Complete credential request + with=] |error|.
          5. Return.
          6. @@ -709,8 +710,8 @@

            1. Let |error| be the appropriate {{DOMException}} for that error.
            2. -
            3. [=credential request coordinator/Complete credential request with - error=] |error|. +
            4. [=credential request coordinator/Complete credential request + with=] |error|.
            5. Return.
            6. @@ -726,24 +727,24 @@

              [=digital credential/issuance protocol=] identifier used in the exchange. -
            7. Let |parsedData| be the result of [=parse a JSON string to a - JavaScript value=] passing |responseData|. +
            8. Let |parsedDataOrError| be the result of [=parse a JSON string to + a JavaScript value=] passing |responseData|.
            9. -
            10. If |parsedData| is an [=exception=]: +
            11. If |parsedDataOrError| is an [=exception=]:
              1. [=credential request coordinator/Complete credential request - with error=] with |parsedData|. + with=] |parsedDataOrError|.
              2. Return.
            12. -
            13. If |parsedData| is not an [=object=]: +
            14. If |parsedDataOrError| is not an [=object=]:
              1. Let |error| be a newly created {{TypeError}}.
              2. [=credential request coordinator/Complete credential request - with error=] |error|. + with=] |error|.
              3. Return.
              4. From fd2b4791478fb0ab77b59a839b3dae77b8495cc2 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Fri, 9 Jan 2026 16:01:18 +1100 Subject: [PATCH 4/8] Relocate protocol variable --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 03db9d5b..2c3b1338 100644 --- a/index.html +++ b/index.html @@ -723,10 +723,6 @@

                credential/presentation response=] or [=string=] [=digital credential/issuance response=] returned by the [=holder=]. -
              5. Let |protocol| be the [=digital credential/exchange protocol=] or - [=digital credential/issuance protocol=] identifier used in the - exchange. -
              6. Let |parsedDataOrError| be the result of [=parse a JSON string to a JavaScript value=] passing |responseData|.
              7. @@ -750,8 +746,12 @@

            15. +
            16. Let |protocol| be the [=digital credential/exchange protocol=] or + [=digital credential/issuance protocol=] identifier used in the + exchange. +
            17. Let |credential| be a new {{DigitalCredential}} object with its - {{DigitalCredential/data}} set to |parsedData| and its + {{DigitalCredential/data}} set to |parsedDataOrError| and its {{DigitalCredential/protocol}} set to |protocol|.
            18. [=Queue a global task=] on the [=DOM manipulation task source=] From a98d21501d633c88c9a3185fca21b6f10742fbaa Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Fri, 9 Jan 2026 16:02:54 +1100 Subject: [PATCH 5/8] Add back the Abort the credential request section --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 2c3b1338..3eeecd24 100644 --- a/index.html +++ b/index.html @@ -660,6 +660,12 @@

              To be written.

              +

              + Abort the credential request +

              +

              + To be written. +

              Present the credential request

              From 81b1aea8a249b4b7de517e411285198670550381 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Wed, 28 Jan 2026 20:01:46 +1100 Subject: [PATCH 6/8] Make use of DigitalCredentialProtocol --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 3a6cc1ca..1e8f2208 100644 --- a/index.html +++ b/index.html @@ -752,13 +752,13 @@

            -
          7. Let |protocol| be the [=digital credential/exchange protocol=] or - [=digital credential/issuance protocol=] identifier used in the - exchange. +
          8. Let |protocol:DigitalCredentialProtocol| be the + {{DigitalCredentialProtocol}} [=enumeration value=] that matches the + [=digital credential/protocol identifier=] used in the exchange.
          9. -
          10. Let |credential| be a new {{DigitalCredential}} object with its - {{DigitalCredential/data}} set to |parsedDataOrError| and its - {{DigitalCredential/protocol}} set to |protocol|. +
          11. Let |credential| be a newly created {{DigitalCredential}} instance with its + {{DigitalCredential/data}} initialized to |parsedDataOrError| and its + {{DigitalCredential/protocol}} initialized to |protocol|.
          12. [=Queue a global task=] on the [=DOM manipulation task source=] given |document|'s [=relevant global object=] to perform the @@ -1033,7 +1033,7 @@

            [Exposed=Window, SecureContext] interface DigitalCredential : Credential { [Default] object toJSON(); - readonly attribute DOMString protocol; + readonly attribute DigitalCredentialProtocol protocol; [SameObject] readonly attribute object data; static boolean userAgentAllowsProtocol(DOMString protocol); }; From 53206fd6bd2ec6c8defc589e818114452d0bf902 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 3 Feb 2026 15:22:51 +1100 Subject: [PATCH 7/8] tidy --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 1e8f2208..25394e14 100644 --- a/index.html +++ b/index.html @@ -756,9 +756,10 @@

            {{DigitalCredentialProtocol}} [=enumeration value=] that matches the [=digital credential/protocol identifier=] used in the exchange.

          13. -
          14. Let |credential| be a newly created {{DigitalCredential}} instance with its - {{DigitalCredential/data}} initialized to |parsedDataOrError| and its - {{DigitalCredential/protocol}} initialized to |protocol|. +
          15. Let |credential| be a newly created {{DigitalCredential}} + instance with its {{DigitalCredential/data}} initialized to + |parsedDataOrError| and its {{DigitalCredential/protocol}} + initialized to |protocol|.
          16. [=Queue a global task=] on the [=DOM manipulation task source=] given |document|'s [=relevant global object=] to perform the From 684b38bdbdc46c6ee541cabec3abe4e4566f16cd Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Mon, 16 Feb 2026 14:41:53 +1100 Subject: [PATCH 8/8] Remove redudant heading --- index.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index f810351f..31491f84 100644 --- a/index.html +++ b/index.html @@ -747,7 +747,9 @@

            To be written. -

            +

            Present the credential request

            @@ -893,13 +895,7 @@

          -

        -

        - Present the credential request -

        -

        - To be written. -