原文

[要約] この文書は、HTTPリソース間の関係をテンプレートを用いて動的に記述するための「Link-Template」ヘッダーフィールドを定義しています。RFC 6570(URI Template)の構文を利用して、特定の変数を含むリンク構造をレスポンスヘッダーに含めることで、クライアントがプログラムから関連リソースのURLを自動生成できるようにし、APIの自己発見性と柔軟性を向上させます。

Internet Engineering Task Force (IETF)                     M. Nottingham
Request for Comments: 9652                                September 2024
Category: Standards Track                                               
ISSN: 2070-1721
        
Link-Template HTTPヘッダーフィールド
Abstract
概要

This specification defines the Link-Template HTTP header field, providing a means for describing the structure of a link between two resources so that new links can be generated.

この仕様は、リンクテンプレートHTTPヘッダーフィールドを定義し、2つのリソース間のリンクの構造を記述して、新しいリンクを生成できるようにする手段を提供します。

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 Section 2 of RFC 7841.

このドキュメントは、インターネットエンジニアリングタスクフォース(IETF)の製品です。IETFコミュニティのコンセンサスを表しています。公開レビューを受けており、インターネットエンジニアリングステアリンググループ(IESG)からの出版が承認されています。インターネット標準の詳細については、RFC 7841のセクション2で入手できます。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc9652.

このドキュメントの現在のステータス、任意のERRATA、およびそのフィードバックを提供する方法に関する情報は、https://www.rfc-editor.org/info/rfc9652で取得できます。

著作権表示
Table of Contents
目次
   1.  Introduction
     1.1.  Notational Conventions
   2.  The Link-Template Header Field
     2.1.  The 'var-base' Parameter
   3.  Security Considerations
   4.  IANA Considerations
   5.  Normative References
   Author's Address
        
1. Introduction
1. はじめに

[URI-TEMPLATE] defines a syntax for templates that, when expanded using a set of variables, results in a URI [URI].

[uri-template]は、一連の変数を使用して拡張すると、URI [URI]に拡張されるテンプレートの構文を定義します。

This specification defines a HTTP header field [HTTP] for conveying templates for links in the headers of a HTTP message. It is complimentary to the Link header field defined in Section 3 of [WEB-LINKING], which carries links directly.

この仕様では、HTTPメッセージのヘッダーにリンクのテンプレートを伝達するためのHTTPヘッダーフィールド[HTTP]を定義します。これは、[Webリンク]のセクション3で定義されているリンクヘッダーフィールドに無料であり、リンクを直接伝達します。

1.1. Notational Conventions
1.1. 表記規則

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 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

このドキュメントのキーワード "MUST"、"MUST NOT"、"REQUIRED"、"SHALL"、"SHALL NOT"、"SHOULD"、"SHOULD NOT"、"RECOMMENDED"、"NOT RECOMMENDED"、"MAY"、および "OPTIONAL" は、BCP 14 [RFC2119] [RFC8174] で説明されているように、すべて大文字で表示される場合にのみ解釈されるものとします。

This specification uses the following terms from [STRUCTURED-FIELDS]: List, String, Display String, and Parameter.

この仕様では、[構造化場]、リスト、文字列、ディスプレイ文字列、およびパラメーターの次の用語を使用します。

2. リンクテンプレートヘッダーフィールド
2.1. The 'var-base' Parameter
2.1. 「var-base」パラメーター

When a templated link has a 'var-base' Parameter, its value conveys a URI-reference that is used as a base URI for the variable names in the URI Template. This allows template variables to be globally identified, rather than specific to the context of use.

テンプレートリンクに「VARベース」パラメーターがある場合、その値はURIテンプレートの変数名のベースURIとして使用されるURI参照を伝えます。これにより、使用のコンテキストに固有ではなく、テンプレート変数をグローバルに識別できます。

Dereferencing the URI for a particular variable might lead to more information about the syntax or semantics of that variable; specification of particular formats for this information is out of scope for this document.

特定の変数に対してURIを参照すると、その変数の構文またはセマンティクスに関するより多くの情報が生じる可能性があります。この情報の特定の形式の仕様は、このドキュメントの範囲外です。

To determine the URI for a given variable, the value given is used as a base URI in reference resolution (as specified in [URI]). If the resulting URI is still relative, the context of the link is used as the base URI in a further resolution; see [WEB-LINKING].

