Skip to content

Conversation

@marcoscaceres
Copy link
Collaborator

@marcoscaceres marcoscaceres commented Jan 28, 2026

Closes #441

The DigitalCredentialProtocol will eventually hold both Issuance and Presentation protocols.

Related: #453

The following tasks have been completed:

  • Modified Web platform tests - not testable.

Implementation commitment:

  • WebKit
  • Chromium (link to issue)
  • Gecko (link to issue)

Documentation and checks

  • Affects privacy
  • Affects security
  • Pinged MDN
  • Updated Explainer
  • Updated digitalcredentials.dev

Preview | Diff

@marcoscaceres marcoscaceres marked this pull request as ready for review January 28, 2026 09:12
@marcoscaceres marcoscaceres requested a review from a team as a code owner January 28, 2026 09:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new WebIDL typedef intended to represent digital credential protocol identifiers and wires it into the DigitalCredential interface.

Changes:

  • Added DigitalCredentialsProtocol typedef.
  • Updated DigitalCredential.protocol from DOMString to DigitalCredentialsProtocol.
  • Updated userAgentAllowsProtocol()’s validation step to reference DigitalCredentialsProtocol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1012 to +1017
typedef DigitalCredentialPresentationProtocol DigitalCredentialsProtocol;

[Exposed=Window, SecureContext]
interface DigitalCredential : Credential {
[Default] object toJSON();
readonly attribute DOMString protocol;
readonly attribute DigitalCredentialsProtocol protocol;
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

DigitalCredentialsProtocol is currently just a typedef alias of DigitalCredentialPresentationProtocol, but the surrounding prose (and issue #441) indicates it should cover both presentation and issuance protocols. As written, DigitalCredential.protocol cannot represent an issuance protocol value. Consider defining a DigitalCredentialIssuanceProtocol enum and making DigitalCredentialsProtocol a union of the two enums (or keep protocol as DOMString until the issuance enum exists).

Copilot uses AI. Check for mistakes.
<li>If |protocol| is not a member of
{{DigitalCredentialPresentationProtocol}}, return `false`.
<li>If |protocol| is not an [=enumeration value=] of
{{DigitalCredentialsProtocol}}, return `false`.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

userAgentAllowsProtocol() is described as supporting both presentation and issuance protocols, but the updated check only validates against DigitalCredentialsProtocol, which currently aliases the presentation enum. This will cause the algorithm to return false for any issuance protocol identifiers. Once issuance protocols are modeled (e.g., via a dedicated enum), update this validation step to accept both sets of identifiers.

Suggested change
{{DigitalCredentialsProtocol}}, return `false`.
{{DigitalCredentialPresentationProtocol}} or
{{DigitalCredentialIssuanceProtocol}}, return `false`.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add typedef and change DigitalCredential protocol type

4 participants