1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893
|
<pre>Internet Engineering Task Force (IETF) E. Hammer-Lahav, Ed.
Request for Comments: 6415 B. Cook
Category: Standards Track October 2011
ISSN: 2070-1721
<span class="h1">Web Host Metadata</span>
Abstract
This specification describes a method for locating host metadata as
well as information about individual resources controlled by the
host.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc6415">http://www.rfc-editor.org/info/rfc6415</a>.
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
<a href="#section-1.1">1.1</a>. Example ....................................................<a href="#page-3">3</a>
<a href="#section-1.1.1">1.1.1</a>. Processing Resource-Specific Information ............<a href="#page-4">4</a>
<a href="#section-1.2">1.2</a>. Notational Conventions .....................................<a href="#page-5">5</a>
<a href="#section-2">2</a>. Obtaining host-meta Documents ...................................<a href="#page-6">6</a>
<a href="#section-3">3</a>. The host-meta Document ..........................................<a href="#page-6">6</a>
<a href="#section-3.1">3.1</a>. XML Document Format ........................................<a href="#page-7">7</a>
<a href="#section-3.1.1">3.1.1</a>. The "Link" Element ..................................<a href="#page-7">7</a>
<a href="#section-4">4</a>. Processing host-meta Documents ..................................<a href="#page-8">8</a>
<a href="#section-4.1">4.1</a>. Host-Wide Information ......................................<a href="#page-9">9</a>
<a href="#section-4.2">4.2</a>. Resource-Specific Information ..............................<a href="#page-9">9</a>
<a href="#section-5">5</a>. Security Considerations ........................................<a href="#page-10">10</a>
<a href="#section-6">6</a>. IANA Considerations ............................................<a href="#page-11">11</a>
<a href="#section-6.1">6.1</a>. The "host-meta" Well-Known URI ............................<a href="#page-11">11</a>
<a href="#section-6.2">6.2</a>. The "host-meta.json" Well-Known URI .......................<a href="#page-11">11</a>
<a href="#section-6.3">6.3</a>. The "lrdd" Relation Type ..................................<a href="#page-11">11</a>
<a href="#appendix-A">Appendix A</a>. JRD Document Format ...................................<a href="#page-12">12</a>
<a href="#appendix-B">Appendix B</a>. Acknowledgments .......................................<a href="#page-15">15</a>
Normative References ..............................................<a href="#page-15">15</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
Web-based protocols often require the discovery of host policy or
metadata, where "host" is not a single resource but the entity
controlling the collection of resources identified by Uniform
Resource Identifiers (URIs) with a common URI host [<a href="./rfc3986" title=""Uniform Resource Identifier (URI): Generic Syntax"">RFC3986</a>], which
can be served by one or more servers.
While web protocols have a wide range of metadata needs, they often
use metadata that is concise, has simple syntax requirements, and can
benefit from storing their metadata in a common location used by
other related protocols.
Because there is no URI or representation available to describe a
host, many of the methods used for associating per-resource metadata
(such as HTTP headers) are not available. This often leads to the
overloading of the root HTTP resource (e.g., 'http://example.com/')
with host metadata that is not specific or relevant to the root
resource itself.
This document defines a lightweight metadata document format for
describing hosts (thus the name "host-meta"), intended for use by
web-based protocols. This document also registers the well-known URI
suffix "host-meta" in the Well-Known URI Registry established by
[<a href="./rfc5785" title=""Defining Well-Known Uniform Resource Identifiers (URIs)"">RFC5785</a>].
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
In addition, there are times when a host-wide scope for policy or
metadata is too coarse-grained. host-meta provides two mechanisms for
providing resource-specific information:
o Link Templates - links using a URI template instead of a fixed
target URI, providing a way to define generic rules for generating
resource-specific links by applying the individual resource URI to
the template.
o Link-based Resource Descriptor Documents (LRDD, pronounced 'lard')
- descriptor documents providing resource-specific information,
typically information that cannot be expressed using link
templates. LRDD documents are linked to resources or host-meta
documents using link templates with the "lrdd" relation type.
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Example</span>
The following is a simple host-meta document including both host-wide
and resource-specific information for the 'example.com' host:
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<!-- Host-Wide Information -->
<Property type='http://protocol.example.net/version'>1.0</Property>
<Link rel='copyright'
href='http://example.com/copyright' />
<!-- Resource-specific Information -->
<Link rel='hub'
template='http://example.com/hub' />
<Link rel='lrdd'
type='application/xrd+xml'
template='http://example.com/lrdd?uri={uri}' />
<Link rel='author'
template='http://example.com/author?q={uri}' />
</XRD>
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
The host-wide information that applies to the host in its entirety
provided by the document includes:
o An "http://protocol.example.net/version" host property with a
value of "1.0".
o A link to the host's copyright policy ("copyright").
The resource-specific information provided by the document includes:
o A link template for receiving real-time updates ("hub") about
individual resources. Since the template does not include a
template variable, the target URI is identical for all resources.
o A LRDD document link template ("lrdd") for obtaining additional
resource-specific information contained in a separate document for
each individual resource.
o A link template for finding information about the author of
individual resources ("author").
<span class="h4"><a class="selflink" id="section-1.1.1" href="#section-1.1.1">1.1.1</a>. Processing Resource-Specific Information</span>
When looking for information about an individual resource -- for
example, the resource identified by 'http://example.com/xy' -- the
resource URI is applied to the templates found, producing the
following links:
<Link rel='hub'
href='http://example.com/hub' />
<Link rel='lrdd'
type='application/xrd+xml'
href='http://example.com/lrdd?uri=http%3A%2F%2Fexample.com%2Fxy' />
<Link rel='author'
href='http://example.com/author?q=http%3A%2F%2Fexample.com%2Fxy' />
The LRDD document for 'http://example.com/xy' (obtained via an HTTP
"GET" request):
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<Subject>http://example.com/xy</Subject>
<Property type='http://spec.example.net/color'>red</Property>
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
<Link rel='hub'
href='http://example.com/another/hub' />
<Link rel='author'
href='http://example.com/john' />
</XRD>
Together, the information available about the individual resource
(presented as an Extensible Resource Descriptor (XRD) document for
illustration purposes) is:
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<Subject>http://example.com/xy</Subject>
<Property type='http://spec.example.net/color'>red</Property>
<Link rel='hub'
href='http://example.com/hub' />
<Link rel='hub'
href='http://example.com/another/hub' />
<Link rel='author'
href='http://example.com/john' />
<Link rel='author'
href='http://example.com/author?q=http%3A%2F%2Fexample.com%2Fxy' />
</XRD>
Note that the order of links matters and is based on their original
order in the host-meta and LRDD documents. For example, the "hub"
link obtained from the host-meta link template has a higher priority
than the link found in the LRDD document because the host-meta link
appears before the "lrdd" link.
On the other hand, the "author" link found in the LRDD document has a
higher priority than the link found in the host-meta document because
it appears after the "lrdd" link.
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. Notational Conventions</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
This document uses the Augmented Backus-Naur Form (ABNF) notation of
[<a href="./rfc5234" title=""Augmented BNF for Syntax Specifications: ABNF"">RFC5234</a>]. Additionally, the following rules are included from
[<a href="./rfc3986" title=""Uniform Resource Identifier (URI): Generic Syntax"">RFC3986</a>]: reserved, unreserved, and pct-encoded.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Obtaining host-meta Documents</span>
The client obtains the host-meta document for a given host by sending
an HTTP [<a href="./rfc2616" title=""Hypertext Transfer Protocol -- HTTP/1.1"">RFC2616</a>] or an HTTPS [<a href="./rfc2818" title=""HTTP Over TLS"">RFC2818</a>] GET request to the host for
the "/.well-known/host-meta" path, using the default ports defined
for each protocol (e.g., port 80 for HTTP and port 443 for HTTPS).
The scope and meaning of host-meta documents obtained via other
protocols or ports is undefined.
The server MUST support at least one protocol but MAY support both.
If both protocols are supported, they MUST produce the same document.
The decision as to which protocol is used to obtain the host-meta
document has significant security ramifications, as described in
<a href="#section-5">Section 5</a>.
For example, the following request is used to obtain the host-meta
document for the 'example.com' host:
GET /.well-known/host-meta HTTP/1.1
Host: example.com
If the server response indicates that the host-meta resource is
located elsewhere (a 301, 302, or 307 response status code), the
client SHOULD try to obtain the resource from the location provided
in the response. This means that the host-meta document for one host
MAY be retrieved from another host. Likewise, if the resource is not
available or does not exist (e.g., a 404 or 410 response status
code), the client SHOULD infer that metadata is not available via
this mechanism.
The host-meta document SHOULD be served with the
"application/xrd+xml" media type.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. The host-meta Document</span>
The host-meta document uses the XRD 1.0 document format as defined by
[<a href="#ref-OASIS.XRD-1.0">OASIS.XRD-1.0</a>], which provides a simple and extensible XML-based
schema for describing resources. This specification defines
additional processing rules needed to describe hosts. Documents MAY
include any elements included in the XRD 1.0 schema that are not
explicitly excluded by this specification.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
The server MAY offer alternative representations of any XRD document
it serves (host-meta, LRDD, or other XRD-based documents). The
client MAY request a particular representation using the HTTP
"Accept" request header field. If no "Accept" request header field
is included with the request, or if the client requests an
"application/xrd+xml" representation, the server MUST respond using
the REQUIRED XRD 1.0 XML representation described in <a href="#section-3.1">Section 3.1</a>.
Applications using the host-meta document MAY require the server to
provide a specific alternative representation in addition to the
XRD 1.0 XML representation when explicitly requested by the client.
A JavaScript Object Notation (JSON) Resource Descriptor, known as
JRD, is described in <a href="#appendix-A">Appendix A</a>. It is RECOMMENDED that servers
offer the JRD representation in addition to the XRD representation.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. XML Document Format</span>
The host-meta document root MUST be an "XRD" element. The document
SHOULD NOT include a "Subject" element, as at this time no URI is
available to identify hosts. The use of the "Alias" element in
host-meta is undefined and NOT RECOMMENDED.
The subject (or "context IRI", as defined by [<a href="./rfc5988" title=""Web Linking"">RFC5988</a>]) of the XRD
"Property" and "Link" elements is the host described by the host-meta
document. However, the subject of "Link" elements with a "template"
attribute is the individual resource whose URI is applied to the link
template, as described in <a href="#section-3.1.1">Section 3.1.1</a>.
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a>. The "Link" Element</span>
The XRD "Link" element, when used with the "href" attribute, conveys
a link relation between the host described by the document and a
common target URI.
For example, the following link declares a common copyright license
for the entire scope:
<Link rel='copyright' href='http://example.com/copyright' />
However, a "Link" element with a "template" attribute conveys a
relation whose context is an individual resource within the host-meta
document scope, and whose target is constructed by applying the
context resource URI to the template. The template string MAY
contain a URI string without any variables to represent a resource-
level relation that is identical for every individual resource.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
For example, a blog with multiple authors can provide information
about each article's author by providing an endpoint with a parameter
set to the URI of each article. Each article has a unique author,
but all share the same pattern of where that information is located:
<Link rel='author'
template='http://example.com/author?article={uri}' />
<span class="h5"><a class="selflink" id="section-3.1.1.1" href="#section-3.1.1.1">3.1.1.1</a>. Template Syntax</span>
This specification defines a simple template syntax for URI
transformation. A template is a string containing brace-enclosed
("{}") variable names marking the parts of the string that are to be
substituted by the corresponding variable values.
Before substituting template variables, values MUST be encoded using
UTF-8, and any character other than unreserved (as defined by
[<a href="./rfc3986" title=""Uniform Resource Identifier (URI): Generic Syntax"">RFC3986</a>]) MUST be percent-encoded per [<a href="./rfc3986" title=""Uniform Resource Identifier (URI): Generic Syntax"">RFC3986</a>].
This specification defines a single variable -- "uri" -- as the
entire context resource URI. Protocols MAY define additional
relation-specific variables and syntax rules, but SHOULD only do so
for protocol-specific relation types, and MUST NOT change the meaning
of the "uri" variable. If a client is unable to successfully process
a template (e.g., unknown variable names, unknown or incompatible
syntax), the parent "Link" element SHOULD be ignored.
The template syntax ABNF follows:
URI-Template = *( uri-char / variable )
variable = "{" var-name "}"
uri-char = ( reserved / unreserved / pct-encoded )
var-name = %x75.72.69 / ( 1*var-char ) ; "uri" or other names
var-char = ALPHA / DIGIT / "." / "_"
For example:
Input: http://example.com/r?f=1
Template: http://example.org/?q={uri}
Output: http://example.org/?q=http%3A%2F%2Fexample.com%2Fr%3Ff%3D1
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Processing host-meta Documents</span>
Once the host-meta document has been obtained, the client processes
its content based on the type of information desired: host-wide or
resource-specific.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
Clients usually look for a link with a specific relation type or
other attributes. In such cases, the client does not need to process
the entire host-meta document and all linked LRDD documents, but
instead process the various documents in their prescribed order until
the desired information is found.
Protocols using host-meta must indicate whether the information they
seek is host-wide or resource-specific -- for example, "obtain the
first host-meta resource-specific link using the 'author' relation
type". If both types are used for the same purpose (e.g., first look
for resource-specific, then look for host-wide), the protocol must
specify the processing order.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Host-Wide Information</span>
When looking for host-wide information, the client MUST ignore any
"Link" elements with a "template" attribute, as well as any link
using the "lrdd" relation type. All other elements are scoped as
host-wide.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. Resource-Specific Information</span>
Unlike host-wide information, which is contained solely within the
host-meta document, resource-specific information is obtained from
host-meta link templates, as well as from linked LRDD documents.
When looking for resource-specific information, the client constructs
a resource descriptor by collecting and processing all the host-meta
link templates. For each link template:
1. The client applies the URI of the desired resource to the
template, producing a resource-specific link.
2. If the link's relation type is other than "lrdd", the client adds
the link to the resource descriptor in order.
3. If the link's relation type is "lrdd":
3.1. The client obtains the LRDD document by following the
scheme-specific rules for the LRDD document URI. If the
document URI scheme is "http" or "https", the document is
obtained via an HTTP "GET" request to the identified URI.
If the HTTP response status code is 301, 302, or 307, the
client MUST follow the redirection response and repeat the
request with the provided location.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
3.2. The client adds any links found in the LRDD document to the
resource descriptor in order, except for any link using the
"lrdd" relation type (processing is limited to a single
level of inclusion). When adding links, the client SHOULD
retain any extension attributes and child elements if
present (e.g., <Property> or <Title> elements).
3.3. The client adds any resource properties found in the LRDD
document to the resource descriptor in order (e.g., <Alias>
or <Property> child elements of the LRDD document <XRD>
root element).
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span>
The host-meta document is designed to be used by other applications
explicitly "opting-in" to use the facility. Therefore, any such
application MUST review the specific security implications of using
host-meta documents. By itself, this specification does not provide
any protections or guarantees that any given host-meta document is
under the control of the appropriate entity as required by each
application.
The metadata returned by the host-meta resource is presumed to be
under the control of the appropriate authority and representative of
all the resources described by it. If this resource is compromised
or otherwise under the control of another party, it may represent a
risk to the security of the server and data served by it, depending
on the applications using it.
Applications utilizing the host-meta document where the authenticity
of the information is necessary MUST require the use of the HTTPS
protocol and MUST NOT produce a host-meta document using other means.
In addition, such applications MUST require that any redirection
leading to the retrieval of a host-meta document also utilize the
HTTPS protocol.
Since the host-meta document is authoritative for the entire host,
not just the authority (combination of scheme, host, and port) of the
host-meta document server, applications MUST ensure that using a
host-meta document for another URI authority does not represent a
potential security exploit.
Protocols using host-meta templates must evaluate the construction of
their templates as well as any protocol-specific variables or syntax
to ensure that the templates cannot be abused by an attacker. For
example, a client can be tricked into following a malicious link due
to a poorly constructed template that produces unexpected results
when its variable values contain unexpected characters.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. IANA Considerations</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. The "host-meta" Well-Known URI</span>
This specification registers the "host-meta" well-known URI in the
Well-Known URI Registry as defined by [<a href="./rfc5785" title=""Defining Well-Known Uniform Resource Identifiers (URIs)"">RFC5785</a>].
URI suffix: host-meta
Change controller: IETF
Specification document(s): <a href="./rfc6415">RFC 6415</a>
Related information: The "host-meta" documents obtained from the
same host using the HTTP and HTTPS protocols (using default ports)
MUST be identical.
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. The "host-meta.json" Well-Known URI</span>
This specification registers the "host-meta.json" well-known URI in
the Well-Known URI Registry as defined by [<a href="./rfc5785" title=""Defining Well-Known Uniform Resource Identifiers (URIs)"">RFC5785</a>].
URI suffix: host-meta.json
Change controller: IETF
Specification document(s): <a href="./rfc6415">RFC 6415</a>
Related information: The "host-meta.json" documents obtained from
the same host using the HTTP and HTTPS protocols (using default
ports) MUST be identical.
<span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a>. The "lrdd" Relation Type</span>
This specification registers the "lrdd" relation type in the Link
Relation Type Registry defined by [<a href="./rfc5988" title=""Web Linking"">RFC5988</a>]:
Relation Name: lrdd
Description: Refers to further information about the link's context,
expressed as a LRDD ("Link-based Resource Descriptor Document")
resource. See <a href="./rfc6415">RFC 6415</a> for information about processing this
relation type in host-meta documents. When used elsewhere, it
refers to additional links and other metadata. Multiple instances
indicate additional LRDD resources. LRDD resources MUST have an
"application/xrd+xml" representation, and MAY have others.
Reference: <a href="./rfc6415">RFC 6415</a>
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. JRD Document Format</span>
The JRD document format -- a general-purpose XRD 1.0 representation
-- uses the JavaScript Object Notation (JSON) format defined in
[<a href="./rfc4627" title=""The application/json Media Type for JavaScript Object Notation (JSON)"">RFC4627</a>]. JRD uses the same elements and processing rules described
in <a href="#section-3.1">Section 3.1</a>. The JRD format is designed to include the same base
functionality provided by the XML format, with the exception of
extensibility, as extensibility is beyond the scope of this
specification.
The client MAY request a JRD representation using the HTTP "Accept"
request header field with a value of "application/json". The server
MUST include the HTTP "Content-Type" response header field with a
value of "application/json". Any other "Content-Type" value (or lack
thereof) indicates that the server does not support the JRD format.
Alternatively, the client MAY request a JRD representation by
requesting the "host-meta.json" well-known document, by making a GET
request for "/.well-known/host-meta.json", following the same process
used for "/.well-known/host-meta". If the server does not support
serving a JRD representation at this location, the server MUST
respond with an HTTP 404 (Not Found) status code.
XRD elements are serialized into a JSON object as follows:
o The XML document declaration and "XRD" element are discarded.
o The "Subject" element is included as a name/value pair with the
name 'subject', and value included as a string.
o The "Expires" element is included as a name/value pair with the
name 'expires', and value included as a string.
o "Alias" elements are included as a single name/value pair with the
name 'aliases', and value a string array containing the values of
each element in order.
o "Property" elements are included as a single name/value pair with
the name 'properties', and value an object with each element
included as a name/value pair with the value of the "type"
attribute as name, and element value included as a string value.
The values of properties with empty values (i.e., using the
REQUIRED "xsi:nil='true'" attribute) are included as null. If
more than one "Property" element is present with the same "type"
attribute, only the last instance is included.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
o "Link" elements are included as a single name/value pair with the
name 'links', and value an array with each element included as an
object. Each attribute is included as a name/value pair with the
attribute name as name, and value included as a string.
o "Link" child "Property" elements are included using the same
method as XRD-level "Property" elements using a name/value pair
inside the link object.
o "Link" child "Title" elements are included as a single object with
the name 'titles', and value an object with each element included
as a name/value pair with the value of the "xml:lang" attribute as
name, and element value included as a string value. The names of
elements without an "xml:lang" attribute are added with the name
'default'. If more than one "Title" element is present with the
same (or no) "xml:lang" attribute, only the last instance is
included.
o The conversion of any other element is left undefined.
For example, the following XRD document...
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<Subject>http://blog.example.com/article/id/314</Subject>
<Expires>2010-01-30T09:30:00Z</Expires>
<Alias>http://blog.example.com/cool_new_thing</Alias>
<Alias>http://blog.example.com/steve/article/7</Alias>
<Property type='http://blgx.example.net/ns/version'>1.2</Property>
<Property type='http://blgx.example.net/ns/version'>1.3</Property>
<Property type='http://blgx.example.net/ns/ext' xsi:nil='true' />
<Link rel='author' type='text/html'
href='http://blog.example.com/author/steve'>
<Title>About the Author</Title>
<Title xml:lang='en-us'>Author Information</Title>
<Property type='http://example.com/role'>editor</Property>
</Link>
<Link rel='author' href='http://example.com/author/john'>
<Title>The other guy</Title>
<Title>The other author</Title>
</Link>
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
<Link rel='copyright'
template='http://example.com/copyright?id={uri}' />
</XRD>
...is represented by the following JRD document:
{
"subject":"http://blog.example.com/article/id/314",
"expires":"2010-01-30T09:30:00Z",
"aliases":[
"http://blog.example.com/cool_new_thing",
"http://blog.example.com/steve/article/7"],
"properties":{
"http://blgx.example.net/ns/version":"1.3",
"http://blgx.example.net/ns/ext":null
},
"links":[
{
"rel":"author",
"type":"text/html",
"href":"http://blog.example.com/author/steve",
"titles":{
"default":"About the Author",
"en-us":"Author Information"
},
"properties":{
"http://example.com/role":"editor"
}
},
{
"rel":"author",
"href":"http://example.com/author/john",
"titles":{
"default":"The other author"
}
},
{
"rel":"copyright",
"template":"http://example.com/copyright?id={uri}"
}
]
}
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
Note that the "Subject" and "Alias" elements are NOT RECOMMENDED in
the context of host-meta documents, and are included in the example
for completeness only.
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. Acknowledgments</span>
The authors would like to acknowledge the contributions of everyone
who provided feedback and use cases for this specification -- in
particular, Dirk Balfanz, DeWitt Clinton, Eve Maler, Breno de
Medeiros, Brad Fitzpatrick, James Manger, Will Norris, Mark
Nottingham, John Panzer, Drummond Reed, and Peter Saint-Andre.
Normative References
[<a id="ref-OASIS.XRD-1.0">OASIS.XRD-1.0</a>]
Hammer-Lahav, E., Ed., and W. Norris, Ed., "Extensible
Resource Descriptor (XRD) Version 1.0", November 2010,
<<a href="http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html">http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html</a>>.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC2616">RFC2616</a>] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", <a href="./rfc2616">RFC 2616</a>, June 1999.
[<a id="ref-RFC2818">RFC2818</a>] Rescorla, E., "HTTP Over TLS", <a href="./rfc2818">RFC 2818</a>, May 2000.
[<a id="ref-RFC3986">RFC3986</a>] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
<a href="./rfc3986">RFC 3986</a>, January 2005.
[<a id="ref-RFC4627">RFC4627</a>] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", <a href="./rfc4627">RFC 4627</a>, July 2006.
[<a id="ref-RFC5234">RFC5234</a>] Crocker, D., Ed., and P. Overell, "Augmented BNF for
Syntax Specifications: ABNF", STD 68, <a href="./rfc5234">RFC 5234</a>,
January 2008.
[<a id="ref-RFC5785">RFC5785</a>] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known
Uniform Resource Identifiers (URIs)", <a href="./rfc5785">RFC 5785</a>,
April 2010.
[<a id="ref-RFC5988">RFC5988</a>] Nottingham, M., "Web Linking", <a href="./rfc5988">RFC 5988</a>, October 2010.
<span class="grey">Hammer-Lahav & Cook Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc6415">RFC 6415</a> host-meta October 2011</span>
Authors' Addresses
Eran Hammer-Lahav (editor)
EMail: eran@hueniverse.com
URI: <a href="http://hueniverse.com">http://hueniverse.com</a>
Blaine Cook
EMail: romeda@gmail.com
URI: <a href="http://romeda.org">http://romeda.org</a>
Hammer-Lahav & Cook Standards Track [Page 16]
</pre>
|