特定の変数のURIを決定するために、指定された値は、参照解像度([URI]で指定)のベースURIとして使用されます。結果のURIがまだ相対的である場合、リンクのコンテキストは、さらなる解像度でベースURIとして使用されます。[Web-Linking]を参照してください。

For example:

例えば:

   Link-Template: "/widgets/{widget_id}";
                  rel="https://example.org/rel/widget";
                  var-base="https://example.org/vars/"
        

indicates that a resource with the relation type "https://example.org/rel/widget" can be found by expanding the "https://example.org/vars/widget_id" variable into the template given.

「https://example.org/vars/widget_id」変数を指定されたテンプレートに拡張することで、関係タイプ「https://example.org/rel/widget」を持つリソースが見つかることを示します。

If the current context of the message that the header appears within is "https://example.org/", the same information could be conveyed by this header field:

ヘッダーが内部に表示されるメッセージの現在のコンテキストが「https://example.org/」である場合、このヘッダーフィールドによって同じ情報を伝えることができます。

   Link-Template: "/widgets/{widget_id}";
                  rel="https://example.org/rel/widget";
                  var-base="/vars/"
        
3. Security Considerations
3. セキュリティに関する考慮事項

The security considerations for the Link header field in [WEB-LINKING] and those for URI Templates [URI-TEMPLATE] apply.

[Web-Linking]のリンクヘッダーフィールドとURIテンプレート[URI-Template]のセキュリティに関するセキュリティに関する考慮事項が適用されます。

Target attributes that are conveyed via Display Strings can be vulnerable to a wide variety of attacks. See [UNICODE-SECURITY] for advice regarding their handling. Specific advice is not given by this specification since there are a variety of potential use cases for such attributes.

ディスプレイ文字列を介して伝えられるターゲット属性は、さまざまな攻撃に対して脆弱です。ハンドリングに関するアドバイスについては、[Unicode-Security]を参照してください。このような属性にはさまざまな潜在的なユースケースがあるため、この仕様では具体的なアドバイスは与えられません。

4. IANA Considerations
4. IANAの考慮事項

This specification enters the "Link-Template" field name into the "Hypertext Transfer Protocol (HTTP) Field Name Registry".

この仕様は、「リンクテンプレート」フィールド名を「ハイパーテキスト転送プロトコル(HTTP)フィールド名レジストリ」に入力します。

                        +===============+===========+===============+
                        | Field Name    | Status    | Reference     |
                        +===============+===========+===============+
                        | Link-Template | Permanent | This document |
                        +---------------+-----------+---------------+

                                           Table 1
        
5. Normative References
5. 引用文献
   [HTTP]     Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
              Ed., "HTTP Semantics", STD 97, RFC 9110,
              DOI 10.17487/RFC9110, June 2022,
              <https://www.rfc-editor.org/info/rfc9110>.
        
   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.
        
   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.
        
   [STRUCTURED-FIELDS]
              Nottingham, M. and P-H. Kamp, "Structured Field Values for
              HTTP", RFC 9651, DOI 10.17487/RFC9651, September 2024,
              <https://www.rfc-editor.org/info/rfc9651>.
        
   [UNICODE-SECURITY]
              Davis, M. and M. Suignard, "Unicode Security
              Considerations", Unicode Technical Report #16, 19
              September 2014, <https://www.unicode.org/reports/tr36/>.
              Latest version available at
              <https://www.unicode.org/reports/tr36/>.
        
   [URI]      Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
              Resource Identifier (URI): Generic Syntax", STD 66,
              RFC 3986, DOI 10.17487/RFC3986, January 2005,
              <https://www.rfc-editor.org/info/rfc3986>.
        
   [URI-TEMPLATE]
              Gregorio, J., Fielding, R., Hadley, M., Nottingham, M.,
              and D. Orchard, "URI Template", RFC 6570,
              DOI 10.17487/RFC6570, March 2012,
              <https://www.rfc-editor.org/info/rfc6570>.
        
   [WEB-LINKING]
              Nottingham, M., "Web Linking", RFC 8288,
              DOI 10.17487/RFC8288, October 2017,
              <https://www.rfc-editor.org/info/rfc8288>.
        
Author's Address
著者の連絡先
   Mark Nottingham
   Prahran
   Australia
   Email: mnot@mnot.net
   URI:   https://www.mnot.net/