-
Notifications
You must be signed in to change notification settings - Fork 97
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
Define resolution function with data types #296
Define resolution function with data types #296
Conversation
A valid DID resolver should have to implement "abstractResolve(did)". This abstract function can work across N different DID methods (N different DID Read operations). It should be described only in terms of abstract representations, not concrete ones. Additionally, a DID resolver may implement "concreteResolve(did)" which wraps "abstractResolve(did)" and outputs a DID Document (and whatever else) in a concrete representation. Note how all of this happens prior to any "parse" function that might be called after calling I think if we take this approach we can fix the conflation with the current "resolve" function mixing both abstract and concrete concepts (it needs to be split apart -- and it is insufficient to point at a particular DID Read operation as the only abstract part of this process). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the 2020-05-28 DID WG Topical Call (see minutes), we wanted to emphasize that we are only defining abstract functions, not their concrete implementation
did | ||
</dt> | ||
<dd> | ||
A conformant <a>DID</a> as a single string. This is the <a>DID</a> to resolve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to specify whether it MUST be a DID URI or a DID URL here? In general, I've operated under the assumption resolution accepts only DID URIs and dereferencing accepts DID URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're defining "DID URI" anywhere? Resolution takes a DID, dereferencing takes a DID URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolution always takes a DID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify terminology first, when you're saying DID do you mean just did:example:123
? That's what I meant by DID URI, so I think we'd be in alignment then. However, I found a case that would conflict with my original assumption. The case where we're referring to a specific version of a did document with the version query parameter could use some clarity for this.
For example, if I used did:example:123?version=1
would I need to parse version=1
from the identifier and pass that via the options then or could I pass the full DID URL with the version query parameter to the resolution function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would I need to parse
version=1
from the identifier and pass that via the options then or could I pass the full DID URL with the version query parameter to the resolution function?
You can only pass a DID to resolve()
. But you can pass a DID URL to dereference()
. In that latter case, the DID parameters are parsed from the DID URL and then passed as did-resolution-input-metadata
(aka "options") to resolve()
, exactly like you said.
Example:
dereference(did-url="did:example:123?version=1", did-dereference-input-metadata=null)
will internally call
resolve(did="did:example:123", did-resolution-input-metadata=[version="1"])
See the first step in the DID URL Dereferencing algorithm section of the DID Resolution spec, which says this:
All generic DID parameters as well as method-specific DID parameters of the input DID URL MUST be passed as input metadata properties to the DID Resolution algorithm.
@jricher could you please process the comments from @peacekeeper so we can get this PR merged? |
@dlongley perhaps what you call This way, |
Co-authored-by: Markus Sabadello <[email protected]>
This adapts the DID Resolution functional definition defined by #253 into a single typed function with requirements for the function signature and implementation conformance.
This builds on #295.
Preview | Diff