RFC 8982

Registration Data Access Protocol (RDAP) Partial Response

πŸ“… published February 2021, from ietf

RFC 8982: Registration Data Access Protocol (RDAP) Partial Response πŸŽ€

okay bestie, first the title block, because it's the important stuff πŸ’…

  • RFC number: 8982
  • Title: Registration Data Access Protocol (RDAP) Partial Response
  • Authors: M. Loffredo and M. Martinelli, both from IIT-CNR/Registro.it
  • Category: Standards Track
  • ISSN: 2070-1721
  • Date: February 2021
  • Obsoletes / Updates: nothing is listed in the header, so it doesn't obsolete or update anything

Abstract ✨

okay so RDAP doesn't have a way to ask for a partial response πŸ™ˆ Servers will only send back full responses, the ones with every bit of info a client is allowed to see. A partial response option that limits how much comes back, especially for search queries, could be a huge win for both clients and servers πŸ’– This doc describes an RDAP query extension that lets clients say what kind of partial response they'd like πŸ¦‹

Status of This Memo πŸ“œ

This is an Internet Standards Track document.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Info about the current status of this document, any errata, and how to give feedback on it is at https://www.rfc-editor.org/info/rfc8982.

Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.

Legal stuff, but important! This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, since they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

Table of Contents πŸ—‚οΈ

1.  Introduction
  1.1.  Conventions Used in This Document
2.  RDAP Path Segment Specification
  2.1.  Subsetting Metadata
    2.1.1.  RDAP Conformance
    2.1.2.  Representing Subsetting Links
3.  Dealing with Relationships
4.  Basic Field Sets
5.  Negative Answers
6.  IANA Considerations
7.  Security Considerations
8.  References
  8.1.  Normative References
  8.2.  Informative References
Appendix A.  Approaches to Partial Response Implementation
  A.1.  Specific Issues Raised by RDAP
Acknowledgements
Authors' Addresses

1. Introduction πŸ¦‹

The vibe: partial responses are super common in RESTful API [REST] design, and the logic is simple. Instead of sending back objects with every data field, you only send a subset of the fields in each result object πŸ“ The benefit is obvious: less data over the network means less bandwidth used, faster server responses, less CPU time on both the server and the client, and less memory used on the client 🧠

Right now RDAP doesn't give a client any way to ask for a partial response. Servers can only give the client a full response [RFC7483]. Servers can't limit how much info comes back based on what a client prefers, and that creates inefficiencies 😭

The protocol in this spec extends RDAP search capabilities so partial responses are possible. It works by letting clients add a new query parameter that points at predefined sets of fields they can submit to an RDAP service ✨ The service uses the Hypertext Transfer Protocol (HTTP) [RFC7230] and the conventions described in [RFC7480].

1.1. Conventions Used in This Document 🧚

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. πŸ’…

2. RDAP Path Segment Specification 🌸

The path segment in this section is an OPTIONAL extension of the search path segments defined in [RFC7482] πŸŽ€ This document defines an RDAP query parameter called "fieldSet". Its value is a non-empty string that identifies a server-defined set of fields returned in place of the full response. Servers usually describe the field sets they support in out-of-band documents (for example, an RDAP profile) along with other features. This document also defines, in Section 2.1, an in-band mechanism that lets servers give clients basic info about the field sets they support πŸ¦‹

Here's an example RDAP query with the "fieldSet" parameter:

https://example.com/rdap/domains?name=example*.com&fieldSet=afieldset

Why this approach? This solution is easier for RDAP providers to implement than field selection, and clients can request it really easily πŸ™Œ The reasoning behind it is explained in more detail in Appendix A.

2.1. Subsetting Metadata πŸ’œ

So, HATEOAS! It's "Hypermedia as the Engine of Application State" [HATEOAS], and the big idea is that a client starting from an initial URI should use server-provided links to discover what actions are available and reach the resources it needs. That way the client doesn't need prior knowledge of the service or hard-coded URIs for each resource 🫢 It also lets the server change URIs as the API evolves without breaking clients. Basically, a REST service ought to be as self-descriptive as it can be ✨

So, servers implementing the query parameter described in this specification SHOULD provide extra info in their responses about the available field sets. That info goes in a new JSON data structure called "subsetting_metadata", which has these properties:

  • "currentFieldSet": "String" (REQUIRED): this is either the value of the "fieldSet" parameter from the query string, or the field set applied by default.
  • "availableFieldSets": "AvailableFieldSet[]" (OPTIONAL): an array of objects, with each element describing one available field set. The AvailableFieldSet object has these members:
    • "name": "String" (REQUIRED): the field set name.
    • "default": "Boolean" (REQUIRED): tells you whether the field set is applied by default. An RDAP server MUST define only one default field set πŸ‘‘
    • "description": "String" (OPTIONAL): a human-readable description of the field set.
    • "links": "Link[]" (OPTIONAL): an array of links as described in [RFC8288], containing the query string that applies the field set (see Section 2.1.2).

