idnits 2.17.1 draft-ietf-regext-rdap-partial-response-02.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 (May 27, 2019) is 1789 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: November 28, 2019 May 27, 2019 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-ietf-regext-rdap-partial-response-02 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 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 November 28, 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. Negative Answers . . . . . . . . . . . . . . . . . . . . . . 8 63 7. RDAP Conformance . . . . . . . . . . . . . . . . . . . . . . 8 64 8. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 65 8.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 9 66 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 67 10. Security Considerations . . . . . . . . . . . . . . . . . . . 9 68 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 69 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 12.1. Normative References . . . . . . . . . . . . . . . . . . 10 71 12.2. Informative References . . . . . . . . . . . . . . . . . 11 72 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 12 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 75 1. Introduction 77 The use of partial response in RESTful API ([REST]) design is very 78 common. The rationale is quite simple: instead of returning objects 79 in API responses with all data fields, only a subset is returned. 80 The benefit is obvious: less data transferred over the network means 81 less bandwidth usage, faster server response, less CPU time spent 82 both on the server and the client, as well as less memory usage on 83 the client. 85 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 86 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 87 by providing an optional query parameter by which users require the 88 fields they wish to receive. Partial response is also considered a 89 leading principle by many best practices guidelines in REST APIs 90 implementation ([REST-API1], [REST-API2]) in order to improve 91 performance, save on bandwidth and possibly accelerate the overall 92 interaction. In other contexts, for example in digital libraries and 93 bibliographic catalogues, servers can provide responses according to 94 different element sets (i.e. "brief" to get back a short response and 95 "full" to get back the complete response) 96 Currently, RDAP does not provide a client with any way to request a 97 partial response: the server can only provide the client with the 98 full response ([RFC7483]). Furthermore, servers cannot define the 99 limits of the results according to partial responses and this causes 100 strong inefficiencies. 102 The protocol described in this specification extends RDAP search 103 capabilities to enable partial responses, by adding a new query 104 parameter and using a RESTful web service. The service is 105 implemented using the Hypertext Transfer Protocol (HTTP) ([RFC7230]) 106 and the conventions described in RFC 7480 ([RFC7480]). 108 1.1. Conventions Used in This Document 110 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 111 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 112 document are to be interpreted as described in RFC 2119 ([RFC2119]). 114 2. Approaches to Partial Response Implementation 116 Looking at the implementation experiences described above, two 117 approaches to the implementation of partial response can be detected: 119 o the client declares explicitly the data fields to get back; 121 o the client declares a name identifying a server pre-defined set of 122 data fields. 124 The former is more flexible than the latter, because clients can 125 specify all the data fields they need. However, it has some 126 drawbacks: 128 o fields have to be declared according to a given syntax. This is a 129 simple task when the data structure of the object is flat, but it 130 is much more difficult when the object has a tree structure like 131 the one of a JSON object. The presence of arrays and deep nested 132 objects contributes to complicate both the syntax definition of 133 the query and, consequently, the processing phase on the server 134 side; 136 o clients should perfectly know the returned data structure to avoid 137 cases when the requested fields are invalid; 139 o the request of some fields might not match the user access levels. 140 Clients might put unauthorized fields in their requests and 141 servers should define a strategy for providing a response: 142 returning always an error response or returning a response that 143 ignores the unauthorized fields. 145 In addition to those listed above, RDAP responses raise some specific 146 issues: 148 o most of the relevant information of the entity object is included 149 in the jCard but such information cannot be easily selected 150 because it is split into the items of a jagged array; 152 o RDAP responses contain some properties providing service 153 information (e.g. rdapConformance, links, notices, remarks, etc.) 154 which are not normally selected but they are just as important. 155 They could be returned anyway but, in this case, the server would 156 provide unrequested data. 158 As an example compliant to the first approach, the Catnap Query 159 Language ([CQL]) is a comprehensive expression language that can be 160 used to customize the JSON response of a RESTful web service. The 161 practical application of CQL to RDAP responses points out that 162 declaring explicitly the output fields would still be acceptable when 163 a few fields are requested but it would become very complicated if 164 the fields should be more. In the following, two CQL expressions for 165 a search domain query are shown (Figure 1): in the first, only 166 objectClassName and ldhName are requested, in the second, the fields 167 of a possible WHOIS-like response are listed. 169 https://example.com/rdap/domains?name=example*.com 170 &fields=domainSearchResults(objectClassName,ldhName) 172 https://example.com/rdap/domains?name=example*.com 173 &fields=domainSearchResults(objectClassName,ldhName,unicodeName, 174 status, 175 events(eventAction,eventDate), 176 entities(objectClassName,handle,roles), 177 nameservers(objectClassName,ldhName)) 179 Figure 1: Examples of CQL expressions for a search domain query 181 The latter approach seems to facilitate RDAP interoperability. In 182 fact, servers can define some basic field sets which, if known to the 183 clients, can increase the probability to get a valid response. The 184 usage of field sets lets the query string be less complex. In 185 addition, the definition of pre-defined sets of fields makes easier 186 to establish the results limits. 188 Finally, considering that there is not a real need for RDAP users to 189 have the maximum flexibility in defining all the possible sets of 190 logically connected fields (e.g. users interested in domains usually 191 need to know the status, the creation date, the expire date of each 192 domain), the latter approach is preferred. 194 3. RDAP Path Segment Specification 196 The path segment defined in this section is an OPTIONAL extension of 197 search path segments defined in RFC 7482 ([RFC7482]). This document 198 defines an RDAP query parameter, "fieldSet", whose value is a string 199 identifying a server pre-defined set of fields (Figure 2). 201 https://example.com/rdap/domains?name=example*.com&fieldSet=afieldset 203 Figure 2: Example of RDAP search query reporting the "fieldSet" 204 parameter 206 3.1. Subsetting Metadata 208 According to most advanced principles in REST design, collectively 209 known as HATEOAS (Hypermedia as the Engine of Application State) 210 ([HATEOAS]), a client entering a REST application through an initial 211 URI should use the server-provided links to dynamically discover 212 available actions and access the resources it needs. In this way, 213 the client is not requested to have prior knowledge of the service 214 and, consequently, to hard code the URIs of different resources. 215 This would allow the server to make URI changes as the API evolves 216 without breaking the clients. Definitively, a REST service should be 217 as self-descriptive as possible. 219 Therefore, servers implementing the query parameter described in this 220 specification SHOULD provide additional information in their 221 responses about the available field sets. Such information is 222 collected in a new data structure named "subsetting_metadata" 223 containing the following properties: 225 o "currentFieldSet": "String" (REQUIRED) either the value of 226 "fieldSet" parameter as specified in the query string or the field 227 set applied by default; 229 o "availableFieldSets": "AvailableFieldSet[]" (OPTIONAL) an array of 230 objects each one describing an alternate available field set. 231 Members are: 233 * "name": "String" (REQUIRED) the field set name; 234 * "default": "Boolean" (REQUIRED) whether the field set is 235 applied by default; 236 * "description": "String" (OPTIONAL) a human-readable description 237 of the field set; 239 * "links": "Link[]" (OPTIONAL) an array of links as described in 240 RFC 8288 ([RFC8288]) containing the query string that applies 241 the field set. 243 3.1.1. Representing Subsetting Links 245 An RDAP server MAY use the "links" array of the "subsetting_metadata" 246 element to provide ready-made references ([RFC8288]) to the available 247 field sets (Figure 3). Each link represents a reference to an 248 alternate view of the results. 250 { 251 "rdapConformance": [ 252 "rdap_level_0", 253 "subsetting_level_0" 254 ], 255 ... 256 "subsetting_metadata": { 257 "currentFieldSet": "afieldset", 258 "availableFieldSets": [ 259 { 260 "name": "anotherfieldset", 261 "description": "Contains some fields", 262 "default": false, 263 "links": [ 264 { 265 "value": "https://example.com/rdap/domains?name=*nr.com 266 &fieldSet=afieldset", 267 "rel": "alternate", 268 "href": "https://example.com/rdap/domains?name=*nr.com 269 &fieldSet=anotherfieldset", 270 "title": "Result Subset Link", 271 "type": "application/rdap+json" 272 }, 273 ... 274 ] 275 }, 276 "domainSearchResults": [ 277 ... 278 ] 279 } 281 Figure 3: Example of a "subsetting_metadata" instance 283 4. Dealing with Relationships 285 Some additional considerations can be made about how second level 286 objects could be represented within a field set. In fact, since the 287 topmost objects could be returned according to different field sets, 288 the same thing could go for their related objects. As a consequence, 289 the response could contain either no relationship or associated 290 objects which are in turn provided according to a field set. 292 5. Basic Field Sets 294 In order to improve interoperability between clients and servers, the 295 name, as well as the list of fields for each field set, should be 296 shared by most of RDAP providers. This section defines three basic 297 field sets which servers MAY implement to facilitate their 298 interaction with clients: 300 o "id": the server provides only the key field ("handle" for 301 entities, "ldhName" for domains and nameservers). This field set 302 could be used when the client wants to simply obtain a collection 303 of object identifiers (Figure 4); 305 o "brief": it contains the fields that can be included in a "short" 306 response. This field set could be used when the client is asking 307 for a subset of the full response which gives a basic knowledge of 308 each object; 310 o "full": it contains all the information the server can provide for 311 a particular object. 313 The "objectClassName" field is implicitly included in each of the 314 above field sets. RDAP providers MAY add any property providing 315 service information. 317 Fields included in "brief" and "full" field sets could be returned 318 according to users access levels. 320 { 321 "rdapConformance": [ 322 "rdap_level_0", 323 ], 324 ... 325 "domainSearchResults": [ 326 { 327 "objectClassName": "domain", 328 "ldhName": "example1.com" 329 }, 330 { 331 "objectClassName": "domain", 332 "ldhName": "example2.com" 333 }, 334 ... 335 ] 336 } 338 Figure 4: Example of RDAP response according to the "id" field set 340 6. Negative Answers 342 Each request including an unsupported field set SHOULD obtain an HTTP 343 400 (Bad Request) response code. 345 Optionally, the response MAY include additional information regarding 346 the negative answer in the HTTP entity body. 348 7. RDAP Conformance 350 Servers returning the "subsetting_metadata" section in their 351 responses MUST include "subsetting_level_0" in the rdapConformance 352 array. 354 8. Implementation Status 356 NOTE: Please remove this section and the reference to RFC 7942 prior 357 to publication as an RFC. 359 This section records the status of known implementations of the 360 protocol defined by this specification at the time of posting of this 361 Internet-Draft, and is based on a proposal described in RFC 7942 362 ([RFC7942]). The description of implementations in this section is 363 intended to assist the IETF in its decision processes in progressing 364 drafts to RFCs. Please note that the listing of any individual 365 implementation here does not imply endorsement by the IETF. 366 Furthermore, no effort has been spent to verify the information 367 presented here that was supplied by IETF contributors. This is not 368 intended as, and must not be construed to be, a catalog of available 369 implementations or their features. Readers are advised to note that 370 other implementations may exist. 372 According to RFC 7942, "this will allow reviewers and working groups 373 to assign due consideration to documents that have the benefit of 374 running code, which may serve as evidence of valuable experimentation 375 and feedback that have made the implemented protocols more mature. 376 It is up to the individual working groups to use this information as 377 they see fit". 379 8.1. IIT-CNR/Registro.it 381 Responsible Organization: Institute of Informatics and Telematics 382 of National Research Council (IIT-CNR)/Registro.it 383 Location: https://rdap.pubtest.nic.it/ 384 Description: This implementation includes support for RDAP queries 385 using data from .it public test environment. 386 Level of Maturity: This is a "proof of concept" research 387 implementation. 388 Coverage: This implementation includes all of the features 389 described in this specification. 390 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 392 9. IANA Considerations 394 IANA is requested to register the following value in the RDAP 395 Extensions Registry: 397 Extension identifier: subsetting 398 Registry operator: Any 399 Published specification: This document. 400 Contact: IESG 401 Intended usage: This extension describes a best practice for 402 partial response provisioning. 404 10. Security Considerations 406 Search query typically requires more server resources (such as 407 memory, CPU cycles, and network bandwidth) when compared to lookup 408 query. This increases the risk of server resource exhaustion and 409 subsequent denial of service due to abuse. Partial response can 410 contribute together with other strategies (e.g. restricting search 411 functionality, limiting the rate of search requests, truncating and 412 paging results) to mitigate this risk. 414 Furthermore, partial response can support RDAP operators to implement 415 a versatile access control policy through the HTTP authentication 416 mechanisms as described in RFC 7481 ([RFC7481]). In fact, RDAP 417 operators can follow different, not alternative, approaches to the 418 building of responses according to the user access levels: 420 o the list of fields for each set can be different according to the 421 user access levels; 423 o some field sets could be available only to some users. 425 Servers can also define different results limits according to the 426 available field sets, so a more flexible truncation strategy can be 427 realized. 429 Therefore, the new query parameter presented in this document 430 provides the RDAP operators with a way to implement a secure server 431 without penalizing its efficiency. 433 11. Acknowledgements 435 The authors would like to acknowledge Scott Hollenbeck for his 436 contribution to this document. 438 12. References 440 12.1. Normative References 442 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 443 Requirement Levels", BCP 14, RFC 2119, 444 DOI 10.17487/RFC2119, March 1997, 445 . 447 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 448 Protocol (HTTP/1.1): Message Syntax and Routing", 449 RFC 7230, DOI 10.17487/RFC7230, June 2014, 450 . 452 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 453 Registration Data Access Protocol (RDAP)", RFC 7480, 454 DOI 10.17487/RFC7480, March 2015, 455 . 457 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 458 Registration Data Access Protocol (RDAP)", RFC 7481, 459 DOI 10.17487/RFC7481, March 2015, 460 . 462 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 463 Protocol (RDAP) Query Format", RFC 7482, 464 DOI 10.17487/RFC7482, March 2015, 465 . 467 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 468 Registration Data Access Protocol (RDAP)", RFC 7483, 469 DOI 10.17487/RFC7483, March 2015, 470 . 472 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 473 DOI 10.17487/RFC8288, October 2017, 474 . 476 12.2. Informative References 478 [CQL] Whitaker, G., "Catnap Query Language Reference", September 479 2017, . 482 [FACEBOOK] 483 facebook.com, "facebook for developers - Using the Graph 484 API", July 2017, . 487 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 488 Response and Partial Update", March 2010, 489 . 492 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 493 . 496 [LINKEDIN] 497 linkedin.com, "Java One 2009: Building Consistent RESTful 498 APIs in a High Performance Environment", July 2009, 499 . 503 [REST] Fielding, R., "Architectural Styles and the Design of 504 Network-based Software Architectures", 2000, 505 . 508 [REST-API1] 509 Jobinesh, P., "RESTful Java Web Services - Second 510 Edition", September 2015. 512 [REST-API2] 513 Masse, M., "REST API Design Rulebook", October 2011. 515 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 516 Code: The Implementation Status Section", BCP 205, 517 RFC 7942, DOI 10.17487/RFC7942, July 2016, 518 . 520 Appendix A. Change Log 522 00: Initial working group version ported from draft-loffredo-regext- 523 rdap-partial-response-03 524 01: Removed "FOR DISCUSSION" items. Changed the basic field sets 525 from REQUIRED to OPTIONAL. Removed the definition of fields 526 included in "brief" field set. Provided a more detailed 527 description of "subsetting_metadata" structure. Removed some 528 references. 529 02: Added the "Negative Answers" section. Changed "IANA 530 Considerations" section. 532 Authors' Addresses 534 Mario Loffredo 535 IIT-CNR/Registro.it 536 Via Moruzzi,1 537 Pisa 56124 538 IT 540 Email: mario.loffredo@iit.cnr.it 541 URI: http://www.iit.cnr.it 543 Maurizio Martinelli 544 IIT-CNR/Registro.it 545 Via Moruzzi,1 546 Pisa 56124 547 IT 549 Email: maurizio.martinelli@iit.cnr.it 550 URI: http://www.iit.cnr.it