<?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-ietf-regext-rdap-extensions-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="7480, 9082, 9083" indexInclude="true">

<front>
<title abbrev="rdap-extensions">RDAP Extensions</title><seriesInfo value="draft-ietf-regext-rdap-extensions-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="A." surname="Newton" fullname="Andy Newton"><organization>ICANN</organization><address><postal><street></street>
</postal><email>andy@hxr.us</email>
</address></author><author initials="J." surname="Singh" fullname="Jasdip Singh"><organization>ARIN</organization><address><postal><street></street>
</postal><email>jasdips@arin.net</email>
</address></author><author initials="T." surname="Harrison" fullname="Tom Harrison"><organization>APNIC</organization><address><postal><street></street>
</postal><email>tomh@apnic.net</email>
</address></author><date/>
<area>Applications and Real-Time Area (ART)</area>
<workgroup>Registration Protocols Extensions (regext)</workgroup>

<abstract>
<t>This document describes and clarifies the usage of extensions in RDAP.</t>
</abstract>

</front>

<middle>

<section anchor="background"><name>Background</name>
<t>The Registration Data Access Protocol (RDAP) defines a uniform means to access data
from Internet operations registries, specifically Domain Name Registries (DNRs) and
Internet Number Registries (INRs). The queries for DNRs and INRs are defined in
<xref target="RFC9082"></xref> and the responses for DNRs and INRs are defined in <xref target="RFC9083"></xref>.</t>
<t>RDAP contains a means to define extensions for queries not found in <xref target="RFC9082"></xref> and
responses not found in <xref target="RFC9083"></xref>. RDAP extensions are also described in <xref target="RFC7480"></xref>.
This document uniformly describes RDAP extensions, clarifies their usage, and
defines additional semantics that were previously undefined.</t>
</section>

<section anchor="extension_identifier"><name>The RDAP Extension Identifier</name>
<t><xref target="RFC7480" sectionFormat="of" section="6"></xref> describes the identifier used to signify RDAP extensions
and the IANA registry into which RDAP extensions are to be registered.</t>
<t>In brief, RDAP extensions identifiers start with an alphabetic character and may
contain alphanumeric characters and &quot;_&quot; (underscore) characters. This formulation
was explicitly chosen to allow compatibility with variable names in programming
languages and transliteration with XML.</t>
<t>When in use in RDAP, extension identifiers are prepended to URL path segments,
URL query parameters, and JSON object member names (herein further referred to
as &quot;JSON names&quot;).  In all cases, the extension identifier acts as a namespace
preventing collisions between extension elements.</t>
<t>Additionally, implementers and operators can use the extension identifiers
to find an extensions definition (via the IANA registry).</t>
<t>RDAP extension identifiers have no explicit structure and are opaque in that no
inner-meaning can be &quot;seen&quot; in them. This document restricts the syntax
of RDAP extension identifiers from containing two consecutive &quot;_&quot; (underscore)
characters and reserves their use for the future definition of structure (such
as to define a versioning scheme). That is, RDAP extensions MUST NOT define
an identifier with two consecutive underscore characters (&quot;__&quot;) unless explicitly
adhering to an RFC describing such usage.</t>
<t>RDAP extensions MUST NOT define an extension identifier that when prepended to
an underscore character may collide with an existing extension identifier.
For example, if there were a pre-existing identifier of &quot;foo_bar&quot;, another extension
could not define the identifier &quot;foo&quot;. Likewise, if there were a pre-existing
identifier of &quot;foo_bar&quot;, another extension could not define the identifier &quot;foo_bar_buzz&quot;.
However, an extension could define &quot;foo&quot; if &quot;foobar&quot; pre-existed and vice versa.</t>
<t>For this reason, usage of an underscore character in RDAP extension identifiers
is NOT RECOMMENDED. Implementers should be aware that many existing extension
identifiers do contain underscore characters.</t>
</section>

<section anchor="usage-in-queries"><name>Usage in Queries</name>
<t><xref target="RFC9082" sectionFormat="of" section="5"></xref> describes the use of extension identifiers in formulating
URIs to query RDAP servers. The extension identifiers are to be prepended to the
path segments they use. For example, if an extension uses the identifier
<tt>foobar</tt>, then the path segments used in that extension are prepended with <tt>foobar_</tt>.
If the <tt>foobar</tt> extension defines paths <tt>fizz</tt> and <tt>fazz</tt>, the URIs for this
extension might take the following form:</t>

