idnits 2.17.1 draft-ietf-regext-rdap-partial-response-05.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 (February 11, 2020) is 1536 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: August 14, 2020 February 11, 2020 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-ietf-regext-rdap-partial-response-05 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 August 14, 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. Representing Subsetting Links . . . . . . . . . . . . 4 59 3. Dealing with Relationships . . . . . . . . . . . . . . . . . 5 60 4. Basic Field Sets . . . . . . . . . . . . . . . . . . . . . . 5 61 5. Negative Answers . . . . . . . . . . . . . . . . . . . . . . 7 62 6. RDAP Conformance . . . . . . . . . . . . . . . . . . . . . . 8 63 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 64 7.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 8 65 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 66 9. Security Considerations . . . . . . . . . . . . . . . . . . . 9 67 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 68 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 69 11.1. Normative References . . . . . . . . . . . . . . . . . . 9 70 11.2. Informative References . . . . . . . . . . . . . . . . . 10 71 Appendix A. Approaches to Partial Response Implementation . . . 11 72 A.1. Specific Issues Raised by RDAP . . . . . . . . . . . . . 12 73 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 13 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 76 1. Introduction 78 The use of partial response in RESTful API ([REST]) design is very 79 common. The rationale is quite simple: instead of returning objects 80 in API responses with all data fields, only a subset is returned. 81 The benefit is obvious: less data transferred over the network means 82 less bandwidth usage, faster server response, less CPU time spent 83 both on the server and the client, as well as less memory usage on 84 the client. 86 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 87 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 88 by providing an optional query parameter by which users require the 89 fields they wish to receive. Partial response is also considered a 90 leading principle by many best practices guidelines in REST APIs 91 implementation ([REST-API1], [REST-API2]) in order to improve 92 performance, save on bandwidth and possibly accelerate the overall 93 interaction. In other contexts, for example in digital libraries and 94 bibliographic catalogues, servers can provide responses according to 95 different element sets (i.e. "brief" to get back a short response and 96 "full" to get back the complete response) 97 Currently, RDAP does not provide a client with any way to request a 98 partial response: the server can only provide the client with the 99 full response ([RFC7483]). Furthermore, servers cannot define the 100 limits of the results according to partial responses and this causes 101 strong inefficiencies. 103 The protocol described in this specification extends RDAP search 104 capabilities to enable partial responses through the provisioning of 105 pre-defined sets of fields the user can request to an RDAP service by 106 adding a new query parameter. The service is implemented using the 107 Hypertext Transfer Protocol (HTTP) ([RFC7230]) and the conventions 108 described in RFC 7480 ([RFC7480]). 110 1.1. Conventions Used in This Document 112 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 113 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 114 document are to be interpreted as described in RFC 2119 ([RFC2119]). 116 2. RDAP Path Segment Specification 118 The path segment defined in this section is an OPTIONAL extension of 119 search path segments defined in RFC 7482 ([RFC7482]). This document 120 defines an RDAP query parameter, "fieldSet", whose value is a string 121 identifying a server pre-defined set of fields (Figure 1). 123 This solution can be implemented by the RDAP providers with less 124 effort than fields selection and easily requested by consumers. The 125 considerations that has led to opt for this solution are reported in 126 more detail in Appendix A. 128 https://example.com/rdap/domains?name=example*.com&fieldSet=afieldset 130 Figure 1: Example of RDAP search query reporting the "fieldSet" 131 parameter 133 2.1. Subsetting Metadata 135 According to most advanced principles in REST design, collectively 136 known as HATEOAS (Hypermedia as the Engine of Application State) 137 ([HATEOAS]), a client entering a REST application through an initial 138 URI should use the server-provided links to dynamically discover 139 available actions and access the resources it needs. In this way, 140 the client is not requested to have prior knowledge of the service 141 and, consequently, to hard code the URIs of different resources. 142 This would allow the server to make URI changes as the API evolves 143 without breaking the clients. Definitively, a REST service should be 144 as self-descriptive as possible. 146 Therefore, servers implementing the query parameter described in this 147 specification SHOULD provide additional information in their 148 responses about the available field sets. Such information is 149 collected in a new data structure named "subsetting_metadata" 150 containing the following properties: 152 o "currentFieldSet": "String" (REQUIRED) either the value of 153 "fieldSet" parameter as specified in the query string or the field 154 set applied by default; 156 o "availableFieldSets": "AvailableFieldSet[]" (OPTIONAL) an array of 157 objects each one describing an alternate available field set. 158 Members are: 160 * "name": "String" (REQUIRED) the field set name; 161 * "default": "Boolean" (REQUIRED) whether the field set is 162 applied by default; 163 * "description": "String" (OPTIONAL) a human-readable description 164 of the field set; 165 * "links": "Link[]" (OPTIONAL) an array of links as described in 166 RFC 8288 ([RFC8288]) containing the query string that applies 167 the field set. 169 2.1.1. Representing Subsetting Links 171 An RDAP server MAY use the "links" array of the "subsetting_metadata" 172 element to provide ready-made references ([RFC8288]) to the available 173 field sets (Figure 2). Each link represents a reference to an 174 alternate view of the results. 176 { 177 "rdapConformance": [ 178 "rdap_level_0", 179 "subsetting_level_0" 180 ], 181 ... 182 "subsetting_metadata": { 183 "currentFieldSet": "afieldset", 184 "availableFieldSets": [ 185 { 186 "name": "anotherfieldset", 187 "description": "Contains some fields", 188 "default": false, 189 "links": [ 190 { 191 "value": "https://example.com/rdap/domains?name=*nr.com 192 &fieldSet=afieldset", 193 "rel": "alternate", 194 "href": "https://example.com/rdap/domains?name=*nr.com 195 &fieldSet=anotherfieldset", 196 "title": "Result Subset Link", 197 "type": "application/rdap+json" 198 }, 199 ... 200 ] 201 }, 202 "domainSearchResults": [ 203 ... 204 ] 205 } 207 Figure 2: Example of a "subsetting_metadata" instance 209 3. Dealing with Relationships 211 Some additional considerations can be made about how second level 212 objects could be represented within a field set. In fact, since the 213 topmost objects could be returned according to different field sets, 214 the same thing could go for their related objects. As a consequence, 215 the response could contain either no relationship or associated 216 objects which are in turn provided according to a field set. 218 4. Basic Field Sets 220 In order to improve interoperability between clients and servers, the 221 name, as well as the list of fields for each field set, should be 222 shared by most of RDAP providers. This section defines three basic 223 field sets which servers MAY implement to facilitate their 224 interaction with clients: 226 o "id": the server provides only the key field, respectively: 227 "handle" for entities, "ldhName" for domains and nameservers. If 228 a returned domain or nameserver is an IDN ([RFC5890]), then the 229 "unicodeName" field MUST be included in the response. This field 230 set could be used when the client wants to simply obtain a 231 collection of object identifiers (Figure 3); 233 o "brief": it contains the fields that can be included in a "short" 234 response. This field set could be used when the client is asking 235 for a subset of the full response which gives a basic knowledge of 236 each object; 238 o "full": it contains all the information the server can provide for 239 a particular object. 241 The "objectClassName" field is implicitly included in each of the 242 above field sets. RDAP providers are RECOMMENDED to include a "self" 243 link in each field set other than "full" in order to allow clients to 244 easily request for the full objects. RDAP providers MAY also add any 245 property providing service information. 247 Fields included in "brief" and "full" field sets could be returned 248 according to the user access levels. 250 { 251 "rdapConformance": [ 252 "rdap_level_0", 253 ], 254 ... 255 "domainSearchResults": [ 256 { 257 "objectClassName": "domain", 258 "ldhName": "example1.com", 259 "links": [ 260 { 261 "value": "https://example.com/rdap/domain/example1.com", 262 "rel": "self", 263 "href": "https://example.com/rdap/domain/example1.com", 264 "type": "application/rdap+json" 265 } 266 ], 267 }, 268 { 269 "objectClassName": "domain", 270 "ldhName": "example2.com", 271 "links": [ 272 { 273 "value": "https://example.com/rdap/domain/example2.com", 274 "rel": "self", 275 "href": "https://example.com/rdap/domain/example2.com", 276 "type": "application/rdap+json" 277 } 278 ], 279 }, 280 ... 281 ] 282 } 284 Figure 3: Example of RDAP response according to the "id" field set 286 5. Negative Answers 288 Each request including an unsupported field set SHOULD obtain an HTTP 289 400 (Bad Request) response code. 291 Optionally, the response MAY include additional information regarding 292 the negative answer in the HTTP entity body. 294 6. RDAP Conformance 296 Servers returning the "subsetting_metadata" section in their 297 responses MUST include "subsetting_level_0" in the rdapConformance 298 array. 300 7. 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 7.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 8. IANA Considerations 339 IANA is requested to register the following value in the RDAP 340 Extensions Registry: 342 Extension identifier: subsetting 343 Registry operator: Any 344 Published specification: This document. 345 Contact: IESG 346 Intended usage: This extension describes a best practice for 347 partial response provisioning. 349 9. Security Considerations 351 The search query typically requires more server resources (such as 352 memory, CPU cycles, and network bandwidth) when compared to the 353 lookup query. This increases the risk of server resource exhaustion 354 and subsequent denial of service due to abuse. Partial response can 355 contribute together with other strategies (e.g. restricting search 356 functionality, limiting the rate of search requests, truncating and 357 paging results) to mitigate this risk. 359 Furthermore, partial response can support RDAP operators to implement 360 a versatile access control policy through the HTTP authentication 361 mechanisms as described in RFC 7481 ([RFC7481]). In fact, RDAP 362 operators can follow different, not alternative, approaches to the 363 building of responses according to the user access levels: 365 o the list of fields for each set can be different according to the 366 user access levels; 368 o some field sets could be available only to some users. 370 Servers can also define different results limits according to the 371 available field sets, so a more flexible truncation strategy can be 372 realized. 374 Therefore, the new query parameter presented in this document 375 provides the RDAP operators with a way to implement a secure server 376 without penalizing its efficiency. 378 10. Acknowledgements 380 The authors would like to acknowledge Scott Hollenbeck, Tom Harrison 381 and Karl Heinz Wolf for their contribution to this document. 383 11. References 385 11.1. Normative References 387 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 388 Requirement Levels", BCP 14, RFC 2119, 389 DOI 10.17487/RFC2119, March 1997, 390 . 392 [RFC5890] Klensin, J., "Internationalized Domain Names for 393 Applications (IDNA): Definitions and Document Framework", 394 RFC 5890, DOI 10.17487/RFC5890, August 2010, 395 . 397 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 398 Protocol (HTTP/1.1): Message Syntax and Routing", 399 RFC 7230, DOI 10.17487/RFC7230, June 2014, 400 . 402 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 403 Registration Data Access Protocol (RDAP)", RFC 7480, 404 DOI 10.17487/RFC7480, March 2015, 405 . 407 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 408 Registration Data Access Protocol (RDAP)", RFC 7481, 409 DOI 10.17487/RFC7481, March 2015, 410 . 412 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 413 Protocol (RDAP) Query Format", RFC 7482, 414 DOI 10.17487/RFC7482, March 2015, 415 . 417 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 418 Registration Data Access Protocol (RDAP)", RFC 7483, 419 DOI 10.17487/RFC7483, March 2015, 420 . 422 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 423 DOI 10.17487/RFC8288, October 2017, 424 . 426 11.2. Informative References 428 [CQL] Whitaker, G., "Catnap Query Language Reference", September 429 2017, . 432 [FACEBOOK] 433 facebook.com, "facebook for developers - Using the Graph 434 API", July 2017, . 437 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 438 Response and Partial Update", March 2010, 439 . 442 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 443 . 446 [LINKEDIN] 447 linkedin.com, "Java One 2009: Building Consistent RESTful 448 APIs in a High Performance Environment", July 2009, 449 . 453 [REST] Fielding, R., "Architectural Styles and the Design of 454 Network-based Software Architectures", 2000, 455 . 458 [REST-API1] 459 Jobinesh, P., "RESTful Java Web Services - Second 460 Edition", September 2015. 462 [REST-API2] 463 Masse, M., "REST API Design Rulebook", October 2011. 465 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 466 Code: The Implementation Status Section", BCP 205, 467 RFC 7942, DOI 10.17487/RFC7942, July 2016, 468 . 470 Appendix A. Approaches to Partial Response Implementation 472 Looking at the implementation experiences described in Section 1, two 473 approaches to the implementation of partial response can be detected: 475 o the client declares explicitly the data fields to get back; 477 o the client declares a name identifying a server pre-defined set of 478 data fields. 480 The former is more flexible than the latter because clients can 481 specify all the data fields they need. However, it has some 482 drawbacks: 484 o fields have to be declared according to a given syntax. This is a 485 simple task when the data structure of the object is flat, but it 486 is much more difficult when the object has a tree structure like 487 the one of a JSON object. The presence of arrays and deep nested 488 objects contributes to complicate both the syntax definition of 489 the query and, consequently, the processing phase on the server 490 side; 492 o clients should perfectly know the returned data structure to avoid 493 cases when the requested fields are invalid; 495 o the request of some fields might not match the user access levels. 496 Clients might put unauthorized fields in their requests and 497 servers should define a strategy for providing a response: 498 returning always an error response or returning a response that 499 ignores the unauthorized fields. 501 A.1. Specific Issues Raised by RDAP 503 In addition to those listed above, RDAP responses raise some specific 504 issues: 506 o most of the relevant information of the entity object is included 507 in the jCard but such information cannot be easily selected 508 because it is split into the items of a jagged array; 510 o RDAP responses contain some properties providing service 511 information (e.g. rdapConformance, links, notices, remarks, etc.) 512 which are not normally selected but they are just as important. 513 They could be returned anyway but, in this case, the server would 514 provide unrequested data. 516 As an example compliant to the first approach, the Catnap Query 517 Language ([CQL]) is a comprehensive expression language that can be 518 used to customize the JSON response of a RESTful web service. The 519 practical application of CQL to RDAP responses points out that 520 declaring explicitly the output fields would still be acceptable when 521 a few fields are requested but it would become very complicated if 522 the fields should be more. In the following, two CQL expressions for 523 a search domain query are shown (Figure 4): in the first, only 524 objectClassName and ldhName are requested, in the second, the fields 525 of a possible WHOIS-like response are listed. 527 https://example.com/rdap/domains?name=example*.com 528 &fields=domainSearchResults(objectClassName,ldhName) 530 https://example.com/rdap/domains?name=example*.com 531 &fields=domainSearchResults(objectClassName,ldhName,unicodeName, 532 status, 533 events(eventAction,eventDate), 534 entities(objectClassName,handle,roles), 535 nameservers(objectClassName,ldhName)) 537 Figure 4: Examples of CQL expressions for a search domain query 539 The latter approach seems to facilitate RDAP interoperability. In 540 fact, servers can define some basic field sets which, if known to the 541 clients, can increase the probability to get a valid response. The 542 usage of field sets lets the query string be less complex. In 543 addition, the definition of pre-defined sets of fields makes easier 544 to establish the results limits. 546 Finally, considering that there is not a real need for RDAP users to 547 have the maximum flexibility in defining all the possible sets of 548 logically connected fields (e.g. users interested in domains usually 549 need to know the status, the creation date, the expiry date of each 550 domain), the latter approach is preferred. 552 Appendix B. Change Log 554 00: Initial working group version ported from draft-loffredo-regext- 555 rdap-partial-response-03 556 01: Removed "FOR DISCUSSION" items. Changed the basic field sets 557 from REQUIRED to OPTIONAL. Removed the definition of fields 558 included in "brief" field set. Provided a more detailed 559 description of "subsetting_metadata" structure. Removed some 560 references. 561 02: Added the "Negative Answers" section. Changed "IANA 562 Considerations" section. 563 03: Added the "unicodeName" field in the id fieldSet when a returned 564 domain or nameserver is an IDN. Added RFC5890 to "Normative 565 References" section. 566 04: Recommended the RDAP providers to include a "self" link in any 567 field set other than "full". Updated "Acknowledgements" section. 568 05: Moved "Approaches to Partial Response Implementation" section to 569 the appendix. 571 Authors' Addresses 573 Mario Loffredo 574 IIT-CNR/Registro.it 575 Via Moruzzi,1 576 Pisa 56124 577 IT 579 Email: mario.loffredo@iit.cnr.it 580 URI: http://www.iit.cnr.it 582 Maurizio Martinelli 583 IIT-CNR/Registro.it 584 Via Moruzzi,1 585 Pisa 56124 586 IT 588 Email: maurizio.martinelli@iit.cnr.it 589 URI: http://www.iit.cnr.it