idnits 2.17.1 draft-loffredo-regext-rdap-partial-response-03.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 1, 2019) is 1910 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) ** Downref: Normative reference to an Informational RFC: RFC 7485 Summary: 4 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 5, 2019 February 1, 2019 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-loffredo-regext-rdap-partial-response-03 10 Abstract 12 The Registration Data Access Protocol (RDAP) does not include 13 capabilities to request partial responses. In fact, according to the 14 user authorization, the server can only return full responses. 15 Partial responses capability, especially in the case of search 16 queries, could bring benefits to both clients and servers. This 17 document describes a RDAP query extension that allows clients to 18 specify their preference for obtaining a partial response. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at https://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on August 5, 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. Brief Field Set . . . . . . . . . . . . . . . . . . . . . 6 59 3.2. Full Field Set . . . . . . . . . . . . . . . . . . . . . 7 60 3.3. Subsetting Metadata . . . . . . . . . . . . . . . . . . . 8 61 3.3.1. Representing Subsetting Links . . . . . . . . . . . . 8 62 4. RDAP Conformance . . . . . . . . . . . . . . . . . . . . . . 9 63 5. Implementation Status . . . . . . . . . . . . . . . . . . . . 9 64 5.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 10 65 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 67 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 68 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 69 9.1. Normative References . . . . . . . . . . . . . . . . . . 11 70 9.2. Informative References . . . . . . . . . . . . . . . . . 12 71 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 13 72 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 74 1. Introduction 76 The use of partial response in RESTful API ([REST]) design is very 77 common. The rationale is quite simple: instead of returning objects 78 in API responses with all data fields, only a subset is returned. 79 The benefit is obvious: less data transferred over the network mean 80 less bandwidth usage, faster server response, less CPU time spent 81 both on the server and the client, as well as less memory usage on 82 the client. 84 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 85 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 86 by providing an optional query parameter by which users require the 87 fields they wish to receive. Partial response is also considered a 88 leading principle by many best practices guidelines in REST APIs 89 implementation ([REST-API1], [REST-API2]) in order to improve 90 performance, save on bandwidth and possibly accelerate the overall 91 interaction. In other contexts, for example in digital libraries and 92 bibliographic catalogues, servers can provide responses according to 93 different element sets (i.e. "brief" to get back a short response and 94 "full" to get back the complete response) 95 Currently, RDAP does not provide a client with any way to request a 96 partial response: the server can only provide the client with the 97 full response ([RFC7483]). Furthermore, servers cannot define the 98 limits of the results according to partial responses and this causes 99 strong inefficiencies. 101 The protocol described in this specification extends RDAP search 102 capabilities to enable partial responses, by adding a new query 103 parameter and using a RESTful web service. The service is 104 implemented using the Hypertext Transfer Protocol (HTTP) ([RFC7230]) 105 and the conventions described in RFC 7480 ([RFC7480]). 107 Impact on the current state of RDAP implementation is low. 109 1.1. Conventions Used in This Document 111 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 112 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 113 document are to be interpreted as described in RFC 2119 ([RFC2119]). 115 2. Approaches to Partial Response Implementation 117 Looking at the implementation experiences described above, two 118 approaches to the implementation of partial response can be detected: 120 o the client declares explicitly the data fields to get back; 122 o the client declares a name identifying a server pre-defined set of 123 data fields. 125 The former is more flexible than the latter, because clients can 126 specify all the data fields they need. Anyway, it has some 127 drawbacks: 129 o Fields have to be declared according to a given syntax. This is a 130 simple task when the data structure of the object is flat, but it 131 is much more difficult when the object has a tree structure like 132 the one of a JSON object. The presence of arrays and deep nested 133 objects contribute to complicate both the syntax definition of the 134 query and, consequently, the processing phase on the server side. 136 o Clients should perfectly know the returned object to avoid cases 137 when the required fields are not compliant with the object data 138 structure. 140 o The request of some fields cannot match the user access levels. 141 Clients could put unauthorized fields in their requests and 142 servers should define a strategy for providing a response: to 143 return always an error response or to return a response ignoring 144 the unauthorized fields. 146 In addition to those listed above, RDAP responses raise some specific 147 issues: 149 o Most of the relevant information of the entity object is included 150 in the jCard but such information cannot be easily selected 151 because it is split into the items of a jagged array. 153 o RDAP responses contain some properties providing service 154 information (e.g. rdapConformance, links, notices, remarks, etc.) 155 which are not normally selected but they are just as important. 156 They could be returned anyway but, in this case, the server would 157 provide unrequested data. 159 As an example compliant to the first approach, the Catnap Query 160 Language ([CQL]) is a comprehensive expression language that can be 161 used to customize the JSON response of a RESTful web service. The 162 practical application of CQL to RDAP responses points out that 163 declaring explicitly the output fields would still be acceptable when 164 a few fields are requested but it would become very complicated if 165 the fields should be more. In the following, two CQL expressions for 166 a search domain query are shown (Figure 1): in the first, only 167 objectClassName and ldhName are requested, in the second, the fields 168 of a possible WHOIS-like response are listed. 170 https://example.com/rdap/domains?name=example*.com 171 &fields=domainSearchResults(objectClassName,ldhName) 173 https://example.com/rdap/domains?name=example*.com 174 &fields=domainSearchResults(objectClassName,ldhName,unicodeName, 175 status, 176 events(eventAction,eventDate), 177 entities(objectClassName,handle,roles), 178 nameservers(objectClassName,ldhName)) 180 Figure 1: Examples of CQL expressions for a search domain query 182 The latter approach seems to facilitate RDAP interoperability. In 183 fact, servers can define some basic field sets which, if known to the 184 clients, can increase the probability to get a valid response. The 185 usage of field sets lets the query string be less complex. In 186 addition, the definition of pre-defined sets of fields makes easier 187 to establish the results limits. 189 Finally, considering that there is not a real need for RDAP users to 190 have the maximum flexibility in defining all the possible sets of 191 logically connected fields (for example, users interested in domains 192 usually need to know the status, the creation date, the expire date 193 of each domain), the latter approach is preferred. 195 3. RDAP Path Segment Specification 197 The new query parameter is an OPTIONAL extension of search path 198 segments defined in RFC 7482 ([RFC7482]). The query parameter is 199 "fieldSet" whose value is a string identifying a server pre-defined 200 set of fields (Figure 2). Values REQUIRED to be implemented are: 202 o id: the server provides only the "objectClassName" field and the 203 key field ("handle" for entities, "ldhName" for domains and 204 nameservers). This field set can be used when the client wants to 205 obtain a collection of object identifiers (Figure 3); 207 o brief: it contains the fields that can be included in a "short" 208 response. This field set can be used when the client is asking 209 for a subset of the full response which gives a basic knowledge of 210 each object. The fields are those defined in Section 3.1; 212 o full: it contains all the information the server can provide for a 213 particular object. Additional considerations are reported in 214 Section 3.2. 216 Fields belonging to brief and full field sets should be provided 217 according to users access levels. RDAP providers MAY add any 218 property providing service information. Servers MAY implement 219 additional field sets not included in the list above. Servers SHOULD 220 also define a "default" field set. 222 https://example.com/rdap/domains?name=example*.com&fieldSet=id 224 Figure 2: Example of RDAP search query reporting the fieldSet 225 parameter 227 { 228 "rdapConformance": [ 229 "rdap_level_0", 230 ], 231 ... 232 "domainSearchResults": [ 233 { 234 "objectClassName": "domain", 235 "ldhName": "example1.com" 236 }, 237 { 238 "objectClassName": "domain", 239 "ldhName": "example2.com" 240 }, 241 ... 242 ] 243 } 245 Figure 3: Example of RDAP response according to the "id" field set 247 3.1. Brief Field Set 249 In order to ensure the highest degree of interoperability, the brief 250 field set should contain the most commonly used data elements. Based 251 on the assumption that an RDAP server will return almost the same 252 data as those replied by the corresponding Whois service, the 253 elements included in the brief field set could be those identified in 254 RFC 7485 ([RFC7485]) as mostly supported (i.e. by more than one third 255 of contacted services). 257 Therefore, RDAP servers are RECOMMENDED to return the following 258 elements in the brief field set (Table 1): 260 +------------+-----------------+------------------------------------+ 261 | Object | Whois property | RDAP property | 262 | class | | | 263 +------------+-----------------+------------------------------------+ 264 | Domain | Domain Name | ldhName | 265 | | Domain Status | status | 266 | | Creation Date | event whose eventAction type is | 267 | | | "registration" | 268 | | Expiration Date | event whose eventAction type is | 269 | | | "expiration" | 270 | | Update Date | event whose eventAction type is | 271 | | | "last update" | 272 | | | | 273 | Nameserver | Name Server | ldhName | 274 | | | | 275 | Entity | Entity ID | handle | 276 | | Entity Name | vcard fn | 277 | | Entity | vcard org | 278 | | Organization | | 279 | | Entity Email | vcard email | 280 | | Entity Phone | vcard tel with type="voice" | 281 | | Entity Fax | vcard tel with type="fax" | 282 | | Entity Country | country name in vcard adr | 283 | | Entity City | locality in vcard adr | 284 | | Entity Postal | postal code in vcard adr | 285 | | Code | | 286 +------------+-----------------+------------------------------------+ 288 Table 1: Elements included in brief field set 290 The term "Entity" refers to any kind of contact. 292 3.2. Full Field Set 294 With regards to the full field set, some additional considerations 295 can be made about how second level objects could be represented. In 296 fact, since the topmost objects could be returned according to 297 different field sets, the same thing could go for their related 298 objects. As a consequence, the full response could range from the 299 one containing no relationship up to a response where each related 300 object is in turn in full format. 302 FOR DISCUSSION: Should this specification furtherly detail the full 303 field set according to the different representations of the related 304 objects? 306 3.3. Subsetting Metadata 308 According to most advanced principles in REST design, collectively 309 known as HATEOAS (Hypermedia as the Engine of Application State) 310 ([HATEOAS]), a client entering a REST application through an initial 311 URI should use the server-provided links to dynamically discover 312 available actions and access the resources it needs. In this way, 313 the client is not requested to have prior knowledge of the service 314 and, consequently, to hard code the URIs of different resources. 315 This would allow the server to make URI changes as the API evolves 316 without breaking the clients. Definitively, a REST service should be 317 self-descriptive as much as possible. 319 Therefore, the implementation of the query parameter described in 320 this specification recommends servers to provide additional 321 information in their responses about the available field sets. Such 322 information is collected in a new data structures named 323 "subsetting_metadata" containing the following fields: 325 o "currentFieldSet": the value of fieldSet parameter as specified in 326 the query string; 328 o "availableFieldSets": an array of objects each one describing an 329 available field set: 331 * "name": the field set name; 332 * "description": a human-readable description of the field set; 333 * "default": whether the field set is applied by default; 334 * "links": an array of links as described in RFC 8288 ([RFC8288]) 335 containing the query string that applies the field set. 337 Both "currentFieldSet" and "availableFieldSets" are OPTIONAL fields 338 of the "subsetting_metadata" structure. In particular, the 339 "currentFieldSet" field is provided when the query string contains a 340 valid value for fieldSet parameter, while the "availableFieldSets" 341 field SHOULD be provided when the fieldSet parameter is missing in 342 the query string or when it is present and the server implements more 343 than a field set for the RDAP object. At least the "name" field is 344 REQUIRED in each item of the "availableFieldSets" array while the 345 other fields are RECOMMENDED. 347 3.3.1. Representing Subsetting Links 349 An RDAP server MAY use the "links" array of the "subsetting_metadata" 350 section to provide ready-made references ([RFC8288]) to the available 351 field set (Figure 4). Each link represents a reference to an 352 alternate view of the results. 354 { 355 "rdapConformance": [ 356 "rdap_level_0", 357 "subsetting_level_0" 358 ], 359 ... 360 "subsetting_metadata": { 361 "currentFieldSet": "brief", 362 "availableFieldSets": [ 363 { 364 "name": "id", 365 "description": "Contains "objectClassName" and the key field", 366 "default": false, 367 "links": [ 368 { 369 "value": "https://example.com/rdap/domains?name=*nr.com 370 &fieldSet=brief", 371 "rel": "alternate", 372 "href": "https://example.com/rdap/domains?name=*nr.com 373 &fieldSet=id", 374 "title": "Result Subset Link", 375 "type": "application/rdap+json" 376 }, 377 ... 378 ] 379 }, 380 "domainSearchResults": [ 381 ... 382 ] 383 } 385 Figure 4: Example of a "subsetting_metadata" instance 387 4. RDAP Conformance 389 Servers returning the "subsetting_metadata" section in their 390 responses MUST include "subsetting_level_0" in the rdapConformance 391 array. 393 5. Implementation Status 395 NOTE: Please remove this section and the reference to RFC 7942 prior 396 to publication as an RFC. 398 This section records the status of known implementations of the 399 protocol defined by this specification at the time of posting of this 400 Internet-Draft, and is based on a proposal described in RFC 7942 401 ([RFC7942]). The description of implementations in this section is 402 intended to assist the IETF in its decision processes in progressing 403 drafts to RFCs. Please note that the listing of any individual 404 implementation here does not imply endorsement by the IETF. 405 Furthermore, no effort has been spent to verify the information 406 presented here that was supplied by IETF contributors. This is not 407 intended as, and must not be construed to be, a catalog of available 408 implementations or their features. Readers are advised to note that 409 other implementations may exist. 411 According to RFC 7942, "this will allow reviewers and working groups 412 to assign due consideration to documents that have the benefit of 413 running code, which may serve as evidence of valuable experimentation 414 and feedback that have made the implemented protocols more mature. 415 It is up to the individual working groups to use this information as 416 they see fit". 418 5.1. IIT-CNR/Registro.it 420 Responsible Organization: Institute of Informatics and Telematics 421 of National Research Council (IIT-CNR)/Registro.it 422 Location: https://rdap.pubtest.nic.it/ 423 Description: This implementation includes support for RDAP queries 424 using data from the public test environment of .it ccTLD. 425 Level of Maturity: This is a "proof of concept" research 426 implementation. 427 Coverage: This implementation includes all of the features 428 described in this specification. 429 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 431 6. Security Considerations 433 Search query typically requires more server resources (such as 434 memory, CPU cycles, and network bandwidth) when compared to lookup 435 query. This increases the risk of server resource exhaustion and 436 subsequent denial of service due to abuse. Partial response can 437 contribute together with other strategies (e.g. restricting search 438 functionality, limiting the rate of search requests, truncating and 439 paging results) to mitigate this risk. 441 Furthermore, partial response can help RDAP operators to regulate 442 access control based on client identification, implemented by HTTP 443 basic or digest authentication as described in RFC 7481 ([RFC7481]) 444 or by a federated authentication system 445 ([I-D.hollenbeck-regext-rdap-openid]). In fact, RDAP operators can 446 follow different, not alternative, approaches to the building of 447 responses according to the user access levels: 449 o the list of fields for each set (except "id") can be different 450 according to the user access levels. At present, this is already 451 implemented for the full response, but it could be done also for 452 the other defined field sets. In some cases, it might happen that 453 brief and full field sets are exactly the same; 455 o some field sets could be available only to some users. In this 456 case, servers could define additional field sets to those 457 indicated above ("id", "brief", "full"), making them available 458 only to users with specific access levels. 460 Servers can also define different results limits according to the 461 available field sets, so a more flexible truncation strategy can be 462 realized and users can take advantage of a more efficient results 463 paging implementation 464 ([I-D.loffredo-regext-rdap-sorting-and-paging]). 466 Therefore, the new parameter presented in this document provides the 467 RDAP operators with a way to implement a secure server without 468 penalizing its efficiency. 470 7. IANA Considerations 472 This document has no actions for IANA. 474 8. Acknowledgements 476 The authors would like to acknowledge Scott Hollenbeck for his 477 contribution to this document. 479 9. References 481 9.1. Normative References 483 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 484 Requirement Levels", BCP 14, RFC 2119, 485 DOI 10.17487/RFC2119, March 1997, 486 . 488 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 489 Protocol (HTTP/1.1): Message Syntax and Routing", 490 RFC 7230, DOI 10.17487/RFC7230, June 2014, 491 . 493 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 494 Registration Data Access Protocol (RDAP)", RFC 7480, 495 DOI 10.17487/RFC7480, March 2015, 496 . 498 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 499 Registration Data Access Protocol (RDAP)", RFC 7481, 500 DOI 10.17487/RFC7481, March 2015, 501 . 503 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 504 Protocol (RDAP) Query Format", RFC 7482, 505 DOI 10.17487/RFC7482, March 2015, 506 . 508 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 509 Registration Data Access Protocol (RDAP)", RFC 7483, 510 DOI 10.17487/RFC7483, March 2015, 511 . 513 [RFC7485] Zhou, L., Kong, N., Shen, S., Sheng, S., and A. Servin, 514 "Inventory and Analysis of WHOIS Registration Objects", 515 RFC 7485, DOI 10.17487/RFC7485, March 2015, 516 . 518 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 519 DOI 10.17487/RFC8288, October 2017, 520 . 522 9.2. Informative References 524 [CQL] Whitaker, G., "Catnap Query Language Reference", September 525 2017, . 528 [FACEBOOK] 529 facebook.com, "facebook for developers - Using the Graph 530 API", July 2017, . 533 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 534 Response and Partial Update", March 2010, 535 . 538 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 539 . 542 [I-D.hollenbeck-regext-rdap-openid] 543 Hollenbeck, S., "Federated Authentication for the 544 Registration Data Access Protocol (RDAP) using OpenID 545 Connect", draft-hollenbeck-regext-rdap-openid-10 (work in 546 progress), August 2018. 548 [I-D.loffredo-regext-rdap-sorting-and-paging] 549 Loffredo, M., Martinelli, M., and S. Hollenbeck, 550 "Registration Data Access Protocol (RDAP) Query Parameters 551 for Result Sorting and Paging", draft-loffredo-regext- 552 rdap-sorting-and-paging-05 (work in progress), September 553 2018. 555 [LINKEDIN] 556 linkedin.com, "Java One 2009: Building Consistent RESTful 557 APIs in a High Performance Environment", July 2009, 558 . 562 [REST] Fielding, R., "Architectural Styles and the Design of 563 Network-based Software Architectures", 2000, 564 . 567 [REST-API1] 568 Jobinesh, P., "RESTful Java Web Services - Second 569 Edition", September 2015. 571 [REST-API2] 572 Masse, M., "REST API Design Rulebook", October 2011. 574 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 575 Code: The Implementation Status Section", BCP 205, 576 RFC 7942, DOI 10.17487/RFC7942, July 2016, 577 . 579 Appendix A. Change Log 581 00: Initial version. 582 01: Added Catnap Query Language as an example of language that can 583 be used to declare explicitly the output fields of RDAP responses. 584 Revised some sentences and references. 585 02: Added "Subsetting Metadata" and "RDAP Conformance" sections. 586 03: Added "Brief Field Set" and "Full Field Set" sections. 588 Authors' Addresses 590 Mario Loffredo 591 IIT-CNR/Registro.it 592 Via Moruzzi,1 593 Pisa 56124 594 IT 596 Email: mario.loffredo@iit.cnr.it 597 URI: http://www.iit.cnr.it 599 Maurizio Martinelli 600 IIT-CNR/Registro.it 601 Via Moruzzi,1 602 Pisa 56124 603 IT 605 Email: maurizio.martinelli@iit.cnr.it 606 URI: http://www.iit.cnr.it