<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-brown-rdap-referrals-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true" consensus="true">

<front>
<title abbrev="Efficient RDAP Referrals">Efficient RDAP Referrals</title><seriesInfo value="draft-brown-rdap-referrals-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author fullname="Gavin Brown"><organization>ICANN</organization><address><postal><street>12025 Waterfront Drive, Suite 300</street>
<city>Los Angeles</city>
<code>90292</code>
<country>US</country>
<region>CA</region>
</postal><email>gavin.brown@icann.org</email>
<uri>https://icann.org</uri>
</address></author><author fullname="Andy Newton"><organization>ICANN</organization><address><postal><street>12025 Waterfront Drive, Suite 300</street>
<city>Los Angeles</city>
<code>90292</code>
<country>US</country>
<region>CA</region>
</postal><email>andy.newton@icann.org</email>
<uri>https://icann.org</uri>
</address></author><date/>
<area>Internet</area>
<workgroup>Registration Protocols Extensions (regext)</workgroup>

<abstract>
<t>This document describes how RDAP servers can provide HTTP &quot;<tt>Link</tt>&quot; header fields
in RDAP responses to allow RDAP clients to efficiently determine the URL of
related RDAP records for a resource.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Many Registration Data Access Protocol (RDAP, described in <xref target="RFC7480"></xref>,
<xref target="RFC7481"></xref>, <xref target="RFC9082"></xref>, <xref target="RFC9083"></xref> and others) resources contain referrals to
related RDAP resources.</t>
<t>For example, in the domain space, an RDAP record for a domain name received from
the registry operator may include a referral to the RDAP record for the same
object provided by the sponsoring registrar, while in the IP address space, an
RDAP record for an address allocation may include referrals to enclosing or
sibling prefixes.</t>
<t>In both cases, RDAP service users are often equally if not more interested in
these related RDAP resources than the resource provided by the TLD registry or
RIR.</t>
<t>While RDAP supports redirection of RDAP requests using HTTP redirections (which
use a <tt>3xx</tt> HTTP status and the &quot;<tt>Location</tt>&quot; header field, see Section 15.4 of
<xref target="RFC9110"></xref>), it is not possible for RDAP servers to know <em>a priori</em> whether a
client requesting an RDAP record is doing so because it wants to retrieve a
related RDAP record, or its own, so it can only respond by providing the full
RDAP response. The client must then parse that response in order to extract the
relevant URL from the &quot;<tt>links</tt>&quot; property of the object.</t>
<t>This results in the wasteful expenditure of time, compute resources and
bandwidth on the part of both the client and server.</t>
<t>This document describes how an RDAP server can use &quot;<tt>Link</tt>&quot; HTTP header fields
in responses to <tt>HEAD</tt> and <tt>GET</tt> requests to provide RDAP clients with the URL
of related RDAP records, without the need for a signalling mechanism for the
client to tell the server that it is only interested in retrieving those URLs.</t>
</section>

<section anchor="rdap-link-objects"><name>RDAP Link Objects</name>
<t>RDAP link objects, described in Section 4.2 of <xref target="RFC9083"></xref>, establish
unidirectional relationships between an RDAP resource and other web resources,
which may also be RDAP resources. The &quot;<tt>rel</tt>&quot; property indicates the nature of
the relationship, and its possible values are described in <xref target="RFC8288"></xref>.</t>
<t>If a link object has a &quot;<tt>type</tt>&quot; property which contains the value
&quot;<tt>application/rdap+json</tt>&quot;, then clients can assume that the linked resource is
also an RDAP resource.</t>
<t>In the domain name space, this allows clients to discover the URL of the
sponsoring registrar's RDAP record for a given domain name, if the &quot;<tt>rel</tt>&quot;
property has the value &quot;<tt>related</tt>&quot;, while in the IP address space, the &quot;<tt>up</tt>&quot;
and &quot;<tt>down</tt>&quot; values allow RDAP clients to navigate the hierarchy of address
space allocations.</t>
</section>

<section anchor="http-link-header-field"><name>HTTP &quot;<tt>Link</tt>&quot; Header Field</name>
<t>&quot;<tt>Link</tt>&quot; header fields, described in Section 3 of <xref target="RFC8288"></xref>, provide a means
for describing a relationship between two resources, generally between the
requested resource and some other resource. The &quot;<tt>Link</tt>&quot; header field is
semantically equivalent to the <tt>&lt;link&gt;</tt> element in HTML, and multiple &quot;<tt>Link</tt>&quot;
headers may be present in the header of an HTTP response.</t>
<t>&quot;<tt>Link</tt>&quot; header fields may contain most of the parameters that are also present
in Link objects in RDAP responses (See Section 4.2 of <xref target="RFC9083"></xref>). So for
example, an RDAP link object which has the following JSON representation:</t>

