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

Add details to results of the dereferencing algorithm. #103

Open
wants to merge 5 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 51 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,15 @@ <h2>Algorithm</h2>
<a href="https://www.w3.org/TR/did-core/#did-syntax">DID Syntax</a>.
If not, the <a>DID resolver</a> MUST return the following result:
<ol class="algorithm">
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "invalidDid" ]»</code></li>
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "invalidDid", ... ]»</code></li>
<li><b>didDocument</b>: <code>null</code></li>
<li><b>didDocumentMetadata</b>: <code>«[ ]»</code></li>
</ol>
</li>
<li>Determine whether the DID method of the <var>input <a>DID</a></var> is supported by the <a>DID resolver</a>
that implements this algorithm. If not, the <a>DID resolver</a> MUST return the following result:
<ol class="algorithm">
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "methodNotSupported" ]»</code></li>
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "methodNotSupported", ... ]»</code></li>
<li><b>didDocument</b>: <code>null</code></li>
<li><b>didDocumentMetadata</b>: <code>«[ ]»</code></li>
</ol>
Expand All @@ -713,26 +713,31 @@ <h2>Algorithm</h2>
<var>input <a>DID method</a></var>.</li>
<li>If the <var>input <a>DID</a></var> does not exist, return the following result:
<ol class="algorithm">
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "notFound" ]»</code></li>
<li><b>didResolutionMetadata</b>: <code>«[ "error" → "notFound", ... ]»</code></li>
<li><b>didDocument</b>: <code>null</code></li>
<li><b>didDocumentMetadata</b>: <code>«[ ]»</code></li>
</ol>
</li>
<li>If the <var>input <a>DID</a></var> has been deactivated, return the following result:
<ol class="algorithm">
<li><b>didResolutionMetadata</b>: <code>«[ ]»</code></li>
<li><b>didResolutionMetadata</b>: <code>«[ ... ]»</code></li>
<li><b>didDocument</b>: <code>null</code></li>
<li><b>didDocumentMetadata</b>: <code>«[ "deactivated" → true ]»</code></li>
<li><b>didDocumentMetadata</b>: <code>«[ "deactivated" → true, ... ]»</code></li>
</ol>
</li>
<li>The result of the <a href="https://www.w3.org/TR/did-core/#method-operations">Read</a> operation
is called the <var>output <a>DID document</a></var>.</li>
<li>Otherwise, the result of the <a href="https://www.w3.org/TR/did-core/#method-operations">Read</a> operation
is called the <var>output <a>DID document</a></var>. This result MUST be represented in a
<a href="https://www.w3.org/TR/did-core/#representations">conformant representation</a> that
corresponds to the <b>accept</b> <var>resolution option</var>.</li>
<li>Return the following result:
<ol class="algorithm">
<li><b>didResolutionMetadata</b>: <code>«[ ... ]»</code></li>
<li><b>didDocument</b>: <var>output DID document</var></li>
<li><b>didDocumentMetadata</b>: <code>«[ "contentType" → </code><var>output DID document media type</var><code>, ... ]»</code></li>
</ol>
</li>
</ol>
</li>
<li>Validate that the <var>output <a>DID document</a></var> conforms to a
<a href="https://www.w3.org/TR/did-core/#representations">conformant representation</a> of the <a>DID document</a>
<a href="https://www.w3.org/TR/did-core/#data-model">data model</a>. If not,
the <a>DID resolver</a> MUST raise an error.</li>
</ol>

<p class="issue" data-number="5">There is discussion how a DID that has been
Expand Down Expand Up @@ -1010,31 +1015,38 @@ <h2>Dereferencing the Resource</h2>
<li>Validate that the <var>input <a>DID URL</a></var> conforms to the `did-url` rule of the
<a href="https://www.w3.org/TR/did-core/#did-url-syntax">DID URL Syntax</a>.
If not, the <a>DID URL dereferencer</a> MUST return the following result:

<ol class="algorithm">
<li><b>dereferencingMetadata</b>: <code>«[ "error" → "invalidDidUrl" ]»</code></li>
<li><b>contentStream</b>: <code>null</code></li>
<li><b>contentMetadata</b>: <code>«[ ]»</code></li>
</ol>