2.1.1. RDAP Conformance 🫢

Servers that return the "subsetting_metadata" section in their responses MUST include "subsetting" in the rdapConformance array. πŸ’–

An RDAP server MAY use the "links" array of the "subsetting_metadata" element to provide ready-made references [RFC8288] to the available field sets (Figure 1). The target URI in each link is a reference to an alternative to the current view of results, identified by the context URI.

The "value", "rel", and "href" JSON values MUST be specified. All other JSON values are OPTIONAL. 🧾

Here's what that looks like (Figure 1):

{
  "rdapConformance": [
    "rdap_level_0",
    "subsetting"
  ],
  ...
  "subsetting_metadata": {
    "currentFieldSet": "afieldset",
    "availableFieldSets": [
      {
      "name": "anotherfieldset",
      "description": "Contains some fields",
      "default": false,
      "links": [
        {
        "value": "https://example.com/rdap/domains?name=example*.com
                  &fieldSet=afieldset",
        "rel": "alternate",
        "href": "https://example.com/rdap/domains?name=example*.com
                 &fieldSet=anotherfieldset",
        "title": "Result Subset Link",
        "type": "application/rdap+json"
        }
      ]
      },
    ...
    ]
  },
  ...
  "domainSearchResults": [
    ...
  ]
}

Figure 1: Example of a "subsetting_metadata" Instance

3. Dealing with Relationships 🌈

This one's a bit tricky, so stay with me πŸ₯Ή Representing second-level objects inside a field set brings some extra things to think about. The topmost objects in a response change depending on which field set is in use, so the response might have no relationships (for example, with an abbreviated field set). Or it might include associated objects, just like a normal RDAP query response. Each field set can say what format the additional objects should come back in, the same way the field set controls the format of the topmost objects πŸ’…

4. Basic Field Sets πŸ‘‘

This section defines three basic field sets that servers MAY implement to make things easier for clients 🧚

  • "id": The server only gives back the key field. That's "handle" for entities, and "ldhName" for domains and nameservers. If a returned domain or nameserver is an Internationalized Domain Name (IDN) [RFC5890], then the "unicodeName" field MUST additionally be included in the response. This field set could be used when the client wants a collection of object identifiers (Figure 2).
  • "brief": This field set has the fields that can be included in a "short" response. It could be used when the client wants a subset of the full response that gives only basic info about each object.
  • "full": This field set has all of the info the server can provide for a particular object.

The "objectClassName" field is implicitly included in each of the field sets above. RDAP providers SHOULD include a "links" field indicating the "self" link relationship. RDAP providers MAY also add any property that provides service info 🌸

Fields included in the "brief" and "full" field set responses MUST take into account the user's access and authorization levels πŸ”

Here's the "id" example (Figure 2):

{
  "rdapConformance": [
    "rdap_level_0",
    "subsetting"
  ],
  ...
  "domainSearchResults": [
    {
      "objectClassName": "domain",
      "ldhName": "example1.com",
      "links": [
        {
        "value": "https://example.com/rdap/domain/example1.com",
        "rel": "self",
        "href": "https://example.com/rdap/domain/example1.com",
        "type": "application/rdap+json"
        }
      ]
    },
    {
      "objectClassName": "domain",
      "ldhName": "example2.com",
      "links": [
        {
        "value": "https://example.com/rdap/domain/example2.com",
        "rel": "self",
        "href": "https://example.com/rdap/domain/example2.com",
        "type": "application/rdap+json"
        }
      ]
    },
    ...
  ]
}

Figure 2: Example of RDAP Response According to the "id" Field Set

5. Negative Answers πŸ’…

okay so, every request with an empty or unsupported fieldSet value MUST get an HTTP 400 (Bad Request) response code πŸ™…β€β™€οΈ no exceptions bestie. the server MAY also add some extra info about which field sets it does support in the HTTP entity body (Figure 3) πŸ’–

{
    "errorCode": 400,
    "title": "Field set 'unknownfieldset' is not valid",
    "description": [
        "Supported field sets are: 'afieldset', 'anotherfieldset'."
    ]

}

Figure 3: Example of RDAP Error Response Due to an Invalid Field Set Included in the Request

6. IANA Considerations πŸ—‚οΈ

IANA has registered the following value in the "RDAP Extensions" registry πŸŽ€

Extension identifier:  subsetting
Registry operator:  Any
Published specification:  RFC 8982
Contact:  IETF <iesg@ietf.org>
Intended usage:  This extension describes a best practice for partial
   response provisioning.

