idnits 2.17.1 draft-ietf-regext-rdap-partial-response-10.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 28, 2020) is 1453 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 30, 2020 April 28, 2020 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-ietf-regext-rdap-partial-response-10 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. A 15 partial response capability, especially in the case of search 16 queries, could bring benefits to both clients and servers. This 17 document describes an 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 30, 2020. 37 Copyright Notice 39 Copyright (c) 2020 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. RDAP Path Segment Specification . . . . . . . . . . . . . . . 3 57 2.1. Subsetting Metadata . . . . . . . . . . . . . . . . . . . 3 58 2.1.1. RDAP Conformance . . . . . . . . . . . . . . . . . . 4 59 2.1.2. Representing Subsetting Links . . . . . . . . . . . . 4 60 3. Dealing with Relationships . . . . . . . . . . . . . . . . . 5 61 4. Basic Field Sets . . . . . . . . . . . . . . . . . . . . . . 6 62 5. Negative Answers . . . . . . . . . . . . . . . . . . . . . . 7 63 6. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 64 6.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 8 65 6.2. APNIC . . . . . . . . . . . . . . . . . . . . . . . . . . 8 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 67 8. Security Considerations . . . . . . . . . . . . . . . . . . . 9 68 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 69 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 10.1. Normative References . . . . . . . . . . . . . . . . . . 10 71 10.2. Informative References . . . . . . . . . . . . . . . . . 11 72 Appendix A. Approaches to Partial Response Implementation . . . 11 73 A.1. Specific Issues Raised by RDAP . . . . . . . . . . . . . 12 74 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 13 75 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 77 1. Introduction 79 The use of partial response in RESTful API ([REST]) design is very 80 common. The rationale is quite simple: instead of returning objects 81 in API responses with all data fields, only a subset of fields in 82 each result object is returned. The benefit is obvious: less data 83 transferred over the network means less bandwidth usage, faster 84 server response, less CPU time spent both on the server and the 85 client, as well as less memory usage on the client. 87 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 88 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 89 by providing an optional query parameter by which users require the 90 fields they wish to receive. Partial response is also considered a 91 leading principle by many best practices guidelines in REST APIs 92 implementation ([REST-API1], [REST-API2]) in order to improve 93 performance, save on bandwidth and possibly accelerate the overall 94 interaction. In other contexts, for example in digital libraries and 95 bibliographic catalogues, servers can provide responses according to 96 different element sets (i.e. "brief" to get back a short response and 97 "full" to get back the complete response) 99 Currently, RDAP does not provide a client with any way to request a 100 partial response: the server can only provide the client with the 101 full response ([RFC7483]). Furthermore, servers cannot define the 102 limits of the results according to partial responses and this causes 103 strong inefficiencies. 105 The protocol described in this specification extends RDAP search 106 capabilities to enable partial responses through the provisioning of 107 pre-defined sets of fields the user can request to an RDAP service by 108 adding a new query parameter. The service is implemented using the 109 Hypertext Transfer Protocol (HTTP) ([RFC7230]) and the conventions 110 described in RFC 7480 ([RFC7480]). 112 1.1. Conventions Used in This Document 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 116 document are to be interpreted as described in RFC 2119 ([RFC2119]). 118 2. RDAP Path Segment Specification 120 The path segment defined in this section is an OPTIONAL extension of 121 search path segments defined in RFC 7482 ([RFC7482]). This document 122 defines an RDAP query parameter, "fieldSet", whose value is a string 123 identifying a server pre-defined set of fields (Figure 1). 125 This solution can be implemented by the RDAP providers with less 126 effort than fields selection and easily requested by consumers. The 127 considerations that has led to opt for this solution are reported in 128 more detail in Appendix A. 130 https://example.com/rdap/domains?name=example*.com&fieldSet=afieldset 132 Figure 1: Example of RDAP search query reporting the "fieldSet" 133 parameter 135 2.1. Subsetting Metadata 137 According to most advanced principles in REST design, collectively 138 known as HATEOAS (Hypermedia as the Engine of Application State) 139 ([HATEOAS]), a client entering a REST application through an initial 140 URI should use the server-provided links to dynamically discover 141 available actions and access the resources it needs. In this way, 142 the client is not requested to have prior knowledge of the service 143 and, consequently, to hard code the URIs of different resources. 144 This would allow the server to make URI changes as the API evolves 145 without breaking the clients. Definitively, a REST service should be 146 as self-descriptive as possible. 148 Therefore, servers implementing the query parameter described in this 149 specification SHOULD provide additional information in their 150 responses about the available field sets. Such information is 151 collected in a new data structure named "subsetting_metadata" 152 containing the following properties: 154 o "currentFieldSet": "String" (REQUIRED) either the value of 155 "fieldSet" parameter as specified in the query string or the field 156 set applied by default; 158 o "availableFieldSets": "AvailableFieldSet[]" (OPTIONAL) an array of 159 objects each one describing an alternate available field set. 160 Members are: 162 * "name": "String" (REQUIRED) the field set name; 163 * "default": "Boolean" (REQUIRED) whether the field set is 164 applied by default; 165 * "description": "String" (OPTIONAL) a human-readable description 166 of the field set; 167 * "links": "Link[]" (OPTIONAL) an array of links as described in 168 RFC 8288 ([RFC8288]) containing the query string that applies 169 the field set. 171 2.1.1. RDAP Conformance 173 Servers returning the "subsetting_metadata" section in their 174 responses MUST include "subsetting" in the rdapConformance array. 176 2.1.2. Representing Subsetting Links 178 An RDAP server MAY use the "links" array of the "subsetting_metadata" 179 element to provide ready-made references ([RFC8288]) to the available 180 field sets (Figure 2). The target URI in each link is the reference 181 to an alternate view of the results with respect to the current view 182 of the results identified by the context URI. 184 { 185 "rdapConformance": [ 186 "rdap_level_0", 187 "subsetting" 188 ], 189 ... 190 "subsetting_metadata": { 191 "currentFieldSet": "afieldset", 192 "availableFieldSets": [ 193 { 194 "name": "anotherfieldset", 195 "description": "Contains some fields", 196 "default": false, 197 "links": [ 198 { 199 "value": "https://example.com/rdap/domains?name=*nr.com 200 &fieldSet=afieldset", 201 "rel": "alternate", 202 "href": "https://example.com/rdap/domains?name=*nr.com 203 &fieldSet=anotherfieldset", 204 "title": "Result Subset Link", 205 "type": "application/rdap+json" 206 } 207 ] 208 }, 209 ... 210 ] 211 }, 212 ... 213 "domainSearchResults": [ 214 ... 215 ] 216 } 218 Figure 2: Example of a "subsetting_metadata" instance 220 3. Dealing with Relationships 222 Some additional considerations can be made about how second level 223 objects could be represented within a field set. In fact, since the 224 topmost objects could be returned according to different field sets, 225 the same thing could go for their related objects. As a consequence, 226 the response could contain either no relationship or associated 227 objects which are in turn provided according to a field set. 229 4. Basic Field Sets 231 In order to improve interoperability between clients and servers, the 232 name, as well as the list of fields for each field set, should be 233 shared by most of RDAP providers. This section defines three basic 234 field sets which servers MAY implement to facilitate their 235 interaction with clients: 237 o "id": the server provides only the key field, respectively: 238 "handle" for entities, "ldhName" for domains and nameservers. If 239 a returned domain or nameserver is an IDN ([RFC5890]), then the 240 "unicodeName" field MUST be included in the response. This field 241 set could be used when the client wants to simply obtain a 242 collection of object identifiers (Figure 3); 244 o "brief": it contains the fields that can be included in a "short" 245 response. This field set could be used when the client is asking 246 for a subset of the full response which gives a basic knowledge of 247 each object; 249 o "full": it contains all the information the server can provide for 250 a particular object. 252 The "objectClassName" field is implicitly included in each of the 253 above field sets. RDAP providers are RECOMMENDED to include a "self" 254 link in each field set. RDAP providers MAY also add any property 255 providing service information. 257 Fields included in "brief" and "full" field sets could be returned 258 according to the user access levels. 260 { 261 "rdapConformance": [ 262 "rdap_level_0", 263 "subsetting" 264 ], 265 ... 266 "domainSearchResults": [ 267 { 268 "objectClassName": "domain", 269 "ldhName": "example1.com", 270 "links": [ 271 { 272 "value": "https://example.com/rdap/domain/example1.com", 273 "rel": "self", 274 "href": "https://example.com/rdap/domain/example1.com", 275 "type": "application/rdap+json" 276 } 277 ] 278 }, 279 { 280 "objectClassName": "domain", 281 "ldhName": "example2.com", 282 "links": [ 283 { 284 "value": "https://example.com/rdap/domain/example2.com", 285 "rel": "self", 286 "href": "https://example.com/rdap/domain/example2.com", 287 "type": "application/rdap+json" 288 } 289 ] 290 }, 291 ... 292 ] 293 } 295 Figure 3: Example of RDAP response according to the "id" field set 297 5. Negative Answers 299 Each request including an unsupported field set SHOULD obtain an HTTP 300 400 (Bad Request) response code. 302 Optionally, the response MAY include additional information regarding 303 the negative answer in the HTTP entity body. 305 6. Implementation Status 307 NOTE: Please remove this section and the reference to RFC 7942 prior 308 to publication as an RFC. 310 This section records the status of known implementations of the 311 protocol defined by this specification at the time of posting of this 312 Internet-Draft, and is based on a proposal described in RFC 7942 313 ([RFC7942]). The description of implementations in this section is 314 intended to assist the IETF in its decision processes in progressing 315 drafts to RFCs. Please note that the listing of any individual 316 implementation here does not imply endorsement by the IETF. 317 Furthermore, no effort has been spent to verify the information 318 presented here that was supplied by IETF contributors. This is not 319 intended as, and must not be construed to be, a catalog of available 320 implementations or their features. Readers are advised to note that 321 other implementations may exist. 323 According to RFC 7942, "this will allow reviewers and working groups 324 to assign due consideration to documents that have the benefit of 325 running code, which may serve as evidence of valuable experimentation 326 and feedback that have made the implemented protocols more mature. 327 It is up to the individual working groups to use this information as 328 they see fit". 330 6.1. IIT-CNR/Registro.it 332 Responsible Organization: Institute of Informatics and Telematics 333 of National Research Council (IIT-CNR)/Registro.it 334 Location: https://rdap.pubtest.nic.it/ 335 Description: This implementation includes support for RDAP queries 336 using data from .it public test environment. 337 Level of Maturity: This is an "alpha" test implementation. 338 Coverage: This implementation includes all of the features 339 described in this specification. 340 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 342 6.2. APNIC 344 Responsible Organization: Asia-Pacific Network Information Centre 345 Location: https://github.com/APNIC-net/rdap-rmp-demo/tree/partial- 346 response 347 Description: A proof-of-concept for RDAP mirroring. 348 Level of Maturity: This is a proof-of-concept implementation. 349 Coverage: This implementation includes all of the features 350 described in this specification. 351 Contact Information: Tom Harrison, tomh@apnic.net 353 7. IANA Considerations 355 IANA is requested to register the following value in the RDAP 356 Extensions Registry: 358 Extension identifier: subsetting 359 Registry operator: Any 360 Published specification: This document. 361 Contact: IESG 362 Intended usage: This extension describes a best practice for 363 partial response provisioning. 365 8. Security Considerations 367 The search query typically requires more server resources (such as 368 memory, CPU cycles, and network bandwidth) when compared to the 369 lookup query. This increases the risk of server resource exhaustion 370 and subsequent denial of service due to abuse. Partial response can 371 contribute together with other strategies (e.g. restricting search 372 functionality, limiting the rate of search requests, truncating and 373 paging results) to mitigate this risk. 375 Furthermore, partial response can support RDAP operators to implement 376 a versatile access control policy through the HTTP authentication 377 mechanisms as described in RFC 7481 ([RFC7481]). In fact, RDAP 378 operators can follow different, not alternative, approaches to the 379 building of responses according to the user access levels: 381 o the list of fields for each set can be different according to the 382 user access levels; 384 o some field sets could be available only to some users. 386 Servers can also define different results limits according to the 387 available field sets, so a more flexible truncation strategy can be 388 realized. 390 Therefore, the new query parameter presented in this document 391 provides the RDAP operators with a way to implement a secure server 392 without penalizing its efficiency. 394 9. Acknowledgements 396 The authors would like to acknowledge Scott Hollenbeck, Tom Harrison, 397 Karl Heinz Wolf, Jasdip Singh and Patrick Mevzek for their 398 contribution to this document. 400 10. References 402 10.1. Normative References 404 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 405 Requirement Levels", BCP 14, RFC 2119, 406 DOI 10.17487/RFC2119, March 1997, 407 . 409 [RFC5890] Klensin, J., "Internationalized Domain Names for 410 Applications (IDNA): Definitions and Document Framework", 411 RFC 5890, DOI 10.17487/RFC5890, August 2010, 412 . 414 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 415 Protocol (HTTP/1.1): Message Syntax and Routing", 416 RFC 7230, DOI 10.17487/RFC7230, June 2014, 417 . 419 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 420 Registration Data Access Protocol (RDAP)", RFC 7480, 421 DOI 10.17487/RFC7480, March 2015, 422 . 424 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 425 Registration Data Access Protocol (RDAP)", RFC 7481, 426 DOI 10.17487/RFC7481, March 2015, 427 . 429 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 430 Protocol (RDAP) Query Format", RFC 7482, 431 DOI 10.17487/RFC7482, March 2015, 432 . 434 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 435 Registration Data Access Protocol (RDAP)", RFC 7483, 436 DOI 10.17487/RFC7483, March 2015, 437 . 439 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 440 Code: The Implementation Status Section", BCP 205, 441 RFC 7942, DOI 10.17487/RFC7942, July 2016, 442 . 444 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 445 DOI 10.17487/RFC8288, October 2017, 446 . 448 10.2. Informative References 450 [CQL] Whitaker, G., "Catnap Query Language Reference", September 451 2017, . 454 [FACEBOOK] 455 facebook.com, "facebook for developers - Using the Graph 456 API", July 2017, . 459 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 460 Response and Partial Update", March 2010, 461 . 464 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 465 . 468 [LINKEDIN] 469 linkedin.com, "Java One 2009: Building Consistent RESTful 470 APIs in a High Performance Environment", July 2009, 471 . 475 [REST] Fielding, R., "Architectural Styles and the Design of 476 Network-based Software Architectures", 2000, 477 . 480 [REST-API1] 481 Jobinesh, P., "RESTful Java Web Services - Second 482 Edition", September 2015. 484 [REST-API2] 485 Masse, M., "REST API Design Rulebook", October 2011. 487 Appendix A. Approaches to Partial Response Implementation 489 Looking at the implementation experiences described in Section 1, two 490 approaches to the implementation of partial response can be detected: 492 o the client declares explicitly the data fields to get back; 494 o the client declares a name identifying a server pre-defined set of 495 data fields. 497 The former is more flexible than the latter because clients can 498 specify all the data fields they need. However, it has some 499 drawbacks: 501 o fields have to be declared according to a given syntax. This is a 502 simple task when the data structure of the object is flat, but it 503 is much more difficult when the object has a tree structure like 504 the one of a JSON object. The presence of arrays and deep nested 505 objects contributes to complicate both the syntax definition of 506 the query and, consequently, the processing phase on the server 507 side; 509 o clients should perfectly know the returned data structure to avoid 510 cases when the requested fields are invalid; 512 o the request of some fields might not match the user access levels. 513 Clients might put unauthorized fields in their requests and 514 servers should define a strategy for providing a response: 515 returning always an error response or returning a response that 516 ignores the unauthorized fields. 518 A.1. Specific Issues Raised by RDAP 520 In addition to those listed above, RDAP responses raise some specific 521 issues: 523 o most of the relevant information of the entity object is included 524 in the jCard but such information cannot be easily selected 525 because it is split into the items of a jagged array; 527 o RDAP responses contain some properties providing service 528 information (e.g. rdapConformance, links, notices, remarks, etc.) 529 which are not normally selected but they are just as important. 530 They could be returned anyway but, in this case, the server would 531 provide unrequested data. 533 As an example compliant to the first approach, the Catnap Query 534 Language ([CQL]) is a comprehensive expression language that can be 535 used to customize the JSON response of a RESTful web service. The 536 practical application of CQL to RDAP responses points out that 537 declaring explicitly the output fields would still be acceptable when 538 a few fields are requested but it would become very complicated if 539 the fields should be more. In the following, two CQL expressions for 540 a search domain query are shown (Figure 4): in the first, only 541 objectClassName and ldhName are requested, in the second, the fields 542 of a possible WHOIS-like response are listed. 544 https://example.com/rdap/domains?name=example*.com 545 &fields=domainSearchResults(objectClassName,ldhName) 547 https://example.com/rdap/domains?name=example*.com 548 &fields=domainSearchResults(objectClassName,ldhName, 549 unicodeName, 550 status, 551 events(eventAction,eventDate), 552 entities(objectClassName,handle,roles), 553 nameservers(objectClassName,ldhName)) 555 Figure 4: Examples of CQL expressions for a search domain query 557 The latter approach seems to facilitate RDAP interoperability. In 558 fact, servers can define some basic field sets which, if known to the 559 clients, can increase the probability to get a valid response. The 560 usage of field sets lets the query string be less complex. In 561 addition, the definition of pre-defined sets of fields makes easier 562 to establish the results limits. 564 Finally, considering that there is not a real need for RDAP users to 565 have the maximum flexibility in defining all the possible sets of 566 logically connected fields (e.g. users interested in domains usually 567 need to know the status, the creation date, the expiry date of each 568 domain), the latter approach is preferred. 570 Appendix B. Change Log 572 00: Initial working group version ported from draft-loffredo-regext- 573 rdap-partial-response-03 574 01: Removed "FOR DISCUSSION" items. Changed the basic field sets 575 from REQUIRED to OPTIONAL. Removed the definition of fields 576 included in "brief" field set. Provided a more detailed 577 description of "subsetting_metadata" structure. Removed some 578 references. 579 02: Added the "Negative Answers" section. Changed "IANA 580 Considerations" section. 581 03: Added the "unicodeName" field in the id fieldSet when a returned 582 domain or nameserver is an IDN. Added RFC5890 to "Normative 583 References" section. 584 04: Recommended the RDAP providers to include a "self" link in any 585 field set other than "full". Updated "Acknowledgements" section. 586 05: Moved "Approaches to Partial Response Implementation" section to 587 the appendix. 588 06: Clarified the use of self links in "Basic Field Sets" section. 589 Added APNIC to the implementations of the "Implementation Status" 590 section. 592 07: Changed "only a subset is returned" to "only a subset of fields 593 in each result object is returned" in the "Introduction" section. 594 Moved the "RDAP Conformance" section up in the document. Updated 595 the "Acknowledgements" section. 596 08: Changed the rdapConformance tag "subsetting_level_0" to 597 "subsetting". Moved [RFC7942] to the "Normative References". 598 09: Corrected the "rdapConformance" content in Figure 3. 599 10: Corrected the JSON content in Figure 2. Clarified the meaning 600 of both context and target URIs in a result subset link defined in 601 Section 2.1.2. Updated the "Acknowledgements" section. 603 Authors' Addresses 605 Mario Loffredo 606 IIT-CNR/Registro.it 607 Via Moruzzi,1 608 Pisa 56124 609 IT 611 Email: mario.loffredo@iit.cnr.it 612 URI: http://www.iit.cnr.it 614 Maurizio Martinelli 615 IIT-CNR/Registro.it 616 Via Moruzzi,1 617 Pisa 56124 618 IT 620 Email: maurizio.martinelli@iit.cnr.it 621 URI: http://www.iit.cnr.it