</li>
<li>Obtain the <a>DID document</a> for the <var>input <a>DID</a></var> by executing the
<a>DID resolution</a> algorithm as defined in <a href="#resolving"></a>. All
<a href="https://www.w3.org/TR/did-core/#did-parameters">
DID parameters</a> of the <var>input <a>DID URL</a></var> MUST be passed as <var>resolution options</var> to the
<a>DID Resolution</a> algorithm. If the <var>input <a>DID</a></var> does not exist, return a null result.
Otherwise, the result is called the <var>resolved <a>DID document</a></var>.</li>
<a>DID Resolution</a> algorithm.</li>
<li>If the <var>input <a>DID</a></var> does not exist in the VDR, the <a>DID URL dereferencer</a>
MUST return the following result:
<ol class="algorithm">
<li><b>dereferencingMetadata</b>: <code>«[ "error" → "notFound", ... ]»</code></li>
<li><b>contentStream</b>: <code>null</code></li>
<li><b>contentMetadata</b>: <code>«[ ]»</code></li>
</ol>
</li>

<li>Otherwise, the <b>didDocument</b> result of the <a>DID resolution</a> algorithm is called the <var>resolved <a>DID document</a></var>.</li>
<li>If present, separate the <a>DID fragment</a> from the <var>input <a>DID URL</a></var> and continue
with the adjusted <var>input <a>DID URL</a></var>.</li>

<li>If the <var>input <a>DID URL</a></var> contains no <a>DID path</a> and no <a>DID query</a>:
<pre class="example nohighlight">did:example:1234</pre>
The <a>DID URL dereferencer</a> MUST return the <var>resolved <a>DID document</a></var> and
<var>resolved <a href="#did-document-metadata"></a></var> as follows:
<ol class="algorithm">
<li>Return the <var>resolved <a>DID document</a></var>.</li>
<li><b>dereferencingMetadata</b>: <code>«[ ... ]»</code></li>
<li><b>contentStream</b>: <code>resolved DID document</code></li>
<li><b>contentMetadata</b>: <code>«[ <code>resolved DID document metadata</code> ]»</code></li>
</ol>
</li>

<li>Otherwise, if the <var>input <a>DID URL</a></var> contains the
<a href="https://www.w3.org/TR/did-core/#did-parameters">
DID parameter</a> <code>service</code> and optionally the <code>relativeRef</code> DID parameter:
Expand All @@ -1053,19 +1065,35 @@ <h2>Dereferencing the Resource</h2>
<li>The result is called the <var>output <a>service endpoint</a> URL</var>.</li>
</ol>
</li>
<li>Return the <var>output <a>service endpoint</a> URL</var>.</li>
<li>Return the following result:
<ol class="algorithm">
<li><b>dereferencingMetadata</b>: <code>«[ ... ]»</code></li>
<li><b>content</b>: <var>output service endpoint URL</var></li>
<li><b>contentMetadata</b>: <code>«[ "contentType" → "text/uri-list", ... ]»</code></li>
</ol>
</li>
</ol>
</li>
<li>Otherwise, if the <var>input <a>DID URL</a></var> contains a <a>DID path</a> and/or <a>DID query</a>:
<pre class="example nohighlight">did:example:1234/custom/path?customquery</pre>
<ol class="algorithm">
<li>The applicable <a>DID method</a> MAY specify how to dereference
the <var>input <a>DID URL</a></var>.</li>
the <a>DID path</a> and/or <a>DID query</a> of the <var>input <a>DID URL</a></var>.
<pre class="example nohighlight">did:example:1234/resources/1234</pre>
</li>
<li>An extension specification MAY specify how to dereference
the <a>DID path</a> of the <var>input <a>DID URL</a></var>.
<pre class="example nohighlight">did:example:1234/whois</pre>
</li>
<li>An extension specification MAY specify how to dereference
the <a>DID query</a> of the <var>input <a>DID URL</a></var>.
<pre class="example nohighlight">did:example:1234?transformKey=JsonWebKey</pre>
</li>
<li>The client MAY be able to dereference the <var>input <a>DID URL</a></var>
in an application-specific way.</li>
in an application-specific way.</li>
</ol>
</li>
<li>If neither this algorithm, nor the applicable <a>DID method</a>, nor the client
<li>If neither this algorithm, nor the applicable <a>DID method</a>, nor an extension, nor the client
is able to dereference the <var>input <a>DID URL</a></var>, return the following result:
<ol class="algorithm">
<li><b>dereferencingMetadata</b>: <code>«[ "error" → "notFound" ]»</code></li>
Expand Down
Loading