idnits 2.17.1 draft-ietf-regext-rdap-partial-response-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 11, 2019) is 1842 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7482 (Obsoleted by RFC 9082) ** Obsolete normative reference: RFC 7483 (Obsoleted by RFC 9083) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Registration Protocols Extensions M. Loffredo 3 Internet-Draft M. Martinelli 4 Intended status: Standards Track IIT-CNR/Registro.it 5 Expires: October 13, 2019 April 11, 2019 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-ietf-regext-rdap-partial-response-01 10 Abstract 12 The Registration Data Access Protocol (RDAP) does not include 13 capabilities to request partial responses. In fact, according to the 14 user authorization, the server can only return full responses. 15 Partial responses capability, especially in the case of search 16 queries, could bring benefits to both clients and servers. This 17 document describes a RDAP query extension that allows clients to 18 specify their preference for obtaining a partial response. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on October 13, 2019. 37 Copyright Notice 39 Copyright (c) 2019 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (https://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 1.1. Conventions Used in This Document . . . . . . . . . . . . 3 56 2. Approaches to Partial Response Implementation . . . . . . . . 3 57 3. RDAP Path Segment Specification . . . . . . . . . . . . . . . 5 58 3.1. Subsetting Metadata . . . . . . . . . . . . . . . . . . . 5 59 3.1.1. Representing Subsetting Links . . . . . . . . . . . . 6 60 4. Dealing with Relationships . . . . . . . . . . . . . . . . . 7 61 5. Basic Field Sets . . . . . . . . . . . . . . . . . . . . . . 7 62 6. RDAP Conformance . . . . . . . . . . . . . . . . . . . . . . 8 63 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 64 7.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 9 65 8. Security Considerations . . . . . . . . . . . . . . . . . . . 9 66 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 68 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 69 11.1. Normative References . . . . . . . . . . . . . . . . . . 10 70 11.2. Informative References . . . . . . . . . . . . . . . . . 11 71 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 12 72 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 74 1. Introduction 76 The use of partial response in RESTful API ([REST]) design is very 77 common. The rationale is quite simple: instead of returning objects 78 in API responses with all data fields, only a subset is returned. 79 The benefit is obvious: less data transferred over the network mean 80 less bandwidth usage, faster server response, less CPU time spent 81 both on the server and the client, as well as less memory usage on 82 the client. 84 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 85 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 86 by providing an optional query parameter by which users require the 87 fields they wish to receive. Partial response is also considered a 88 leading principle by many best practices guidelines in REST APIs 89 implementation ([REST-API1], [REST-API2]) in order to improve 90 performance, save on bandwidth and possibly accelerate the overall 91 interaction. In other contexts, for example in digital libraries and 92 bibliographic catalogues, servers can provide responses according to 93 different element sets (i.e. "brief" to get back a short response and 94 "full" to get back the complete response) 95 Currently, RDAP does not provide a client with any way to request a 96 partial response: the server can only provide the client with the 97 full response ([RFC7483]). Furthermore, servers cannot define the 98 limits of the results according to partial responses and this causes 99 strong inefficiencies. 101 The protocol described in this specification extends RDAP search 102 capabilities to enable partial responses, by adding a new query 103 parameter and using a RESTful web service. The service is 104 implemented using the Hypertext Transfer Protocol (HTTP) ([RFC7230]) 105 and the conventions described in RFC 7480 ([RFC7480]). 107 1.1. Conventions Used in This Document 109 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 110 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 111 document are to be interpreted as described in RFC 2119 ([RFC2119]). 113 2. Approaches to Partial Response Implementation 115 Looking at the implementation experiences described above, two 116 approaches to the implementation of partial response can be detected: 118 o the client declares explicitly the data fields to get back; 120 o the client declares a name identifying a server pre-defined set of 121 data fields. 123 The former is more flexible than the latter, because clients can 124 specify all the data fields they need. However, it has some 125 drawbacks: 127 o Fields have to be declared according to a given syntax. This is a 128 simple task when the data structure of the object is flat, but it 129 is much more difficult when the object has a tree structure like 130 the one of a JSON object. The presence of arrays and deep nested 131 objects contribute to complicate both the syntax definition of the 132 query and, consequently, the processing phase on the server side. 134 o Clients should perfectly know the returned object to avoid cases 135 when the required fields are not compliant with the object data 136 structure. 138 o The request of some fields cannot match the user access levels. 139 Clients could put unauthorized fields in their requests and 140 servers should define a strategy for providing a response: to 141 return always an error response or to return a response ignoring 142 the unauthorized fields. 144 In addition to those listed above, RDAP responses raise some specific 145 issues: 147 o Most of the relevant information of the entity object is included 148 in the jCard but such information cannot be easily selected 149 because it is split into the items of a jagged array. 151 o RDAP responses contain some properties providing service 152 information (e.g. rdapConformance, links, notices, remarks, etc.) 153 which are not normally selected but they are just as important. 154 They could be returned anyway but, in this case, the server would 155 provide unrequested data. 157 As an example compliant to the first approach, the Catnap Query 158 Language ([CQL]) is a comprehensive expression language that can be 159 used to customize the JSON response of a RESTful web service. The 160 practical application of CQL to RDAP responses points out that 161 declaring explicitly the output fields would still be acceptable when 162 a few fields are requested but it would become very complicated if 163 the fields should be more. In the following, two CQL expressions for 164 a search domain query are shown (Figure 1): in the first, only 165 objectClassName and ldhName are requested, in the second, the fields 166 of a possible WHOIS-like response are listed. 168 https://example.com/rdap/domains?name=example*.com 169 &fields=domainSearchResults(objectClassName,ldhName) 171 https://example.com/rdap/domains?name=example*.com 172 &fields=domainSearchResults(objectClassName,ldhName,unicodeName, 173 status, 174 events(eventAction,eventDate), 175 entities(objectClassName,handle,roles), 176 nameservers(objectClassName,ldhName)) 178 Figure 1: Examples of CQL expressions for a search domain query 180 The latter approach seems to facilitate RDAP interoperability. In 181 fact, servers can define some basic field sets which, if known to the 182 clients, can increase the probability to get a valid response. The 183 usage of field sets lets the query string be less complex. In 184 addition, the definition of pre-defined sets of fields makes easier 185 to establish the results limits. 187 Finally, considering that there is not a real need for RDAP users to 188 have the maximum flexibility in defining all the possible sets of 189 logically connected fields (for example, users interested in domains 190 usually need to know the status, the creation date, the expire date 191 of each domain), the latter approach is preferred. 193 3. RDAP Path Segment Specification 195 The path segment defined in this section is an OPTIONAL extension of 196 search path segments defined in RFC 7482 ([RFC7482]). This document 197 defines an RDAP query parameter, "fieldSet", whose value is a string 198 identifying a server pre-defined set of fields (Figure 2). 200 https://example.com/rdap/domains?name=example*.com&fieldSet=afieldset 202 Figure 2: Example of RDAP search query reporting the "fieldSet" 203 parameter 205 3.1. Subsetting Metadata 207 According to most advanced principles in REST design, collectively 208 known as HATEOAS (Hypermedia as the Engine of Application State) 209 ([HATEOAS]), a client entering a REST application through an initial 210 URI should use the server-provided links to dynamically discover 211 available actions and access the resources it needs. In this way, 212 the client is not requested to have prior knowledge of the service 213 and, consequently, to hard code the URIs of different resources. 214 This would allow the server to make URI changes as the API evolves 215 without breaking the clients. Definitively, a REST service should be 216 as self-descriptive as possible. 218 Therefore, servers implementing the query parameter described in this 219 specification SHOULD provide additional information in their 220 responses about the available field sets. Such information is 221 collected in a new data structure named "subsetting_metadata" 222 containing the following properties: 224 o "currentFieldSet": "String" (REQUIRED) either the value of 225 "fieldSet" parameter as specified in the query string or the field 226 set applied by default; 228 o "availableFieldSets": "AvailableFieldSet[]" (OPTIONAL) an array of 229 objects each one describing an alternate available field set. 230 Members are: 232 * "name": "String" (REQUIRED) the field set name; 233 * "default": "Boolean" (REQUIRED) whether the field set is 234 applied by default; 235 * "description": "String" (OPTIONAL) a human-readable description 236 of the field set; 238 * "links": "Link[]" (OPTIONAL) an array of links as described in 239 RFC 8288 ([RFC8288]) containing the query string that applies 240 the field set. 242 3.1.1. Representing Subsetting Links 244 An RDAP server MAY use the "links" array of the "subsetting_metadata" 245 section to provide ready-made references ([RFC8288]) to the available 246 field sets (Figure 3). Each link represents a reference to an 247 alternate view of the results. 249 { 250 "rdapConformance": [ 251 "rdap_level_0", 252 "subsetting_level_0" 253 ], 254 ... 255 "subsetting_metadata": { 256 "currentFieldSet": "afieldset", 257 "availableFieldSets": [ 258 { 259 "name": "anotherfieldset", 260 "description": "Contains some fields", 261 "default": false, 262 "links": [ 263 { 264 "value": "https://example.com/rdap/domains?name=*nr.com 265 &fieldSet=afieldset", 266 "rel": "alternate", 267 "href": "https://example.com/rdap/domains?name=*nr.com 268 &fieldSet=anotherfieldset", 269 "title": "Result Subset Link", 270 "type": "application/rdap+json" 271 }, 272 ... 273 ] 274 }, 275 "domainSearchResults": [ 276 ... 277 ] 278 } 280 Figure 3: Example of a "subsetting_metadata" instance 282 4. Dealing with Relationships 284 Some additional considerations can be made about how second level 285 objects could be represented within a field set. In fact, since the 286 topmost objects could be returned according to different field sets, 287 the same thing could go for their related objects. As a consequence, 288 the response could contain either no relationship or associated 289 objects which are in turn provided according to a field set. 291 5. Basic Field Sets 293 In order to improve interoperability between clients and servers, the 294 name, as well as the list of fields for each field set, should be 295 shared by most of RDAP providers. This section defines three basic 296 field sets which servers MAY implement to facilitate their 297 interaction with clients: 299 o "id": the server provides only the key field ("handle" for 300 entities, "ldhName" for domains and nameservers). This field set 301 could be used when the client wants to simply obtain a collection 302 of object identifiers (Figure 4); 304 o "brief": it contains the fields that can be included in a "short" 305 response. This field set could be used when the client is asking 306 for a subset of the full response which gives a basic knowledge of 307 each object; 309 o "full": it contains all the information the server can provide for 310 a particular object. 312 The "objectClassName" field is implicitly included in each of the 313 above field sets. RDAP providers MAY add any property providing 314 service information. 316 Fields belonging to "brief" and "full" field sets could be returned 317 according to users access levels. 319 { 320 "rdapConformance": [ 321 "rdap_level_0", 322 ], 323 ... 324 "domainSearchResults": [ 325 { 326 "objectClassName": "domain", 327 "ldhName": "example1.com" 328 }, 329 { 330 "objectClassName": "domain", 331 "ldhName": "example2.com" 332 }, 333 ... 334 ] 335 } 337 Figure 4: Example of RDAP response according to the "id" field set 339 6. RDAP Conformance 341 Servers returning the "subsetting_metadata" section in their 342 responses MUST include "subsetting_level_0" in the rdapConformance 343 array. 345 7. Implementation Status 347 NOTE: Please remove this section and the reference to RFC 7942 prior 348 to publication as an RFC. 350 This section records the status of known implementations of the 351 protocol defined by this specification at the time of posting of this 352 Internet-Draft, and is based on a proposal described in RFC 7942 353 ([RFC7942]). The description of implementations in this section is 354 intended to assist the IETF in its decision processes in progressing 355 drafts to RFCs. Please note that the listing of any individual 356 implementation here does not imply endorsement by the IETF. 357 Furthermore, no effort has been spent to verify the information 358 presented here that was supplied by IETF contributors. This is not 359 intended as, and must not be construed to be, a catalog of available 360 implementations or their features. Readers are advised to note that 361 other implementations may exist. 363 According to RFC 7942, "this will allow reviewers and working groups 364 to assign due consideration to documents that have the benefit of 365 running code, which may serve as evidence of valuable experimentation 366 and feedback that have made the implemented protocols more mature. 368 It is up to the individual working groups to use this information as 369 they see fit". 371 7.1. IIT-CNR/Registro.it 373 Responsible Organization: Institute of Informatics and Telematics 374 of National Research Council (IIT-CNR)/Registro.it 375 Location: https://rdap.pubtest.nic.it/ 376 Description: This implementation includes support for RDAP queries 377 using data from the public test environment of .it ccTLD. 378 Level of Maturity: This is a "proof of concept" research 379 implementation. 380 Coverage: This implementation includes all of the features 381 described in this specification. 382 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 384 8. Security Considerations 386 Search query typically requires more server resources (such as 387 memory, CPU cycles, and network bandwidth) when compared to lookup 388 query. This increases the risk of server resource exhaustion and 389 subsequent denial of service due to abuse. Partial response can 390 contribute together with other strategies (e.g. restricting search 391 functionality, limiting the rate of search requests, truncating and 392 paging results) to mitigate this risk. 394 Furthermore, partial response can help RDAP operators to regulate 395 access control based on client identification, implemented by HTTP 396 authentication mechanisms as described in RFC 7481 ([RFC7481]). In 397 fact, RDAP operators can follow different, not alternative, 398 approaches to the building of responses according to the user access 399 levels: 401 o the list of fields for each set can be different according to the 402 user access levels; 404 o some field sets could be available only to some users. 406 Servers can also define different results limits according to the 407 available field sets, so a more flexible truncation strategy can be 408 realized. 410 Therefore, the new query parameter presented in this document 411 provides the RDAP operators with a way to implement a secure server 412 without penalizing its efficiency. 414 9. IANA Considerations 416 This document has no actions for IANA. 418 10. Acknowledgements 420 The authors would like to acknowledge Scott Hollenbeck for his 421 contribution to this document. 423 11. References 425 11.1. Normative References 427 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 428 Requirement Levels", BCP 14, RFC 2119, 429 DOI 10.17487/RFC2119, March 1997, 430 . 432 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 433 Protocol (HTTP/1.1): Message Syntax and Routing", 434 RFC 7230, DOI 10.17487/RFC7230, June 2014, 435 . 437 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 438 Registration Data Access Protocol (RDAP)", RFC 7480, 439 DOI 10.17487/RFC7480, March 2015, 440 . 442 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 443 Registration Data Access Protocol (RDAP)", RFC 7481, 444 DOI 10.17487/RFC7481, March 2015, 445 . 447 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 448 Protocol (RDAP) Query Format", RFC 7482, 449 DOI 10.17487/RFC7482, March 2015, 450 . 452 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 453 Registration Data Access Protocol (RDAP)", RFC 7483, 454 DOI 10.17487/RFC7483, March 2015, 455 . 457 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 458 DOI 10.17487/RFC8288, October 2017, 459 . 461 11.2. Informative References 463 [CQL] Whitaker, G., "Catnap Query Language Reference", September 464 2017, . 467 [FACEBOOK] 468 facebook.com, "facebook for developers - Using the Graph 469 API", July 2017, . 472 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 473 Response and Partial Update", March 2010, 474 . 477 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 478 . 481 [LINKEDIN] 482 linkedin.com, "Java One 2009: Building Consistent RESTful 483 APIs in a High Performance Environment", July 2009, 484 . 488 [REST] Fielding, R., "Architectural Styles and the Design of 489 Network-based Software Architectures", 2000, 490 . 493 [REST-API1] 494 Jobinesh, P., "RESTful Java Web Services - Second 495 Edition", September 2015. 497 [REST-API2] 498 Masse, M., "REST API Design Rulebook", October 2011. 500 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 501 Code: The Implementation Status Section", BCP 205, 502 RFC 7942, DOI 10.17487/RFC7942, July 2016, 503 . 505 Appendix A. Change Log 507 00: Initial working group version ported from draft-loffredo-regext- 508 rdap-partial-response-03 509 01: Removed "FOR DISCUSSION" items. Changed the basic field sets 510 from REQUIRED to OPTIONAL. Removed the definition of fields 511 included in "brief" field set. Provided a more detailed 512 description of "subsetting_metadata" structure. Removed some 513 references. 515 Authors' Addresses 517 Mario Loffredo 518 IIT-CNR/Registro.it 519 Via Moruzzi,1 520 Pisa 56124 521 IT 523 Email: mario.loffredo@iit.cnr.it 524 URI: http://www.iit.cnr.it 526 Maurizio Martinelli 527 IIT-CNR/Registro.it 528 Via Moruzzi,1 529 Pisa 56124 530 IT 532 Email: maurizio.martinelli@iit.cnr.it 533 URI: http://www.iit.cnr.it