<artwork><![CDATA[https://base.example/foobar_fizz
https://base.example/foobar_fazz
]]>
</artwork>
<t>Although <xref target="RFC9082"></xref> describes the use of URI query strings, it does not define
their use with extensions. <xref target="RFC7480"></xref> instructs servers to ignore unknown query
parameters. Therefore, the use of query parameters, prefixed or not with an
extension identifier, is undefined as defined in <xref target="RFC9082"></xref> and <xref target="RFC7480"></xref>.</t>
<t>Despite this, there are several extensions that do specify query parameters.
This document updates <xref target="RFC9082"></xref> with regard to the use of RDAP extension
identifiers in URL query parameters.</t>
<t>When an RDAP extension defines query parameters to be used with a URL path
that is not defined by that RDAP extension, those query parameter names SHOULD be
constructed in the same manner as URL path segments (that is, extensions ID + '_'
+ parameter name). See section <xref target="extension_classes"></xref> regarding when usage of an
extension identifier is required.</t>
<t>When an RDAP extension defines query parameters to be used with a URL path defined
by that RDAP extension, prefixing of query parameters is not required.</t>
<t>See <xref target="redirects"></xref> and <xref target="referrals"></xref> for other guidance on the use of query
parameters.</t>
</section>

<section anchor="usage_in_json"><name>Usage in JSON</name>
<t><xref target="RFC9083" sectionFormat="of" section="2"></xref> describes the use of extension identifiers in the JSON
returned by RDAP servers. Just as in URIs, the extension identifier is prepended
to JSON names to create a namespace so that the JSON name from one extension
will not collide with the JSON name of another extension. And just as with
URIs, clients are to ignore unknown JSON names.</t>
<t>The example given in <xref target="RFC9083"></xref> is as follows:</t>

<artwork><![CDATA[{
  "handle" : "ABC123",
  "lunarNIC_beforeOneSmallStep" : "TRUE THAT!",
  "remarks" :
  [
    {
      "description" :
      [
        "She sells sea shells down by the sea shore.",
        "Originally written by Terry Sullivan."
      ]
    }
  ],
  "lunarNIC_harshMistressNotes" :
  [
    "In space,",
    "nobody can hear you scream."
  ]
}
]]>
</artwork>
<t>In this example, the extension identified by <tt>lunarNIC</tt> is prepended
to the names of both a JSON string and a JSON array.</t>

<section anchor="child_json_values"><name>Child JSON Values</name>
<t>Prefixing of the extension identifier is not required of children of a prefixed
JSON object defined by an RDAP extension.</t>
<t>The following example shows this use with a JSON object.</t>

<artwork><![CDATA[{
  "handle" : "ABC123",
  "remarks" :
  [
    {
      "description" :
      [
        "She sells sea shells down by the sea shore.",
        "Originally written by Terry Sullivan."
      ]
    }
  ],
  "lunarNIC_author" :
  {
    "firstInitial": "J",
    "lastName": "Heinlein"
  }
}
]]>
</artwork>
<t>Here the JSON name &quot;lunarNic_author&quot; will separate the JSON from other
extensions that may have an &quot;author&quot; structure. But the JSON contained
within &quot;lunarNIC_author&quot; need not be prepended as the extension collision
is avoided by &quot;lunarNIC_author&quot;.</t>
</section>

<section anchor="bare_extension"><name>Bare Extension Identifiers</name>
<t>Some RDAP extensions define only one JSON value and do not prefix it with their
RDAP extension identifier instead using the extension identifier as the JSON name
for that JSON value. That is, the extension identifier is used &quot;bare&quot; and not appended
with an underscore character and subsequent names.</t>
<t>Consider the example in <xref target="child_json_values"></xref>. Using the bare extension identifier pattern,
that example could be written as:</t>

<artwork><![CDATA[{
  "handle" : "ABC123",
  "remarks" :
  [
    {
      "description" :
      [
        "She sells sea shells down by the sea shore.",
        "Originally written by Terry Sullivan."
      ]
    }
  ],
  "lunarNIC" :
  {
    "firstInitial": "J",
    "lastName": "Heinlein"
  }
}
]]>
</artwork>
<t>Usage of a bare extension identifier contravenes the guidance in <xref target="RFC9083"></xref>.
This document updates <xref target="RFC9083"></xref> to explicitly allow this pattern.</t>
</section>
</section>

