idnits 2.17.1 draft-loffredo-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 (September 21, 2018) is 2043 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) == Missing Reference: 'RFC8288' is mentioned on line 288, but not defined ** 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) == Outdated reference: A later version (-05) exists of draft-loffredo-regext-rdap-sorting-and-paging-04 Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 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: March 25, 2019 September 21, 2018 7 Registration Data Access Protocol (RDAP) Partial Response 8 draft-loffredo-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 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 March 25, 2019. 37 Copyright Notice 39 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . 6 59 3.1.1. Representing Subsetting Links . . . . . . . . . . . . 7 60 4. RDAP Conformance . . . . . . . . . . . . . . . . . . . . . . 8 61 5. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 62 5.1. IIT-CNR/Registro.it . . . . . . . . . . . . . . . . . . . 9 63 6. Security Considerations . . . . . . . . . . . . . . . . . . . 9 64 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 65 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 66 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 67 9.1. Normative References . . . . . . . . . . . . . . . . . . 10 68 9.2. Informative References . . . . . . . . . . . . . . . . . 11 69 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 12 70 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 72 1. Introduction 74 The use of partial response in RESTful API [REST] design is very 75 common. The rationale is quite simple: instead of returning objects 76 in API responses with all data fields, only a subset is returned. 77 The benefit is obvious: less data transferred over the network mean 78 less bandwidth usage, faster server response, less CPU time spent 79 both on the server and the client, as well as less memory usage on 80 the client. 82 Several leading APIs providers (e.g. LinkedIn [LINKEDIN], Facebook 83 [FACEBOOK], Google [GOOGLE]) implement the partial response feature 84 by providing an optional query parameter by which users require the 85 fields they wish to receive. Partial response is also considered a 86 leading principle by many best practices guidelines in REST APIs 87 implementation ([REST-API1], [REST-API2]) in order to improve 88 performance, save on bandwidth and possibly accelerate the overall 89 interaction. In other contexts, for example in digital libraries and 90 bibliographic catalogues, servers can provide responses according to 91 different element sets (i.e. "brief" to get back a short response and 92 "full" to get back the complete response) 94 Currently, RDAP does not provide a client with any way to request a 95 partial response: the server can only provide the client with the 96 full response ([RFC7483]). Furthermore, servers cannot define the 97 limits of the results according to partial responses and this causes 98 strong inefficiencies. 100 The protocol described in this specification extends RDAP search 101 capabilities to enable partial responses, by adding a new query 102 parameter and using a RESTful web service. The service is 103 implemented using the Hypertext Transfer Protocol (HTTP) [RFC7230] 104 and the conventions described in RFC 7480 [RFC7480]. 106 Impact on the current state of RDAP implementation is low. 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 [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. Anyway, 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 contribute to complicate both the syntax definition of the 133 query and, consequently, the processing phase on the server side. 135 o Clients should perfectly know the returned object to avoid cases 136 when the required fields are not compliant with the object data 137 structure. 139 o The request of some fields cannot match the user access levels. 140 Clients could put unauthorized fields in their requests and 141 servers should define a strategy for providing a response: to 142 return always an error response or to return a response ignoring 143 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) [CQL] is a comprehensive expression language that can 160 be 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 (for example, users interested in domains 191 usually need to know the status, the creation date, the expire date 192 of each domain), the latter approach is preferred. 194 3. RDAP Path Segment Specification 196 The new query parameter is an OPTIONAL extension of search path 197 segments defined in RFC 7482 [RFC7482]. The query parameter is 198 "fieldSet" whose value is a string identifying a server pre-defined 199 set of fields (Figure 2). Values REQUIRED to be implemented are: 201 o id: the server provides only the "objectClassName" field and the 202 key field ("handle" for entities, "ldhName" for domains and 203 nameservers). This field set can be used when the client wants to 204 obtain a collection of object identifiers (Figure 3); 206 o brief: it contains the fields that can be included in a "short" 207 response. This field set can be used when the client is asking 208 for a subset of the full response which gives a basic knowledge of 209 each object; 211 o full: it contains all the information the server can provide for a 212 particular object. 214 Fields belonging to brief and full field sets should be provided 215 according to users access levels. Servers MAY implement additional 216 field sets not included in the list above. Servers SHOULD also 217 define a "default" field set. 219 https://example.com/rdap/domains?name=example*.com&fieldSet=id 221 Figure 2: Example of RDAP search query reporting the fieldSet 222 parameter 224 { 225 "rdapConformance": [ 226 "rdap_level_0", 227 ], 228 ... 229 "domainSearchResults": [ 230 { 231 "objectClassName": "domain", 232 "ldhName": "example1.com" 233 }, 234 { 235 "objectClassName": "domain", 236 "ldhName": "example2.com" 237 }, 238 ... 239 ] 240 } 242 Figure 3: Example of RDAP response according to the "id" field set 244 3.1. Subsetting Metadata 246 According to most advanced principles in REST design, collectively 247 known as HATEOAS (Hypermedia as the Engine of Application State) 248 ([HATEOAS]), a client entering a REST application through an initial 249 URI should use the server-provided links to dynamically discover 250 available actions and access the resources it needs. In this way, 251 the client is not requested to have prior knowledge of the service 252 and, consequently, to hard code the URIs of different resources. 253 This would allow the server to make URI changes as the API evolves 254 without breaking the clients. Definitively, a REST service should be 255 self-descriptive as much as possible. 257 Therefore, the implementation of the query parameter described in 258 this specification recommends servers to provide additional 259 information in their responses about the available field sets. Such 260 information is collected in a new data structures named 261 "subsetting_metadata" containing the following fields: 263 o "currentFieldSet": the value of fieldSet parameter as specified in 264 the query string; 266 o "availableFieldSets": an array of objects each one describing an 267 available field set: 269 * "name": the field set name; 270 * "description": a human-readable description of the field set; 271 * "default": whether the field set is applied by default; 272 * "links": an array of links as described in RFC 8288 [RFC8288] 273 containing the query string that applies the field set. 275 Both "currentFieldSet" and "availableFieldSets" are OPTIONAL fields 276 of the "subsetting_metadata" structure. In particular, the 277 "currentFieldSet" field is provided when the query string contains a 278 valid value for fieldSet parameter, while the "availableFieldSets" 279 field SHOULD be provided when the fieldSet parameter is missing in 280 the query string or when it is present and the server implements more 281 than a field set for the RDAP object. At least the "name" field is 282 REQUIRED in each item of the "availableFieldSets" array while the 283 other fields are RECOMMENDED. 285 3.1.1. Representing Subsetting Links 287 An RDAP server MAY use the "links" array of the "subsetting_metadata" 288 section to provide ready-made references [RFC8288] to the available 289 field set (Figure 4). Each link represents a reference to an 290 alternate view of the results. 292 { 293 "rdapConformance": [ 294 "rdap_level_0", 295 "subsetting_level_0" 296 ], 297 ... 298 "subsetting_metadata": { 299 "currentFieldSet": "brief", 300 "availableFieldSets": [ 301 { 302 "name": "id", 303 "description": "Contains "objectClassName" and the key field", 304 "default": false, 305 "links": [ 306 { 307 "value": "https://example.com/rdap/domains?name=*nr.com 308 &fieldSet=brief", 309 "rel": "alternate", 310 "href": "https://example.com/rdap/domains?name=*nr.com 311 &fieldSet=id", 312 "title": "Result Subset Link", 313 "type": "application/rdap+json" 314 }, 315 ... 316 ] 317 }, 318 "domainSearchResults": [ 319 ... 320 ] 321 } 323 Figure 4: Example of a "subsetting_metadata" instance 325 4. RDAP Conformance 327 Servers returning the "subsetting_metadata" section in their 328 responses MUST include "subsetting_level_0" in the rdapConformance 329 array. 331 5. Implementation Status 333 NOTE: Please remove this section and the reference to RFC 7942 prior 334 to publication as an RFC. 336 This section records the status of known implementations of the 337 protocol defined by this specification at the time of posting of this 338 Internet-Draft, and is based on a proposal described in RFC 7942 339 [RFC7942]. The description of implementations in this section is 340 intended to assist the IETF in its decision processes in progressing 341 drafts to RFCs. Please note that the listing of any individual 342 implementation here does not imply endorsement by the IETF. 343 Furthermore, no effort has been spent to verify the information 344 presented here that was supplied by IETF contributors. This is not 345 intended as, and must not be construed to be, a catalog of available 346 implementations or their features. Readers are advised to note that 347 other implementations may exist. 349 According to RFC 7942, "this will allow reviewers and working groups 350 to assign due consideration to documents that have the benefit of 351 running code, which may serve as evidence of valuable experimentation 352 and feedback that have made the implemented protocols more mature. 353 It is up to the individual working groups to use this information as 354 they see fit". 356 5.1. IIT-CNR/Registro.it 358 Responsible Organization: Institute of Informatics and Telematics 359 of National Research Council (IIT-CNR)/Registro.it 360 Location: https://rdap.pubtest.nic.it/ 361 Description: This implementation includes support for RDAP queries 362 using data from the public test environment of .it ccTLD. The 363 RDAP server does not implement any security policy because data 364 returned by this server are only for experimental testing 365 purposes. 366 Level of Maturity: This is a "proof of concept" research 367 implementation. 368 Coverage: This implementation includes all of the features 369 described in this specification. 370 Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it 372 6. Security Considerations 374 Search query typically requires more server resources (such as 375 memory, CPU cycles, and network bandwidth) when compared to lookup 376 query. This increases the risk of server resource exhaustion and 377 subsequent denial of service due to abuse. Partial response can 378 contribute together with other strategies (e.g. restricting search 379 functionality, limiting the rate of search requests, truncating and 380 paging results) to mitigate this risk. 382 Furthermore, partial response can help RDAP operators to regulate 383 access control based on client identification, implemented by HTTP 384 basic or digest authentication as described in RFC 7481 [RFC7481] or 385 by a federated authentication system 386 ([I-D.hollenbeck-regext-rdap-openid]). In fact, RDAP operators can 387 follow different, not alternative, approaches to the building of 388 responses according to the user access levels: 390 o the list of fields for each set (except "id") can be different 391 according to the user access levels. At present, this is already 392 implemented for the full response, but it could be done also for 393 the other defined field sets. In some cases, it might happen that 394 brief and full field sets are exactly the same; 396 o some field sets could be available only to some users. In this 397 case, servers could define additional field sets to those 398 indicated above ("id", "brief", "full"), making them available 399 only to users with specific access levels. 401 Servers can also define different results limits according to the 402 available field sets, so a more flexible truncation strategy can be 403 realized and users can take advantage of a more efficient results 404 paging implementation 405 ([I-D.loffredo-regext-rdap-sorting-and-paging]). 407 Therefore, the new parameter presented in this document provides the 408 RDAP operators with a way to implement a secure server without 409 penalizing its efficiency. 411 7. IANA Considerations 413 This document has no actions for IANA. 415 8. Acknowledgements 417 The authors would like to acknowledge Scott Hollenbeck for his 418 contribution to this document. 420 9. References 422 9.1. Normative References 424 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 425 Requirement Levels", BCP 14, RFC 2119, 426 DOI 10.17487/RFC2119, March 1997, 427 . 429 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 430 Protocol (HTTP/1.1): Message Syntax and Routing", 431 RFC 7230, DOI 10.17487/RFC7230, June 2014, 432 . 434 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the 435 Registration Data Access Protocol (RDAP)", RFC 7480, 436 DOI 10.17487/RFC7480, March 2015, 437 . 439 [RFC7481] Hollenbeck, S. and N. Kong, "Security Services for the 440 Registration Data Access Protocol (RDAP)", RFC 7481, 441 DOI 10.17487/RFC7481, March 2015, 442 . 444 [RFC7482] Newton, A. and S. Hollenbeck, "Registration Data Access 445 Protocol (RDAP) Query Format", RFC 7482, 446 DOI 10.17487/RFC7482, March 2015, 447 . 449 [RFC7483] Newton, A. and S. Hollenbeck, "JSON Responses for the 450 Registration Data Access Protocol (RDAP)", RFC 7483, 451 DOI 10.17487/RFC7483, March 2015, 452 . 454 9.2. Informative References 456 [CQL] Whitaker, G., "Catnap Query Language Reference", September 457 2017, . 460 [FACEBOOK] 461 facebook.com, "facebook for developers - Using the Graph 462 API", July 2017, . 465 [GOOGLE] google.com, "Making APIs Faster: Introducing Partial 466 Response and Partial Update", March 2010, 467 . 470 [HATEOAS] Jedrzejewski, B., "HATEOAS - a simple explanation", 2018, 471 . 474 [I-D.hollenbeck-regext-rdap-openid] 475 Hollenbeck, S., "Federated Authentication for the 476 Registration Data Access Protocol (RDAP) using OpenID 477 Connect", draft-hollenbeck-regext-rdap-openid-10 (work in 478 progress), August 2018. 480 [I-D.loffredo-regext-rdap-sorting-and-paging] 481 Loffredo, M., Martinelli, M., and S. Hollenbeck, 482 "Registration Data Access Protocol (RDAP) Query Parameters 483 for Result Sorting and Paging", draft-loffredo-regext- 484 rdap-sorting-and-paging-04 (work in progress), June 2018. 486 [LINKEDIN] 487 linkedin.com, "Java One 2009: Building Consistent RESTful 488 APIs in a High Performance Environment", July 2009, 489 . 493 [REST] Fielding, R., "Architectural Styles and the Design of 494 Network-based Software Architectures", 2000, 495 . 498 [REST-API1] 499 Jobinesh, P., "RESTful Java Web Services - Second 500 Edition", September 2015. 502 [REST-API2] 503 Masse, M., "REST API Design Rulebook", October 2011. 505 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 506 Code: The Implementation Status Section", BCP 205, 507 RFC 7942, DOI 10.17487/RFC7942, July 2016, 508 . 510 Appendix A. Change Log 512 00: Initial version. 513 01: Added Catnap Query Language as an example of language that can 514 be used to declare explicitly the output fields of RDAP responses. 515 Revised some sentences and references. 516 02: Added "Subsetting Metadata" and "RDAP Conformance" sections. 518 Authors' Addresses 520 Mario Loffredo 521 IIT-CNR/Registro.it 522 Via Moruzzi,1 523 Pisa 56124 524 IT 526 Email: mario.loffredo@iit.cnr.it 527 URI: http://www.iit.cnr.it 528 Maurizio Martinelli 529 IIT-CNR/Registro.it 530 Via Moruzzi,1 531 Pisa 56124 532 IT 534 Email: maurizio.martinelli@iit.cnr.it 535 URI: http://www.iit.cnr.it