idnits 2.17.1 draft-ietf-regext-rdap-partial-response-08.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 14, 2020) is 1466 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 16, 2020 April 14, 2020 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-ietf-regext-rdap-partial-response-08 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 16, 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 . . . . . . . . . . . . . . . . . . . . . . 5 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). Each link represents a reference to an 181 alternate view of the results. 183 { 184 "rdapConformance": [ 185 "rdap_level_0", 186 "subsetting" 187 ], 188 ... 189 "subsetting_metadata": { 190 "currentFieldSet": "afieldset", 191 "availableFieldSets": [ 192 { 193 "name": "anotherfieldset", 194 "description": "Contains some fields", 195 "default": false, 196 "links": [ 197 { 198 "value": "https://example.com/rdap/domains?name=*nr.com 199 &fieldSet=afieldset", 200 "rel": "alternate", 201 "href": "https://example.com/rdap/domains?name=*nr.com 202 &fieldSet=anotherfieldset", 203 "title": "Result Subset Link", 204 "type": "application/rdap+json" 205 }, 206 ... 207 ] 208 }, 209 "domainSearchResults": [ 210 ... 211 ] 212 } 214 Figure 2: Example of a "subsetting_metadata" instance 216 3. Dealing with Relationships 218 Some additional considerations can be made about how second level 219 objects could be represented within a field set. In fact, since the 220 topmost objects could be returned according to different field sets, 221 the same thing could go for their related objects. As a consequence, 222 the response could contain either no relationship or associated 223 objects which are in turn provided according to a field set. 225 4. Basic Field Sets 227 In order to improve interoperability between clients and servers, the 228 name, as well as the list of fields for each field set, should be 229 shared by most of RDAP providers. This section defines three basic 230 field sets which servers MAY implement to facilitate their 231 interaction with clients: 233 o "id": the server provides only the key field, respectively: 234 "handle" for entities, "ldhName" for domains and nameservers. If 235 a returned domain or nameserver is an IDN ([RFC5890]), then the 236 "unicodeName" field MUST be included in the response. This field 237 set could be used when the client wants to simply obtain a 238 collection of object identifiers (Figure 3); 240 o "brief": it contains the fields that can be included in a "short" 241 response. This field set could be used when the client is asking 242 for a subset of the full response which gives a basic knowledge of 243 each object; 245 o "full": it contains all the information the server can provide for 246 a particular object. 248 The "objectClassName" field is implicitly included in each of the 249 above field sets. RDAP providers are RECOMMENDED to include a "self" 250 link in each field set. RDAP providers MAY also add any property 251 providing service information. 253 Fields included in "brief" and "full" field sets could be returned 254 according to the user access levels. 256 { 257 "rdapConformance": [ 258 "rdap_level_0", 259 ], 260 ... 261 "domainSearchResults": [ 262 { 263 "objectClassName": "domain", 264 "ldhName": "example1.com", 265 "links": [ 266 { 267 "value": "https://example.com/rdap/domain/example1.com", 268 "rel": "self", 269 "href": "https://example.com/rdap/domain/example1.com", 270 "type": "application/rdap+json" 271 } 272 ], 273 }, 274 { 275 "objectClassName": "domain", 276 "ldhName": "example2.com", 277 "links": [ 278 { 279 "value": "https://example.com/rdap/domain/example2.com", 280 "rel": "self", 281 "href": "https://example.com/rdap/domain/example2.com", 282 "type": "application/rdap+json" 283 } 284 ], 285 }, 286 ... 287 ] 288 } 290 Figure 3: Example of RDAP response according to the "id" field set 292 5. Negative Answers 294 Each request including an unsupported field set SHOULD obtain an HTTP 295 400 (Bad Request) response code. 297 Optionally, the response MAY include additional information regarding 298 the negative answer in the HTTP entity body. 300 6. Implementation Status 302 NOTE: Please remove this section and the reference to RFC 7942 prior 303 to publication as an RFC. 305 This section records the status of known implementations of the 306 protocol defined by this specification at the time of posting of this 307 Internet-Draft, and is based on a proposal described in RFC 7942 308 ([RFC7942]). The description of implementations in this section is 309 intended to assist the IETF in its decision processes in progressing 310 drafts to RFCs. Please note that the listing of any individual 311 implementation here does not imply endorsement by the IETF. 312 Furthermore, no effort has been spent to verify the information 313 presented here that was supplied by IETF contributors. This is not 314 intended as, and must not be construed to be, a catalog of available 315 implementations or their features. Readers are advised to note that 316 other implementations may exist. 318 According to RFC 7942, "this will allow reviewers and working groups 319 to assign due consideration to documents that have the benefit of 320 running code, which may serve as evidence of valuable experimentation 321 and feedback that have made the implemented protocols more mature. 322 It is up to the individual working groups to use this information as 323 they see fit". 325 6.1. IIT-CNR/Registro.it 327 Responsible Organization: Institute of Informatics and Telematics 328 of National Research Council (IIT-CNR)/Registro.it 329 Location: https://rdap.pubtest.nic.it/ 330 Description: This implementation includes support for RDAP queries 331 using data from .it public test environment. 332 Level of Maturity: This is an "alpha" test implementation. 333 Coverage: This implementation includes all of the features 334 described in this specification. 335 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 337 6.2. APNIC 339 Responsible Organization: Asia-Pacific Network Information Centre 340 Location: https://github.com/APNIC-net/rdap-rmp-demo/tree/partial- 341 response 342 Description: A proof-of-concept for RDAP mirroring. 343 Level of Maturity: This is a proof-of-concept implementation. 344 Coverage: This implementation includes all of the features 345 described in this specification. 346 Contact Information: Tom Harrison, tomh@apnic.net 348 7. IANA Considerations 350 IANA is requested to register the following value in the RDAP 351 Extensions Registry: 353 Extension identifier: subsetting 354 Registry operator: Any 355 Published specification: This document. 356 Contact: IESG 357 Intended usage: This extension describes a best practice for 358 partial response provisioning. 360 8. Security Considerations 362 The search query typically requires more server resources (such as 363 memory, CPU cycles, and network bandwidth) when compared to the 364 lookup query. This increases the risk of server resource exhaustion 365 and subsequent denial of service due to abuse. Partial response can 366 contribute together with other strategies (e.g. restricting search 367 functionality, limiting the rate of search requests, truncating and 368 paging results) to mitigate this risk. 370 Furthermore, partial response can support RDAP operators to implement 371 a versatile access control policy through the HTTP authentication 372 mechanisms as described in RFC 7481 ([RFC7481]). In fact, RDAP 373 operators can follow different, not alternative, approaches to the 374 building of responses according to the user access levels: 376 o the list of fields for each set can be different according to the 377 user access levels; 379 o some field sets could be available only to some users. 381 Servers can also define different results limits according to the 382 available field sets, so a more flexible truncation strategy can be 383 realized. 385 Therefore, the new query parameter presented in this document 386 provides the RDAP operators with a way to implement a secure server 387 without penalizing its efficiency. 389 9. Acknowledgements 391 The authors would like to acknowledge Scott Hollenbeck, Tom Harrison, 392 Karl Heinz Wolf and Jasdip Singh for their contribution to this 393 document. 395 10. References 397 10.1. Normative References 399 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 400 Requirement Levels", BCP 14, RFC 2119, 401 DOI 10.17487/RFC2119, March 1997, 402 . 404 [RFC5890] Klensin, J., "Internationalized Domain Names for 405 Applications (IDNA): Definitions and Document Framework", 406 RFC 5890, DOI 10.17487/RFC5890, August 2010, 407 . 409 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 410 Protocol (HTTP/1.1): Message Syntax and Routing", 411 RFC 7230, DOI 10.17487/RFC7230, June 2014, 412 . 414 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 415 Registration Data Access Protocol (RDAP)", RFC 7480, 416 DOI 10.17487/RFC7480, March 2015, 417 . 419 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 420 Registration Data Access Protocol (RDAP)", RFC 7481, 421 DOI 10.17487/RFC7481, March 2015, 422 . 424 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 425 Protocol (RDAP) Query Format", RFC 7482, 426 DOI 10.17487/RFC7482, March 2015, 427 . 429 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 430 Registration Data Access Protocol (RDAP)", RFC 7483, 431 DOI 10.17487/RFC7483, March 2015, 432 . 434 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 435 Code: The Implementation Status Section", BCP 205, 436 RFC 7942, DOI 10.17487/RFC7942, July 2016, 437 . 439 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 440 DOI 10.17487/RFC8288, October 2017, 441 . 443 10.2. Informative References 445 [CQL] Whitaker, G., "Catnap Query Language Reference", September 446 2017, . 449 [FACEBOOK] 450 facebook.com, "facebook for developers - Using the Graph 451 API", July 2017, . 454 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 455 Response and Partial Update", March 2010, 456 . 459 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 460 . 463 [LINKEDIN] 464 linkedin.com, "Java One 2009: Building Consistent RESTful 465 APIs in a High Performance Environment", July 2009, 466 . 470 [REST] Fielding, R., "Architectural Styles and the Design of 471 Network-based Software Architectures", 2000, 472 . 475 [REST-API1] 476 Jobinesh, P., "RESTful Java Web Services - Second 477 Edition", September 2015. 479 [REST-API2] 480 Masse, M., "REST API Design Rulebook", October 2011. 482 Appendix A. Approaches to Partial Response Implementation 484 Looking at the implementation experiences described in Section 1, two 485 approaches to the implementation of partial response can be detected: 487 o the client declares explicitly the data fields to get back; 489 o the client declares a name identifying a server pre-defined set of 490 data fields. 492 The former is more flexible than the latter because clients can 493 specify all the data fields they need. However, it has some 494 drawbacks: 496 o fields have to be declared according to a given syntax. This is a 497 simple task when the data structure of the object is flat, but it 498 is much more difficult when the object has a tree structure like 499 the one of a JSON object. The presence of arrays and deep nested 500 objects contributes to complicate both the syntax definition of 501 the query and, consequently, the processing phase on the server 502 side; 504 o clients should perfectly know the returned data structure to avoid 505 cases when the requested fields are invalid; 507 o the request of some fields might not match the user access levels. 508 Clients might put unauthorized fields in their requests and 509 servers should define a strategy for providing a response: 510 returning always an error response or returning a response that 511 ignores the unauthorized fields. 513 A.1. Specific Issues Raised by RDAP 515 In addition to those listed above, RDAP responses raise some specific 516 issues: 518 o most of the relevant information of the entity object is included 519 in the jCard but such information cannot be easily selected 520 because it is split into the items of a jagged array; 522 o RDAP responses contain some properties providing service 523 information (e.g. rdapConformance, links, notices, remarks, etc.) 524 which are not normally selected but they are just as important. 525 They could be returned anyway but, in this case, the server would 526 provide unrequested data. 528 As an example compliant to the first approach, the Catnap Query 529 Language ([CQL]) is a comprehensive expression language that can be 530 used to customize the JSON response of a RESTful web service. The 531 practical application of CQL to RDAP responses points out that 532 declaring explicitly the output fields would still be acceptable when 533 a few fields are requested but it would become very complicated if 534 the fields should be more. In the following, two CQL expressions for 535 a search domain query are shown (Figure 4): in the first, only 536 objectClassName and ldhName are requested, in the second, the fields 537 of a possible WHOIS-like response are listed. 539 https://example.com/rdap/domains?name=example*.com 540 &fields=domainSearchResults(objectClassName,ldhName) 542 https://example.com/rdap/domains?name=example*.com 543 &fields=domainSearchResults(objectClassName,ldhName,unicodeName, 544 status, 545 events(eventAction,eventDate), 546 entities(objectClassName,handle,roles), 547 nameservers(objectClassName,ldhName)) 549 Figure 4: Examples of CQL expressions for a search domain query 551 The latter approach seems to facilitate RDAP interoperability. In 552 fact, servers can define some basic field sets which, if known to the 553 clients, can increase the probability to get a valid response. The 554 usage of field sets lets the query string be less complex. In 555 addition, the definition of pre-defined sets of fields makes easier 556 to establish the results limits. 558 Finally, considering that there is not a real need for RDAP users to 559 have the maximum flexibility in defining all the possible sets of 560 logically connected fields (e.g. users interested in domains usually 561 need to know the status, the creation date, the expiry date of each 562 domain), the latter approach is preferred. 564 Appendix B. Change Log 566 00: Initial working group version ported from draft-loffredo-regext- 567 rdap-partial-response-03 568 01: Removed "FOR DISCUSSION" items. Changed the basic field sets 569 from REQUIRED to OPTIONAL. Removed the definition of fields 570 included in "brief" field set. Provided a more detailed 571 description of "subsetting_metadata" structure. Removed some 572 references. 573 02: Added the "Negative Answers" section. Changed "IANA 574 Considerations" section. 575 03: Added the "unicodeName" field in the id fieldSet when a returned 576 domain or nameserver is an IDN. Added RFC5890 to "Normative 577 References" section. 578 04: Recommended the RDAP providers to include a "self" link in any 579 field set other than "full". Updated "Acknowledgements" section. 580 05: Moved "Approaches to Partial Response Implementation" section to 581 the appendix. 582 06: Clarified the use of self links in "Basic Field Sets" section. 583 Added APNIC to the implementations of the "Implementation Status" 584 section. 585 07: Changed "only a subset is returned" to "only a subset of fields 586 in each result object is returned" in the "Introduction" section. 588 Moved the "RDAP Conformance" section up in the document. Updated 589 the "Acknowledgements" section. 590 08: Changed the rdapConformance tag "subsetting_level_0" to 591 "subsetting". Moved [RFC7942] to the "Normative References". 593 Authors' Addresses 595 Mario Loffredo 596 IIT-CNR/Registro.it 597 Via Moruzzi,1 598 Pisa 56124 599 IT 601 Email: mario.loffredo@iit.cnr.it 602 URI: http://www.iit.cnr.it 604 Maurizio Martinelli 605 IIT-CNR/Registro.it 606 Via Moruzzi,1 607 Pisa 56124 608 IT 610 Email: maurizio.martinelli@iit.cnr.it 611 URI: http://www.iit.cnr.it