<section anchor="camel-casing"><name>Camel Casing</name>
<t>The styling convention used in <xref target="RFC9083"></xref> for JSON names is often called
&quot;camel casing&quot;, in reference to the hump of a camel. In this style, the
first letter of every word, except the first word, composing a name is capitalized.
This convention was adopted to visually separate the namespace from the
name, with an underscore between them.</t>
<t>Though there is no explicit guidance to use camel case names, extensions would
be wise to continue the style.</t>
</section>

<section anchor="extension_classes"><name>Two Classes of Extensions</name>
<t>Though all RDAP extensions are to be registered in the IANA RDAP extensions
registry, there is an implicit two-class system of extensions that comes from
the inherit ownership of the RDAP specifications by the IETF: extensions
created by the IETF and extensions not created by the IETF.</t>
<t>In the perspective of how extensions identifiers are used as namespace
separators, extensions created by the IETF are not required to be prefixed
with an extension identifier as the IETF can coordinate its own activities
to avoid name collisions. In practice, most extensions owned by the IETF do use
extension identifiers.</t>
<t>RDAP extensions not defined by the IETF MUST use the extension identifier
as a prefix in accordance with this document, <xref target="RFC7480"></xref>, <xref target="RFC9082"></xref>, and
<xref target="RFC9083"></xref>. And RDAP extensions defined by the IETF SHOULD use the extension
identifier as a prefix or as a bare extension identifier (see <xref target="bare_extension"></xref>)
IETF defined RDAP extensions that do not follow this guidance MUST describe
the necessity to do so.</t>
</section>

<section anchor="profiles_and_markers"><name>Profile and Marker Extensions</name>
<t>Extensions are not required to extend the JSON or URL components of RDAP.</t>
<t>While the RDAP extension mechanism was created to extend RDAP queries
and/or responses, extensions can also be used to signal server policy
(for example, specifying the conditions of use for existing
response structures). Extensions that are primarily about signalling
server policy are often called &quot;profiles&quot;.</t>
<t>Some extensions exist to denote the usage of values placed into an
IANA registry, such as the IANA RDAP registries, or the usage of extensions
to technologies used by RDAP such as extended vCard/jCard properties.
Such extensions exist to &quot;mark&quot; these usages and are often called &quot;marker&quot;
extensions.</t>
<t>Regardless of the category of these extensions, their usage may also
leverage the appearance of their identifiers in the <tt>rdapConformance</tt> array.
Clients may use the <tt>/help</tt> query as defined in <xref target="RFC9082"></xref> to discover
the extensions available.</t>
</section>

<section anchor="extension-versioning"><name>Extension Versioning</name>
<t>As stated in <xref target="extension_identifier"></xref>, RDAP extensions are opaque and
they posses no explicit version despite the fact that some extension
identifiers include trailing numbers. That is, RDAP extensions without
an explicitly defined versioning scheme are opaquely versioned.</t>
<t>For example, <tt>fizzbuzz_1</tt> may be the successor to <tt>fizzbuzz_0</tt>, but it
may also be an extension for a completely separate purpose. Only consultation
of the definition of <tt>fizzbuzz_1</tt> will determine its relationship with
<tt>fizzbuzz_0</tt>. Additionally, <tt>fizzbuzz_99</tt> may be the predecessor of <tt>fizzbuzz_0</tt>.</t>
<t>If a future RFC defines a versioning scheme (such as using the
mechanims defined in section <xref target="extension_identifier"></xref>), an RDAP extension
definition MUST explicitly denote this compliance.</t>

<section anchor="backwards-compatible-changes"><name>Backwards-Compatible Changes</name>
<t>If an RDAP extension author wants to publish a new version of an
extension that is backwards-compatible with the previous version, then
one option is for the new version of the extension to define a new
identifier, as well as requiring that both the previous identifier
and the new identifier be included in the &quot;rdapConformance&quot; array of
responses.  That way, clients relying on the previous version of the
extension will continue to function as intended, while clients wanting
to make use of the newer version of the extension can check for the new
identifier in the response.</t>
<t>This approach can be used for an arbitrary number of new
backwards-compatible versions of a given extension.  For an extension
with a large number of backwards-compatible successor versions, this
may lead to a large number of identifiers being included in
responses.  An extension author may consider excluding older
identifiers from the set required by new successor versions,
based on data about client use/support or similar.</t>
</section>

