Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DID service parameter does not account for cases where id of service is a full IRI external to the DID document #97

Open
trwnh opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@trwnh
Copy link

trwnh commented Nov 19, 2024

Extracted from w3c/did-core#864 (comment)

By my reading of https://w3c.github.io/did-resolution/#dereferencing-algorithm-primary -- it seems like algorithm step 4.1.1 doesn't account for a "full IRI external to the DID document" use case:

If the input DID URL contains the DID parameter service and optionally the relativeRef DID parameter:

Example 1
did:example:1234?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest

From the resolved DID document, select the service endpoint whose id property contains a fragment which matches the value of the service DID parameter of the input DID URL. This is called the input service endpoint.

So for something like

did:example:abc123?service=https%3A%2F%2Fexternal-node.example

The resolution algorithm above reads in a way that it would fail to match anything -- certainly there is no fragment matching service=https%3A%2F%2Fexternal-jsonld-node.example, and indeed there is no fragment at all!

{
  "@context": "https://www.w3.org/ns/did/v1.1",
  "id": "did:example:abc123",
  "service": {
    "id": "https://external-jsonld-node.example",
    "serviceEndpoint": "https://will-this-ever-match.example"
  }
}

In fact, because of the "fragment" matching algo, something like this might be expected to match:

did:example:abc123?service=example

{
  "@context": "https://www.w3.org/ns/did/v1.1",
  "id": "did:example:abc123",
  "service": {
    "id": "https://this-part-doesnt-actually-matter.example/#example",
    "serviceEndpoint": "https://i-guess-this-matches.example"
  }
}
@peacekeeper
Copy link
Collaborator

@trwnh Thanks for reporting this, I agree this is a bug that should be fixed.

@peacekeeper peacekeeper added the bug Something isn't working label Nov 21, 2024
@w3cbot
Copy link

w3cbot commented Nov 21, 2024

This was discussed during the #did meeting on 21 November 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants