idnits 2.17.1 draft-hammer-hostmeta-12.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 : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document date (June 9, 2010) is 5060 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 5785 (Obsoleted by RFC 8615) Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group E. Hammer-Lahav 3 Internet-Draft Yahoo! 4 Intended status: Informational June 9, 2010 5 Expires: December 11, 2010 7 Web Host Metadata 8 draft-hammer-hostmeta-12 10 Abstract 12 This memo describes a method for locating host metadata as well as 13 information about individual resources controlled by the host. 15 Editorial Note (to be removed by RFC Editor) 17 Please discuss this draft on the apps-discuss@ietf.org [1] mailing 18 list. 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 http://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 December 11, 2010. 37 Copyright Notice 39 Copyright (c) 2010 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 (http://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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 1.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.1.1. Processing Resource-Specific Information . . . . . . . 5 57 1.2. Notational Conventions . . . . . . . . . . . . . . . . . . 6 58 2. Obtaining host-meta Documents . . . . . . . . . . . . . . . . 6 59 3. The host-meta Document Format . . . . . . . . . . . . . . . . 7 60 3.1. The 'Link' Element . . . . . . . . . . . . . . . . . . . . 8 61 3.1.1. Template Syntax . . . . . . . . . . . . . . . . . . . 8 62 4. Processing host-meta Documents . . . . . . . . . . . . . . . . 9 63 4.1. Host-Wide Information . . . . . . . . . . . . . . . . . . 9 64 4.2. Resource-Specific Information . . . . . . . . . . . . . . 10 65 5. Security Considerations . . . . . . . . . . . . . . . . . . . 10 66 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 67 6.1. The 'host-meta' Well-Known URI . . . . . . . . . . . . . . 11 68 6.2. The 'lrdd' Relation Type . . . . . . . . . . . . . . . . . 11 69 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 12 70 Appendix B. Document History . . . . . . . . . . . . . . . . . . 12 71 7. Normative References . . . . . . . . . . . . . . . . . . . . . 14 72 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 14 74 1. Introduction 76 Web-based protocols often require the discovery of host policy or 77 metadata, where "host" is not a single resource but the entity 78 controlling the collection of resources identified by Uniform 79 Resource Identifiers (URI) with a common URI host [RFC3986]. 81 While web protocols have a wide range of metadata needs, they often 82 use metadata that is concise, has simple syntax requirements, and can 83 benefit from storing their metadata in a common location used by 84 other related protocols. 86 Because there is no URI or representation available to describe a 87 host, many of the methods used for associating per-resource metadata 88 (such as HTTP headers) are not available. This often leads to the 89 overloading of the root HTTP resource (e.g. 'http://example.com/') 90 with host metadata that is not specific or relevant to the root 91 resource itself. 93 This memo registers the well-known URI suffix "host-meta" in the 94 Well-Known URI Registry established by [RFC5785], and specifies a 95 simple, general-purpose metadata document format for hosts, to be 96 used by multiple web-based protocols. 98 In addition, there are times when a host-wide scope for policy or 99 metadata is too coarse-grained. host-meta provides two mechanisms for 100 providing resource-specific information: 102 o Link Templates - links using a URI template instead of a fixed 103 target URI, providing a way to define generic rules for generating 104 resource-specific links by applying the individual resource URI to 105 the template. 107 o Link-based Resource Descriptor Documents (LRDD, pronounced 'lard') 108 - descriptor documents providing resource-specific information, 109 typically information that cannot be expressed using link 110 templates. LRDD documents are linked to using link templates with 111 the "lrdd" relation type. 113 1.1. Example 115 The following is a simple host-meta document including both host-wide 116 and resource-specific information for the 'example.com' host: 118 119 121 123 1.0 125 128 130 133 137 140 142 The host-wide information which applies to host in its entirety 143 provided by the document includes: 145 o A "http://protocol.example.net/version" host property with a value 146 of "1.0". 148 o A link to the host's copyright policy ("copyright"). 150 The resource-specific information provided by the document includes: 152 o A link template for receiving real-time updates ("hub") about 153 individual resources. Since the template does not include a 154 template variable, the target URI is identical for all resources. 156 o A LRDD document link template ("lrdd") for obtaining additional 157 resource-specific information contained in a separate document for 158 each individual resource. 160 o A link template for finding information about the author of 161 individual resources ("author"). 163 1.1.1. Processing Resource-Specific Information 165 When looking for information about the an individual resource, for 166 example, the resource identified by 'http://example.com/xy', the 167 resource URI is applied to the templates found, producing the 168 following links: 170 173 177 180 The LRDD document for 'http://example.com/xy' is obtained using an 181 HTTP "GET" request: 183 184 186 http://example.com/xy 188 red 190 193 195 197 Together, the information available about the individual resource 198 (presented as an XRD document for illustration purposes) is: 200 201 203 http://example.com/xy 205 red 207 210 213 216 219 221 Note that the order of links matters and is based on their original 222 order in the host-meta and LRDD documents. For example, the "hub" 223 link obtained from the host-meta link template has a higher priority 224 than the link found in the LRDD document because the host-meta link 225 appears before the "lrdd" link. 227 On the other hand, the "author" link found in the LRDD document has a 228 higher priority than the link found in the host-meta document because 229 it appears after the "lrdd" link. 231 1.2. Notational Conventions 233 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 234 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 235 document are to be interpreted as described in [RFC2119]. 237 This document uses the Augmented Backus-Naur Form (ABNF) notation of 238 [RFC5234]. Additionally, the following rules are included from 239 [RFC3986]: reserved, unreserved, and pct-encoded. 241 2. Obtaining host-meta Documents 243 The client obtains the host-meta document for a given host by making 244 an HTTPS [RFC2818] GET request to the host's port 443 for the 245 "/.well-known/host-meta" path. If the request fails to produce a 246 valid host-meta document, the client makes an HTTP [RFC2616] GET 247 request to the host's port 80 for the "/.well-known/host-meta" path. 249 The server MUST support at least one but SHOULD support both ports. 250 If both ports are supported, they MUST serve the same document. The 251 client MAY attempt to obtain the host-meta document from either port, 252 SHOULD attempt using port 443 first, and SHOULD attempt the other 253 port if the first fails. 255 For example, the following request is used to obtain the host-meta 256 document for the 'example.com' host: 258 GET /.well-known/host-meta HTTP/1.1 259 Host: example.com 261 If the server response indicates that the host-meta resource is 262 located elsewhere (a 301, 302, or 307 response status code), the 263 client MUST try to obtain the resource from the location provided in 264 the response. This means that the host-meta document for one host 265 MAY be retrieved from another host. Likewise, if the resource is not 266 available or does not exist (e.g. a 404 or 410 response status codes) 267 at both ports, the client should infer that metadata is not available 268 via this mechanism. 270 3. The host-meta Document Format 272 The host-meta document uses the XRD 1.0 document format as defined by 273 [OASIS.XRD-1.0], which provides a simple and extensible XML-based 274 schema for describing resources. This memo defines additional 275 processing rules needed to describe hosts. Documents MAY include any 276 XRD element not explicitly excluded. 278 The host-meta document root MUST be an "XRD" element. The document 279 SHOULD NOT include a "Subject" element, as at this time no URI is 280 available to identify hosts. The use of the "Alias" element in host- 281 meta is undefined and NOT RECOMMENDED. 283 The subject (or "context resource" as defined by 284 [I-D.nottingham-http-link-header]) of the XRD "Property" and "Link" 285 elements is the host described by the host-meta document. However, 286 the subject of "Link" elements with a "template" attribute is the 287 individual resource whose URI is applied to the link template as 288 described in Section 3.1. 290 3.1. The 'Link' Element 292 The XRD "Link" element, when used with the "href" attribute, conveys 293 a link relation between the host described by the document and a 294 common target URI. 296 For example, the following link declares a common copyright license 297 for the entire scope: 299 301 However, a "Link" element with a "template" attribute conveys a 302 relation whose context is an individual resource within the host-meta 303 document scope, and whose target is constructed by applying the 304 context resource URI to the template. The template string MAY 305 contain a URI string without any variables to represent a resource- 306 level relation that is identical for every individual resource. 308 For example, a blog with multiple authors can provide information 309 about each article's author by providing an endpoint with a parameter 310 set to the URI of each article. Each article has a unique author, 311 but all share the same pattern of where that information is located: 313 316 3.1.1. Template Syntax 318 This memo defines a simple template syntax for URI transformation. A 319 template is a string containing brace-enclosed ("{}") variable names 320 marking the parts of the string that are to be substituted by the 321 corresponding variable values. 323 Before substituting template variables, any value character other 324 than unreserved (as defined by [RFC3986]) MUST be percent-encoded per 325 [RFC3986]. 327 This memo defines a single variable - "uri" - as the entire context 328 resource URI. Protocols MAY define additional relation-specific 329 variables and syntax rules, but SHOULD only do so for protocol- 330 specific relation types, and MUST NOT change the meaning of the "uri" 331 variable. If a client is unable to successfully process a template 332 (e.g. unknown variable names, unknown or incompatible syntax) the 333 parent "Link" element SHOULD be ignored. 335 The template syntax ABNF: 337 URI-Template = *( uri-char / variable ) 338 variable = "{" var-name "}" 339 uri-char = ( reserved / unreserved / pct-encoded ) 340 var-name = %x75.72.69 / ( 1*var-char ) ; "uri" or other names 341 var-char = ALPHA / DIGIT / "." / "_" 343 For example: 345 Input: http://example.com/r?f=1 346 Template: http://example.org/?q={uri} 347 Output: http://example.org/?q=http%3A%2F%2Fexample.com%2Fr%3Ff%3D1 349 4. Processing host-meta Documents 351 Once the host-meta document has been obtained, the client processes 352 its content based on the type of information desired: host-wide or 353 resource-specific. 355 Clients usually look for a link with a specific relation type or 356 other attributes. In such cases, the client does not need to process 357 the entire host-meta document and all linked LRDD documents, but 358 instead, process the various documents in their prescribed order 359 until the desired information is found. 361 Protocols using host-meta must indicate whether the information they 362 seek is host-wide or resource-specific. For example, "obtain the 363 first host-meta resource-specific link using the 'author' relation 364 type". If both types are used for the same purpose (e.g. first look 365 for resource-specific, then look for host-wide), the protocol must 366 specify the processing order. 368 4.1. Host-Wide Information 370 When looking for host-wide information, the client MUST ignore any 371 "Link" elements with a "template" attribute, as well as any link 372 using the "lrdd" relation type. All other elements are scoped as 373 host-wide. 375 4.2. Resource-Specific Information 377 Unlike host-wide information which is contained solely within the 378 host-meta document, resource-specific information is obtained from 379 host-meta link templates, as well as from linked LRDD documents. 381 When looking for resource-specific information, the client constructs 382 a resource descriptor by collecting and processing all the host-meta 383 link templates. For each link template: 385 1. The client applies the URI of the desired resource to the 386 template, producing a resource-specific link. 388 2. If the link's relation type is other than "lrdd", the client adds 389 the link to the resource descriptor in order. 391 3. If the link's relation type is "lrdd": 393 3.1 The client obtains the LRDD document by following the 394 scheme-specific rules for the LRDD document URI. If the 395 document URI scheme is "http" or "https", the document is 396 obtained via an HTTP "GET" request to the identified URI. 397 If the HTTP response status code is 301, 302, or 307, the 398 client MUST follow the redirection response and repeat the 399 request with the provided location. 401 3.2 The client adds any link found in the LRDD document to the 402 resource descriptor in order, except for any link using the 403 "lrdd" relation type (processing is limited to a single 404 level of inclusion). When adding links, the client SHOULD 405 retain any extension attributes and child elements if 406 present (e.g. or elements). 408 3.3 The client adds any resource properties found in the LRDD 409 document to the resource descriptor in order (e.g. <Alias> 410 or <Property> child elements of the LRDD document <XRD> root 411 element). 413 A detailed example is provided in Section 1.1.1. 415 5. Security Considerations 417 The metadata returned by the host-meta resource is presumed to be 418 under the control of the appropriate authority and representative of 419 all the resources described by it. If this resource is compromised 420 or otherwise under the control of another party, it may represent a 421 risk to the security of the server and data served by it, depending 422 on what protocols use it. 424 Protocols using host-meta templates SHOULD evaluate the construction 425 of their templates as well as any protocol-specific variables or 426 syntax to ensure that the templates cannot be abused by an attacker. 427 For example, a client can be tricked into following a malicious link 428 due to a poorly constructed template which produces unexpected 429 results when its variable values contain unexpected characters. 431 Protocols MAY restrict document retrieval to HTTPS based on their 432 security needs. Protocols utilizing host-meta documents obtained via 433 other methods not described in this memo SHOULD consider the security 434 and authority risks associated with such methods. 436 6. IANA Considerations 438 6.1. The 'host-meta' Well-Known URI 440 This memo registers the "host-meta" well-known URI in the Well-Known 441 URI Registry as defined by [RFC5785]. 443 URI suffix: host-meta 445 Change controller: IETF 447 Specification document(s): [[ this document ]] 449 Related information: None 451 6.2. The 'lrdd' Relation Type 453 This specification registers the "lrdd" relation type in the Link 454 Relation Type Registry defined by [I-D.nottingham-http-link-header]: 456 Relation Name: lrdd 458 Description: "lrdd" (pronounced 'lard') is an acronym for Link-based 459 Resource Descriptor Document. It is used by the host-meta 460 document processor to locate resource-specific information about 461 individual resources. When used elsewhere (e.g. HTTP "Link" 462 header fields or HTML <LINK> elements), it operates as an include 463 directive, identifying the location of additional links and other 464 metadata. Multiple links with the 'lrdd' relation indicate 465 multiple sources to include, not alternative sources of the same 466 information. An "application/xrd+xml" representation MUST be 467 available, and this media type MAY appear in a link's "type" 468 attribute. Additional representations MAY be available (using 469 HTTP content negotiation), in which case the link's 'type' 470 attribute SHOULD be omitted. 472 Reference: [[ This specification ]] 474 Appendix A. Acknowledgments 476 The author would like to acknowledge the contributions of everyone 477 who provided feedback and use cases for this memo; in particular, 478 Dirk Balfanz, DeWitt Clinton, Blaine Cook, Eve Maler, Breno de 479 Medeiros, Brad Fitzpatrick, James Manger, Will Norris, Mark 480 Nottingham, John Panzer, Drummond Reed, and Peter Saint-Andre. 482 Appendix B. Document History 484 [[ to be removed by the RFC editor before publication as an RFC ]] 486 -12 488 o Clarified use of media type, simplified processing flow. 490 -11 492 o Editorial clarifications. 494 -10 496 o Integrated LRDD into the memo, dropping the multiple sources and 497 using only host-meta for LRDD processing. 499 -09 501 o Removed the <hm:Host> element due to lack of use cases (protocols 502 with signature requirements can define their own way of declaring 503 the document's subject for this purpose). 505 o Minor editorial changes. 507 o Changed following redirections to MUST. 509 o Updated references. 511 -08 513 o Fixed typo. 515 -07 517 o Minor editorial clarifications. 519 o Added XML schema for host-meta extension. 521 o Updated XRD reference to the latest draft (no normative changes). 523 -06 525 o Updated well-known reference to RFC 5785. 527 o Minor editorial changes. 529 o Made HTTPS a higher priority (SHOULD) over HTTP. 531 -05 533 o Adjusted syntax to the latest XRD schema. 535 o Added note about using a link template without variables. 537 -04 539 o Corrected the <hm:Host> example. 541 -03 543 o Changed scope to an entire host (per RFC 3986). 545 o Simplified template syntax to always percent-encode values and 546 vocabulary to a single 'uri' variable. 548 o Changed document retrieval to always use HTTP(S). 550 o Added security consideration about the use of templates. 552 o Explicitly defined the root element to be 'XRD'. 554 -02 556 o Changed Scope element syntax from attributes to URI-like string 557 value. 559 -01 561 o Editorial rewrite. 563 o Redefined scope as a scheme-authority pair. 565 o Added document structure section. 567 -00 569 o Initial draft. 571 7. Normative References 573 [I-D.nottingham-http-link-header] 574 Nottingham, M., "Web Linking", 575 draft-nottingham-http-link-header-10 (work in progress), 576 May 2010. 578 [OASIS.XRD-1.0] 579 Hammer-Lahav, E. and W. Norris, "Extensible Resource 580 Descriptor (XRD) Version 1.0 (work in progress)", <http:// 581 www.oasis-open.org/committees/download.php/37692/ 582 xrd-1.0-wd16.html>. 584 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 585 Requirement Levels", BCP 14, RFC 2119, March 1997. 587 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 588 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 589 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 591 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 593 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 594 Resource Identifier (URI): Generic Syntax", STD 66, 595 RFC 3986, January 2005. 597 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 598 Specifications: ABNF", STD 68, RFC 5234, January 2008. 600 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 601 Uniform Resource Identifiers (URIs)", RFC 5785, 602 April 2010. 604 [1] <https://www.ietf.org/mailman/listinfo/apps-discuss> 606 Author's Address 608 Eran Hammer-Lahav 609 Yahoo! 611 Email: eran@hueniverse.com 612 URI: http://hueniverse.com