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

Question about query parameter ordering #865

Open
SaulMoonves opened this issue Sep 25, 2024 · 3 comments
Open

Question about query parameter ordering #865

SaulMoonves opened this issue Sep 25, 2024 · 3 comments
Labels
question Further information is requested

Comments

@SaulMoonves
Copy link

I am looking for guidance on query parameter ordering, specifically where a DID URL with a query parameter might be used as an ID

In many systems such as ActivityPub, an ID is basically an opaque string but in practice it is a URL whose structure gives a hint on how to resolve it, like using an HTTPS URL that resolves to the object.

I am in the process of trying to implement did:web for activitystreams object IDs inside of an ActivityPub project, but this would I think equally apply to service IDs in the DID document: How do I deal with query parameters being seemingly unordered if some things rely on IDs equally matching? Is anyone dealing with this in their projects?

@Peeja
Copy link

Peeja commented Sep 27, 2024

(Someone with more knowledge should correct me if I'm wrong, but…)

A DID can't contain query parameters. A DID URL can. Only the DID is the identifier. The DID URL refers to a resource. The DID is the authority of the DID URL. (That statement may not be exactly technically correct, but should be close to correct.)

So: for authentication purposes, you shouldn't be using identifiers which include query params. And if you really need to know if two DID _URL_s point to the same resource, then you've got the same problem you have with the equivalent HTTP URLs, and you'll have to decide how you want to solve that.

But it sounds like you're just talking about identifiers, in which case I believe you're going to have to rethink how your DIDs are produced to include whatever you're currently using query params for.

@msporny msporny added the question Further information is requested label Oct 31, 2024
@msporny
Copy link
Member

msporny commented Oct 31, 2024

Yes, effectively what @Peeja said. :)

If you are looking for id equivalence matching, using DID URLs with multiple query parameters is probably not the right thing to do. If you need to do that, your application/specification will have to contain some query parameter canonicalization rules to ensure equivalence holds in your application area.

If you could give us a more concrete use case, @SaulMoonves, we might be able to provide more guidance.

@peacekeeper
Copy link
Contributor

Also agree with @Peeja .

This should be handled in the same way as you would handle query parameters in HTTPS URLs. Would you order parameters in HTTPS URLs? Would you do exact string matching on HTTPS URLs with parameters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants