-
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
Make DID Resolution section concrete and testable (abstract + Typescript). #592
Conversation
(See <a href="#read-verify"></a>.) The details of how this process is | ||
accomplished are outside the scope of this specification, but all conformant | ||
implementations implement two functions which have the following abstract | ||
The <a>DID resolution</a> function resolves a <a>DID</a> into a <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.
The <a>DID resolution</a> function resolves a <a>DID</a> into a <a>DID | |
The <a>DID resolution</a> functions resolves a <a>DID</a> into a <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.
@peacekeeper --
If the functions
are plural, the resolve
should be singular.
If the function
is singular, the resolves
should be plural.
Please change resolves
to resolve
or switch functions
back to 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.
Fixed via a reword.
index.html
Outdated
The <code>resolve</code> function returns the <a>DID document</a> in its | ||
abstract form. | ||
The <code>resolveRepresentation</code> function returns a byte stream of the | ||
<a>DID Document</a> formatted in the corresponding representation. |
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.
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.
yes, please.
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.
Done in 028302a.
index.html
Outdated
</dd> | ||
</dl> | ||
|
||
<p> | ||
The output variables of these functions are as follows: | ||
The return value of <code>resolve()</code> is <dfn>Resolution</dfn> which is |
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.
As we discussed on yesterday's 2021-02-02 Topic Call, the resolution and dereferencing functions really return three separate values, rather than a single map with three properties. When you dereference an HTTP URL, the HTTP body (representation of a resource) and the HTTP headers are also separate things. RFC3986 says:
the most common form of URI dereference is "retrieval": making use of a URI in order to retrieve a representation of its associated resource [...] additional information might be supplied about the resource (resource metadata)
Having said that, concrete implementations e.g. in TypeScript may choose to return a single JSON object that contains all three return values, and we could add this as an example, similar to how in the DID Resolution spec we define a JSON-LD structure that can hold all three return values.
relating to the results of the <a>DID resolution</a> process. This structure is | ||
REQUIRED and MUST NOT be empty. This metadata is defined by | ||
<a href="#did-resolution-metadata"></a>. If the resolution is successful this | ||
structure MUST contain a <code>contentType</code> property containing the |
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.
This line and several others in the PR now still assume that there's only one function, but there are two. Returning the contentType
property in the metadata only makes sense for the resolveRepresentation()
function, not for 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.
Fixed in latest commits.
This metadata typically changes between invocations of the | ||
<code>resolve</code> and <code>resolveRepresentation</code> functions as it | ||
represents data about the resolution process itself. Properties defined by |
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.
Is there a reason for removing this? This is meant to describe the difference between didResolutionMetadata and didDocumentMetadata.
index.html
Outdated
specification defines the following common properties for a | ||
<dfn>ResolutionOptions</dfn> <a data-cite="INFRA#maps">map</a>: |
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.
specification defines the following common properties for a | |
<dfn>ResolutionOptions</dfn> <a data-cite="INFRA#maps">map</a>: | |
specification defines the following common properties for the | |
<dfn>options</dfn> <a href="metadata-structure">metadata structure</a>: |
The naming in this section should be independent of the TypeScript example.
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.
Removed all types and examples and approached testability through a "proof by construction" rather than by providing concrete examples.
index.html
Outdated
specification defines the following common properties for a | ||
<dfn>DereferencingOptions</dfn> <a data-cite="INFRA#maps">map</a>: |
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.
specification defines the following common properties for a | |
<dfn>DereferencingOptions</dfn> <a data-cite="INFRA#maps">map</a>: | |
specification defines the following common properties for the | |
<dfn>options</dfn> <a href="metadata-structure">metadata structure</a>: |
The naming in this section should be independent of the TypeScript example.
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.
Removed all types and examples and approached testability through a "proof by construction" rather than by providing concrete examples.
Taking a new approach for testability in PR #601. Closing this PR in favor of that one. |
<code><a>equivalentId</a></code> property except: a) it is associated with a | ||
single value rather than a ordered set, and b) the <a>DID</a> is defined to be | ||
the canonical ID for the <a>DID subject</a> within the scope of the containing | ||
<a>DID document</a>. | ||
</p> |
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.
<code><a>equivalentId</a></code> property except: a) it is associated with a | |
single value rather than a ordered set, and b) the <a>DID</a> is defined to be | |
the canonical ID for the <a>DID subject</a> within the scope of the containing | |
<a>DID document</a>. | |
</p> | |
<code><a>equivalentId</a></code> property except: | |
</p> | |
<ul> | |
<li> | |
<code><a>canonicalId</a></code> is associated with a single value rather | |
than an ordered set | |
</li> | |
<li> | |
the <a>DID</a> is defined to be the canonical ID for the <a>DID subject</a> | |
within the scope of the containing <a>DID document</a> | |
</li> | |
</ul> |
<code>id</code> property value and that the <code><a>canonicalId</a></code> | ||
value is defined by the <a>DID Method</a> to be the canonical ID for the <a>DID | ||
subject</a> in the scope of the containing <a>DID document</a>. A | ||
<code><a>canonicalId</a></code> value MUST be produced by, and a form of, the |
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.
<code><a>canonicalId</a></code> value MUST be produced by, and a form of, the | |
<code><a>canonicalId</a></code> value MUST be produced by, and be a form of, the |
as its primary ID value for the <a>DID subject</a> and treat all other | ||
equivalent values as secondary aliases (e.g. update corresponding primary |
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.
as its primary ID value for the <a>DID subject</a> and treat all other | |
equivalent values as secondary aliases (e.g. update corresponding primary | |
as its primary ID value for the <a>DID subject</a> and to treat all other | |
equivalent values as secondary aliases (e.g., to update corresponding primary |
bah. github brought this PR to me as if it hadn't been closed yet. obviously, ignore my last few suggestions here... |
This PR is intended to address issue #549 by adding to the abstract functions discussed in the DID Resolution and DID URL Dereferencing sections and describing potentially conforming expressions in Typescript as concrete, testable functions. The PR uses an Typescript interface to provide an example while keeping all of what we had before. It also tries to strike a balance by providing at least one concrete realization of the interface without preventing other concrete interfaces from being realized.
There are a LOT of reformatting changes in this PR, it might be best to look at the rendered preview for this PR.
Preview | Diff