Skip to content

Commit

Permalink
Avoid terms "Primary/Secondary Resource" (#96)
Browse files Browse the repository at this point in the history
* Avoid terms "Primary/Secondary Resource"

* Apply suggestion about media type by @msporny.

Co-authored-by: Manu Sporny <[email protected]>

* Apply editorial suggestions by @TallTed.

Co-authored-by: Ted Thibodeau Jr <[email protected]>

---------

Co-authored-by: Manu Sporny <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent 0aaa9bb commit 231a0f3
Showing 1 changed file with 48 additions and 49 deletions.
97 changes: 48 additions & 49 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1001,36 +1001,41 @@ <h3>DID URL Dereferencing Metadata</h3>
<section id="dereferencing-algorithm">
<h2>Algorithm</h2>
<p>The following <a>DID URL dereferencing</a> algorithm MUST be implemented by a conformant <a>DID resolver</a>.
In accordance with [[RFC3986]], it consists of the following steps: Resolving the DID, dereferencing the primary
resource, and dereferencing the secondary resource (only if the <var>input <a>DID URL</a></var> contains a <a>DID fragment</a>:</p>
In accordance with [[RFC3986]], it consists of the following three steps: resolving the DID; dereferencing the
resource; and dereferencing the fragment (only if the <var>input <a>DID URL</a></var> contains a <a>DID fragment</a>):</p>

<ol class="algorithm">
<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:
<section id="dereferencing-algorithm-resource">
<h2>Dereferencing the Resource</h2>
<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>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>
</li>
<li>If present, separate the <a>DID fragment</a> from the <var>input <a>DID URL</a></var>. Execute the algorithm for
<a href="#dereferencing-algorithm-primary"></a>, with the <var>input <a>DID URL</a></var> adjusted
accordingly.</li>
<li>If the original <var>input <a>DID URL</a></var> contained a <a>DID fragment</a>, execute the algorithm for
<a href="#dereferencing-algorithm-secondary"></a>.</li>
</ol>
<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:

<section id="dereferencing-algorithm-primary">
<h2>Dereferencing the Primary Resource</h2>
<ol class="algorithm">
<li>If the <var>input <a>DID URL</a></var> contains the
<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>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>
</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>
<ol class="algorithm">
<li>Return the <var>resolved <a>DID document</a></var>.</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:
<pre class="example nohighlight">did:example:1234?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest</pre>
Expand All @@ -1051,12 +1056,6 @@ <h2>Dereferencing the Primary Resource</h2>
<li>Return the <var>output <a>service endpoint</a> URL</var>.</li>
</ol>
</li>
<li>Otherwise, 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>
<ol class="algorithm">
<li>Return the <var>resolved <a>DID document</a></var>.</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">
Expand Down Expand Up @@ -1084,14 +1083,14 @@ <h2>Dereferencing the Primary Resource</h2>

</section>

<section id="dereferencing-algorithm-secondary">
<h2>Dereferencing the Secondary Resource</h2>
<section id="dereferencing-algorithm-fragment">
<h2>Dereferencing the Fragment</h2>
<p>If the <var>input <a>DID URL</a></var> contains a <a>DID fragment</a>,
then dereferencing of the secondary resource identified by the URL is dependent not on the URI scheme, but
on the media type ([[RFC2046]]) of the primary resource, i.e., on the result of
<a href="#dereferencing-algorithm-primary"></a>.</p>
then dereferencing of the fragment is dependent
on the media type ([[RFC2046]]) of the resource, i.e., on the result of
<a href="#dereferencing-algorithm-resource"></a>.</p>
<ol class="algorithm">
<li>If the result of <a href="#dereferencing-algorithm-primary"></a> is an <var>output <a>service endpoint</a> URL</var>,
<li>If the result of <a href="#dereferencing-algorithm-resource"></a> is an <var>output <a>service endpoint</a> URL</var>,
and the <var>input <a>DID URL</a></var> contains a <a>DID fragment</a>:
<pre class="example nohighlight">did:example:1234?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest#intro</pre>
<ol class="algorithm">
Expand All @@ -1102,8 +1101,8 @@ <h2>Dereferencing the Secondary Resource</h2>
<var>input <a>DID URL</a></var>.</li>
<li>Return the <var>output <a>service endpoint</a> URL</var>.</li>
</ol>
<li>Otherwise, dereference the secondary resource identified by the DID fragment as defined by the media type ([[RFC2046]]) of the primary resource.
For example, if the primary resource is a representation of a DID document with media type <code>application/did+ld+json</code>, then
<li>Otherwise, dereference the DID fragment as defined by the media type ([[RFC2046]]) of the resource.
For example, if the resource is a representation of a DID document with media type <code>application/did</code>, then
the fragment is treated according to the rules associated with the
<a href="https://www.w3.org/TR/json-ld11/#iana-considerations">JSON-LD 1.1: application/ld+json media type</a>
[JSON-LD11].
Expand Down Expand Up @@ -1488,15 +1487,15 @@ <h2>Client-Side Dereferencing</h2>
algorithm may be performed by different components of a <a href="#resolver-architectures">Resolver Architecture</a>.</p>

<p>Specifically, when a <a>DID URL</a> with a <a>DID fragment</a> is dereferenced, then
<a href="#dereferencing-algorithm-primary">Dereferencing the Primary Resource</a> is done by
<a href="#dereferencing-algorithm-resource">Dereferencing the Resource</a> is done by
the <a>DID resolver</a>, and
<a href="#dereferencing-algorithm-secondary">Dereferencing the Secondary Resource</a> is done by the <a>client</a>.</p>
<a href="#dereferencing-algorithm-fragment">Dereferencing the Fragment</a> is done by the <a>client</a>.</p>

<p>Example: Given the <a>DID URL</a> <code>did:xyz:1234#keys-1</code>, a <a>DID resolver</a> could be invoked
via <a>local binding</a>
for <a href="#dereferencing-algorithm-primary">Dereferencing the Primary Resource</a> (i.e., the <a>DID document</a>),
for <a href="#dereferencing-algorithm-resource">Dereferencing the Resource</a> (i.e., the <a>DID document</a>),
and the <a>client</a> could complete the <a>DID URL dereferencing</a> algorithm by
<a href="#dereferencing-algorithm-secondary">Dereferencing the Secondary Resource</a> (i.e., a part of the <a>DID document</a>).</p>
<a href="#dereferencing-algorithm-fragment">Dereferencing the Fragment</a> (i.e., a part of the <a>DID document</a>).</p>

<figure id="figure-client-side-dereferencing-1">
<img style="display: block; width: 100%;" src="diagrams/client-side-dereferencing-1.png"
Expand All @@ -1508,9 +1507,9 @@ <h2>Client-Side Dereferencing</h2>

<p>Example: Given the <a>DID URL</a> <code>did:xyz:1234#keys-1</code>, a <a>DID resolver</a> could be invoked via
<a>local binding</a> which invokes another <a>DID resolver</a> via <a>remote binding</a>
for <a href="#dereferencing-algorithm-primary">Dereferencing the Primary Resource</a> (i.e., the <a>DID document</a>),
for <a href="#dereferencing-algorithm-resource">Dereferencing the Resource</a> (i.e., the <a>DID document</a>),
and the <a>client</a> could complete the <a>DID URL dereferencing</a> algorithm by
<a href="#dereferencing-algorithm-secondary">Dereferencing the Secondary Resource</a> (i.e., a part of the <a>DID document</a>).</p>
<a href="#dereferencing-algorithm-fragment">Dereferencing the Fragment</a> (i.e., a part of the <a>DID document</a>).</p>

<figure id="figure-client-side-dereferencing-3">
<img style="margin: auto; display: block; width: 100%;" src="diagrams/client-side-dereferencing-2.png"
Expand All @@ -1522,9 +1521,9 @@ <h2>Client-Side Dereferencing</h2>
</figure>

<p>Example: Given the <a>DID URL</a> <code>did:xyz:1234?service=agent&relativeRef=%2Fsome%2Fpath%3Fquery#frag</code>, a <a>DID resolver</a> could be invoked
for <a href="#dereferencing-algorithm-primary">Dereferencing the Primary Resource</a> (i.e., a <a>service endpoint</a> URL),
for <a href="#dereferencing-algorithm-resource">Dereferencing the Resource</a> (i.e., a <a>service endpoint</a> URL),
and the <a>client</a> could complete the <a>DID URL dereferencing</a> algorithm by
<a href="#dereferencing-algorithm-secondary">Dereferencing the Secondary Resource</a> (i.e., a <a>service endpoint</a> URL with a fragment).</p>
<a href="#dereferencing-algorithm-fragment">Dereferencing the Fragment</a> (i.e., a <a>service endpoint</a> URL with a fragment).</p>

<figure id="figure-client-side-dereferencing-2">
<img style="margin: auto; display: block; width: 100%;" src="diagrams/client-side-dereferencing-3.png"
Expand Down

0 comments on commit 231a0f3

Please sign in to comment.