<section anchor="backwards-incompatible-changes"><name>Backwards-Incompatible Changes</name>
<t>With the current extension model, an extension with a
backwards-incompatible change is indistinguishable from a new,
unrelated extension.  Implementors of such changes should consider the
following:</t>

<ul spacing="compact">
<li>whether the new version of the extension can be provided alongside
the old version of the extension, so that a service can simply
support both during a transition period;</li>
<li>whether some sort of client signalling should be supported, so that
clients can opt for the old or new version of the extension in
responses that they receive (see
<xref target="I-D.newton-regext-rdap-x-media-type"></xref> for an example of how this
might work); and</li>
<li>whether the extension itself should define how versioning is
handled within the extension documentation.</li>
</ul>
</section>
</section>

<section anchor="extension-identifiers-in-a-response"><name>Extension Identifiers in a Response</name>
<t>Extension specifications have customarily defined only one extension identifier. However,
there is no explicit limit on the number of extension identifiers that may be defined in
a single extension specification. One example is <xref target="I-D.ietf-regext-rdap-rir-search"></xref>.</t>
<t><xref target="RFC9083" sectionFormat="bare" section="Section 4.1"></xref> offers the following guidance on using the extension identifiers
in RDAP responses:</t>

<artwork><![CDATA[A response to a "help" request will include identifiers for all of the specifications
supported by the server. A response to any other request will include only identifiers 
for the specifications used in the construction of the response.
]]>
</artwork>
<t>A strict interpretation of this wording where &quot;construction of the response&quot; only refers
to the JSON syntax would rule out the usage of <xref target="profiles_and_markers"></xref> extension IDs which
are in common use in RDAP. This document updates the guidance. For responses to queries
other than &quot;help&quot;, a response MUST include in the <tt>rdapConformance</tt> array only those extension
identifiers necessary for a client to deserialize the JSON and understand the semantic meaning
of the content within the JSON, and all extensions identifiers MUST be free from conflict in
both their syntactic and semantic meaning.</t>
<t>Note that this document does not update the guidance from <xref target="RFC9083" sectionFormat="bare" section="Section 4.1"></xref> regarding
&quot;help&quot; responses and the <tt>rdapConformance</tt> array.</t>
<t>When a server implementation supports multiple extensions, it is RECOMMENDED that the server
also support and return versioning information as defined by <xref target="I-D.gould-regext-rdap-versioning"></xref>.</t>
</section>

<section anchor="extension-definitions"><name>Extension Definitions</name>
<t>Extensions must be documented in an RFC or in some other permanent and readily
available reference, in sufficient detail that interoperability between independent
implementations is possible.</t>
<t>Though RDAP gives each extension its own namespace, the definition of an
extension may re-use definitions found in the base RDAP specification or in any
other properly registered extension.</t>
<t><xref target="RFC9083"></xref> notes that the extension identifiers provide a &quot;hint&quot; to the client
as to how to interpret the response. This wording does not intentionally restrict
the extension to defining only JSON values within the extensions namespace.
Therefore, an extension may define the use of its own JSON values together
with the use of JSON values from other extensions or RDAP specifications. As with
the ICANN profile or NRO profile extensions, the extension may simply signal
policy applied to already defined RDAP structures.</t>
</section>

<section anchor="existing-extension-registrations"><name>Existing Extension Registrations</name>
<t>The following extensions have been registered with IANA, but do not
comply with the requirements set out in the base specifications, as
clarified by this document:</t>

<ul>
<li><t>Extension identifier: fred</t>

<ul spacing="compact">
<li>RDAP conformance value: fred_version_0</li>
<li>Field/path prefix: fred</li>
</ul></li>
<li><t>Extension identifier: artRecord</t>

<ul spacing="compact">
<li>RDAP conformance value: artRecord_level_0</li>
<li>Field/path prefix: artRecord</li>
</ul></li>
<li><t>Extension identifier: platformNS</t>

<ul spacing="compact">
<li>RDAP conformance value: platformNS_level_0</li>
<li>Field/path prefix: platformNS</li>
</ul></li>
<li><t>Extension identifier: regType</t>

