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

Service Endpoint Construction inconsistency #61

Open
clehner opened this issue Feb 4, 2021 · 3 comments
Open

Service Endpoint Construction inconsistency #61

clehner opened this issue Feb 4, 2021 · 3 comments
Labels
bug Something isn't working ready-for-pr Issue is ready for a PR

Comments

@clehner
Copy link
Member

clehner commented Feb 4, 2021

The example (https://w3c-ccg.github.io/did-resolution/#example-11) is inconsistent with the algorithm (https://w3c-ccg.github.io/did-resolution/#algorithm).

The example says:

Given the following input service endpoint URL:

https://example.com/messages/8377464

And given the following input DID URL:

did:example:123456789abcdefghi?service=messages&relative-ref=%2Fsome%2Fpath%3Fquery#frag

Then the output service endpoint URL is:

https://example.com/messages/8377464/some/path?query#frag

But by following the algorithm, I get this as the output URL:

https://example.com/messages/8377464?service=messages&relative-ref=%2Fsome%2Fpath%3Fquery#frag

It looks like in the example the relative-ref DID parameter is used instead of (or in addition to) the input DID URL path and query.

There is also an example in did-core (https://w3c.github.io/did-core/#example-9) for "A resource external to a DID Document", using service and relativeRef:

did:example:123?service=agent&relativeRef=/credentials#degree

Is using relativeRef/relative-ref the way to go? If so, how should it interact with the path component and other query parameters in service endpoint construction?

@koptan
Copy link

koptan commented Jan 13, 2024

I am also facing the same issue somehow, for me, when I followed the algorithm I got the following as an output:
https://example.com/messages/8377464/some/path?query#frag because in algorithm is not mentioning anything about relative-ref so simply I ignored :)

but I don't think this correct, because relative-ref should be part of the final result.

@clehner how did you solve this issue?

@clehner
Copy link
Member Author

clehner commented Jan 17, 2024

@koptan
In the Service Endpoint Construction algorithm I use the path and query component from the decoded relativeRef parameter if present rather than from the input DID URL.

https://github.com/spruceid/ssi/blob/80a3f24bc721eba38d150c2912443b9a97cfe71e/src/did_resolve.rs#L549 (2021-02-02)

This should comply with the examples and the definition of relativeRef https://www.w3.org/TR/2022/REC-did-core-20220719/#did-parameters

@peacekeeper
Copy link
Collaborator

Sorry it took so long to pay attention to this.

I use the path and query component from the decoded relativeRef parameter if present rather than from the input DID URL.

Yes, this is correct. The current Service Endpoint Construction algorithm is wrong and needs to be fixed to use relativeRef. That current algorithm in the document is based on a much earlier version of the spec when we still had matrix parameters.

@peacekeeper peacekeeper added bug Something isn't working ready-for-pr Issue is ready for a PR labels Sep 5, 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 ready-for-pr Issue is ready for a PR
Projects
None yet
Development

No branches or pull requests

3 participants