7. Security Considerations 🚨

okay this section is giving serious drama and i love it 😭 a search query usually eats way more server resources (memory, CPU cycles, and network bandwidth) than a lookup query does. that makes server resource exhaustion and a denial of service way more likely πŸ’€ you can soften the risk by supporting partial responses together with other strategies, like restricting search functionality, limiting the rate of search requests, and truncating and paging results ✨

partial responses also let RDAP operators run data access control policies based on the HTTP authentication mechanisms described in [RFC7481] πŸ” operators can change what goes back in an RDAP response depending on the client's access and authorization levels. for example:

  • the list of fields for each set can be different based on the client's access and authorization levels;
  • the set of available field sets could be restricted based on the client's access and authorization levels.

servers can also set different result limits for each field set, which means a more flexible truncation strategy can be built 🧚 the new query parameter in this document gives RDAP operators a way to build a server that cuts down on inefficiency risks πŸ’œ

8. References πŸ“š

8.1. Normative References

8.2. Informative References

Appendix A. Approaches to Partial Response Implementation πŸ¦‹

okay so if you look at how data providers on the web have actually done partial responses, two approaches show up πŸ‘€

  • the client explicitly describes the data fields to be returned;
  • the client describes a name identifying a server-defined set of data fields.

the first one is more flexible than the second, because clients can ask for exactly the fields they need πŸ™Œ but it comes with some drawbacks, ngl:

  • Fields have to be declared according to a given syntax. This is a simple task when the data structure of the object is flat, but it is much more difficult when the object has a tree structure like that of a JSON object. The presence of arrays and deep nested objects complicates both the syntax definition of the query and, consequently, the processing required on the server side.
  • Clients need to recognize the returned data structure to avoid cases when the requested fields are invalid.
  • The request of some fields might not match the client's access and authorization levels. Clients might request unauthorized fields, and servers have to define a strategy for responding such as always returning an error response or returning a response that ignores the unauthorized fields.

A.1. Specific Issues Raised by RDAP 🌸

on top of those, RDAP responses bring their own special issues 😀

  • Relevant entity object information is included in a jCard, but such information cannot be easily selected because it is split into the items of a jagged array.
  • RDAP responses contain some properties providing service information (e.g., rdapConformance, links, notices, remarks, etc.), which are not normally selected but are just as important. They could be returned anyway but, in this case, the server would provide unrequested data.

these issues can be addressed, though πŸ’… for example, the Catnap Query Language [CQL] is a comprehensive expression language that can be used to customize the JSON response of a RESTful web service. applying CQL to RDAP responses would explicitly identify the output fields that are acceptable when only a few fields are requested, but it gets very complicated once you process a larger number of fields. below are two CQL expressions for a domain search query (Figure 4). the first one only asks for objectClassName and ldhName. the second one lists the fields of a possible WHOIS-like response.

https://example.com/rdap/domains?name=example*.com
        &fields=domainSearchResults(objectClassName,ldhName)

https://example.com/rdap/domains?name=example*.com
        &fields=domainSearchResults(objectClassName,ldhName,
                unicodeName,
                status,
                events(eventAction,eventDate),
                entities(objectClassName,handle,roles),
                nameservers(objectClassName,ldhName))

Figure 4: Examples of CQL Expressions for a Domain Search Query

the field set approach seems to make RDAP interoperability easier 🧚 servers can define basic field sets that, if clients know about them, can raise the odds of getting a valid response. using field sets also keeps the query string less complex. and predefining sets of fields makes it easier to set result limits πŸ“

finally, RDAP users don't really need maximum flexibility to define every possible set of logically connected fields. users interested in domains usually need the status, the creation date, and the expiry date of each domain, for example πŸ“… so the field set approach is the one that's preferred πŸ‘‘

Acknowledgements 🫢

the authors want to give a huge thank you to Scott Hollenbeck, Tom Harrison, Karl Heinz Wolf, Jasdip Singh, Patrick Mevzek, Benjamin Kaduk, Roman Danyliw, Murray Kucherawy, Erik Kline, and Robert Wilton for their contribution to this document βœ¨πŸ’–

Authors' Addresses πŸ–‹οΈ

Mario Loffredo
IIT-CNR/Registro.it
Via Moruzzi,1
56124 Pisa
Italy

Email: mario.loffredo@iit.cnr.it
URI:   https://www.iit.cnr.it
Maurizio Martinelli
IIT-CNR/Registro.it
Via Moruzzi,1
56124 Pisa
Italy

Email: maurizio.martinelli@iit.cnr.it
URI:   https://www.iit.cnr.it
πŸ“¦ where this page comes from