<sourcecode type="json"><![CDATA[{
  "value" : "https://example.com/context_uri",
  "rel" : "self",
  "href" : "https://example.com/target_uri",
  "hreflang" : [ "en", "ch" ],
  "title" : "title",
  "media" : "screen",
  "type" : "application/json"
}
]]>
</sourcecode>
<t>may be represented as follows:</t>

<artwork><![CDATA[Link: <https://example.com/target_uri>;
  rel="self";
  hreflang="en,ch";
  title="title";
  media="screen";
  type="application/json"
]]>
</artwork>

<section anchor="registrar-rdap-link-header"><name>Registrar RDAP &quot;<tt>Link</tt>&quot; Header</name>
<t>Following on from the above, the following RDAP link object (which represents
the RDAP URL of the sponsoring registrar of a resource):</t>

<sourcecode type="json"><![CDATA[{
  "value": "https://rdap.example.com/domain/example.com",
  "title": "URL of Sponsoring Registrar's RDAP Record",
  "rel": "related",
  "href": "https://rdap.example.com/domain/example.com",
  "type": "application/rdap+json"
}
]]>
</sourcecode>
<t>may be represented as follows:</t>

<artwork><![CDATA[Link: <https://rdap.example.com/domain/example.com>;
  title="URL of Sponsoring Registrar's RDAP Record";
  rel="related";
  type="application/rdap+json"
]]>
</artwork>
</section>
</section>

<section anchor="rdap-responses"><name>RDAP Responses</name>
<t>In response to <tt>GET</tt> and <tt>HEAD</tt> RDAP requests, RDAP servers which implement this
specification <bcp14>MUST</bcp14> include a &quot;<tt>Link</tt>&quot; header field for each link object
which refers to an RDAP resource that is present in the &quot;<tt>links</tt>&quot; array of the
object in question. The server <bcp14>MAY</bcp14> also include &quot;<tt>Link</tt>&quot; headers for link
objects which refer to other types of resource. In all cases, the link
attributes <bcp14>MUST</bcp14> be the same in both places.</t>

<section anchor="rdap-head-requests"><name>RDAP <tt>HEAD</tt> requests</name>
<t>The HTTP <tt>HEAD</tt> method can be used for obtaining metadata about a resource
without transferring that resource (see Section 4.3.2 of <xref target="RFC7231"></xref>).</t>
<t>An RDAP client which only wishes to obtain the URLs of related RDAP resources
can issue a <tt>HEAD</tt> request for an RDAP resource and check the response for the
presence of an appropriate &quot;<tt>Link</tt>&quot; header field. If the link is absent, it may
then fall back to performing a <tt>GET</tt> request.</t>
<t>An RDAP client interested in both the server's record and related records can
use the traditional method of performing a <tt>GET</tt> request and extracting the link
objects from the response. To improve performance, RDAP clients <bcp14>MAY</bcp14> inspect
the header of a response, extract the link headers, and issue  requests for the
related record in parallel while the request to the server is still in flight.
As an example, the cURL library provides the
<eref target="https://curl.se/libcurl/c/CURLOPT_HEADERFUNCTION.html">CURLOPT_HEADERFUNCTION</eref>
configuration option to provide a callback that is invoked as soon as it has
received header data.</t>
</section>
</section>

<section anchor="rdap-conformance"><name>RDAP Conformance</name>
<t>Servers which implement this specification <bcp14>MUST</bcp14> include the string
&quot;<tt>link_headers</tt>&quot; in the &quot;<tt>rdapConformance</tt>&quot; array in all RDAP
responses.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>IANA is requested to register the following value in the RDAP Extensions
Registry:</t>

<dl spacing="compact">
<dt><strong>Extension identifier:</strong></dt>
<dd><tt>registrar_link_header</tt></dd>
<dt><strong>Registry operator:</strong></dt>
<dd>any</dd>
<dt><strong>Published specification:</strong></dt>
<dd>this document</dd>
<dt><strong>Contact:</strong></dt>
<dd>IETF &lt;<eref target="mailto:iesg@ietf.org">iesg@ietf.org</eref>&gt;</dd>
<dt><strong>Intended usage:</strong></dt>
<dd>this extension indicates that the server provides the URL of the registrar's
RDAP record in a &quot;<tt>Link</tt>&quot; header in responses to RDAP queries.</dd>
</dl>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7231.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7480.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7481.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8288.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9082.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9083.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
</references>

</back>

</rfc>