<ul spacing="compact">
<li>RDAP conformance value: regType_level_0</li>
<li>Field/path prefix: regType</li>
</ul></li>
</ul>
<t>Client authors should be aware that responses that make use of these
extensions may require special handling on the part of the client.
Also, while these extensions will be retained in the registry, future
extensions that are similarly noncompliant will not be registered.</t>
<t>To avoid any confusion with the operation of the existing entries, an
extension registration that attempts to use one of the RDAP
conformance values given in this section as an extension identifier
(and so as an RDAP conformance value also) will be rejected.</t>
</section>

<section anchor="redirects"><name>Redirects</name>
<t><xref target="RFC7480"></xref> describes the use of redirects in RDAP. Redirects are prominent
in the discovery of authoritative INR servers as the process outlined in
<xref target="RFC9224"></xref>, which uses IANA allocations, does not account for transfers of
resources between INRs. <xref target="RFC7480" sectionFormat="bare" section="Section 4.3"></xref> instructs servers to ignore
unknown query parameters. As it relates to issuing URLs for redirects, servers
MUST NOT blindly copy query parameters from a request to a redirect URL as
query parameters may contain sensitive information, such as security credentials,
not relevant to the target server of the URL. Following the advice in <xref target="RFC7480"></xref>,
servers SHOULD only place query parameters in redirect URLs when it is known
by the origin server (the server issuing the redirect) that the target server
(the server referenced by the redirect) can process the query parameter and the
contents of the query parameter are appropriate to be received by the target.</t>
<t>As it is unlikely that every server in a cross-authority, redirect scenario will be upgraded to process
every new extension, extensions should not solely rely on query parameters to convey
information about a resource as query parameters are not guaranteed to survive a redirect.</t>
<t>This does not mean extensions are prohibited from using query parameters, but
rather that the use of query parameters must be applied for the scenarios appropriate
for the use of the extension. Therefore, extensions SHOULD NOT rely on query parameters
when the extension is to be used in scenarios requiring clients to find authoritative
servers, such as that described above, or other scenarios using redirects among
servers of differing authorities.</t>
<t>Extensions MAY use query parameters
in scenarios where the client has an a priori knowledge of the authoritative
server to which queries are to be sent. Such scenarios are generally queries
intended to yield multiple results, authentication or authorization,
and other scenarios where the behavior of requests across multiple authorities
is undefined.</t>
<t>In general, extension authors should be mindful of situations requiring clients
to directly handle redirects at the RDAP layer. Some clients may not be utilizing
HTTP libraries that provide such an option, and many HTTP client libraries that
do provide the option do not provide it as a default behavior. Additionally,
requiring clients to handle redirects at the RDAP layer adds complexity to the
client in that additional logic must be implemented to handle redirect loops,
parameter deconfliction, and URL encoding. The guidance given in <xref target="RFC7480" sectionFormat="bare" section="Section 5.2"></xref>
exists to simplify clients, especially those constructed with shell scripts
and HTTP command-line utilities.</t>
</section>

<section anchor="referrals"><name>Referrals</name>
<t>It is common in the RDAP ecosystem to link from one RDAP resource to another,
such as can be found in domain registrations in gTLD DNRs.
These are typically conveyed in the link structure defined in
<xref target="RFC9083" sectionFormat="of" section="4.2"></xref> and use the &quot;application/rdap+json&quot;
media type.</t>

<artwork><![CDATA[{
  "value" : "https://regy.example/domain/foo.example",
  "rel" : "related",
  "href" : "https://regr.example/domain/foo.example",
  "type" : "application/rdap+json"
}
]]>
</artwork>
<t>Extensions MUST explicitly define any required behavioral changes to the
processing of referrals, otherwise clients MUST assume the information
provided by referrals requires no additional processing or modification to
use in the dereferencing of the referral.</t>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>The following individuals have provided feedback and contributions to the
content and direction of this document: James Gould, Daniel Keathley, and
Ties de Kock.</t>
</section>

</middle>

<back>
<references><name>References</name>
<references><name>Normative References</name>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.gould-regext-rdap-versioning.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.newton-regext-rdap-x-media-type.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.9082.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-regext-rdap-rir-search.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.9224.xml"/>
</references>
</references>

</back>

</rfc>
