Internet Engineering Task Force (IETF) L. Dusseault Request for Comments: 5789 Linden Lab Category: Standards Track J. Snell ISSN: 2070-1721 March 2010
PATCH Method for HTTP
Abstract
抽象
Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource.
ハイパーテキスト転送プロトコル(HTTP)に延びる複数のアプリケーションは、部分的なリソースの変更を行うための機能が必要です。既存のHTTP PUTメソッドは、ドキュメントの完全な交換を可能にします。この提案は、既存のHTTPリソースを変更するために、新しいHTTPメソッド、PATCHを追加します。
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 5741.
このドキュメントはインターネットエンジニアリングタスクフォース(IETF)の製品です。これは、IETFコミュニティの総意を表しています。これは、公開レビューを受けており、インターネットエンジニアリング運営グループ(IESG)によって公表のために承認されています。インターネット標準の詳細については、RFC 5741のセクション2で利用可能です。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc5789.
このドキュメントの現在の状態、任意の正誤表、そしてどのようにフィードバックを提供するための情報がhttp://www.rfc-editor.org/info/rfc5789で取得することができます。
Copyright Notice
著作権表示
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.
著作権(C)2010 IETF信託とドキュメントの作成者として特定の人物。全著作権所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) 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.
この文書では、BCP 78と、この文書の発行日に有効なIETFドキュメント(http://trustee.ietf.org/license-info)に関連IETFトラストの法律の規定に従うものとします。彼らは、この文書に関してあなたの権利と制限を説明するように、慎重にこれらの文書を確認してください。コードコンポーネントは、トラスト法規定のセクションで説明4.eおよび簡体BSDライセンスで説明したように、保証なしで提供されているよう簡体BSDライセンスのテキストを含める必要があり、この文書から抽出されました。
Table of Contents
目次
1. Introduction ....................................................2 2. The PATCH Method ................................................2 2.1. A Simple PATCH Example .....................................4 2.2. Error Handling .............................................5 3. Advertising Support in OPTIONS ..................................7 3.1. The Accept-Patch Header ....................................7 3.2. Example OPTIONS Request and Response .......................7 4. IANA Considerations .............................................8 4.1. The Accept-Patch Response Header ...........................8 5. Security Considerations .........................................8 6. References ......................................................9 6.1. Normative References .......................................9 6.2. Informative References .....................................9 Appendix A. Acknowledgements .....................................10
This specification defines the new HTTP/1.1 [RFC2616] method, PATCH, which is used to apply partial modifications to a resource.
この仕様は、リソースへの部分的な変更を適用するために使用される新しいHTTP / 1.1 [RFC2616]方法、パッチを、定義します。
A new method is necessary to improve interoperability and prevent errors. The PUT method is already defined to overwrite a resource with a complete new body, and cannot be reused to do partial changes. Otherwise, proxies and caches, and even clients and servers, may get confused as to the result of the operation. POST is already used but without broad interoperability (for one, there is no standard way to discover patch format support). PATCH was mentioned in earlier HTTP specifications, but not completely defined.
新しい方法は、相互運用性を改善し、エラーを防止する必要があります。 PUTメソッドは、すでに完全に新しいボディを持つリソースを上書きするために定義されており、部分的な変更を行うために再利用することはできません。それ以外の場合は、プロキシやキャッシュ、さらにはクライアントとサーバは、操作の結果に関しては混乱してしまうことがあります。 POSTは既に使用されていますが、広範な相互運用性なし(1のため、パッチ・フォーマットのサポートを発見するための標準的な方法はありません)。 PATCHは、以前のHTTP仕様書に記載されたが、完全に定義されていませんでした。
In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC2119].
この文書では、キーワード "MUST"、 "MUST NOT"、 "REQUIRED"、 "NOT SHALL"、 "推奨"、 "すべきではない" "べきである" "ないものと"、 "MAY"、および "オプション" [RFC2119]に記載されているように解釈されるべきです。
Furthermore, this document uses the ABNF syntax defined in Section 2.1 of [RFC2616].
さらに、このドキュメントは[RFC2616]のセクション2.1で定義されたABNF構文を使用します。
The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. The set of changes is represented in a format called a "patch document" identified by a media type. If the Request-URI does not point to an existing resource, the server MAY create a new resource, depending on the patch document type (whether it can logically modify a null resource) and permissions, etc.
PATCHメソッドは、要求エンティティに記載の変更のセットがRequest-URIで識別されるリソースに適用されることを要求します。変更のセットは、メディアタイプによって識別される「パッチ・ドキュメント」と呼ばれる形式で表現されます。リクエスト-URIが既存のリソースを指していない場合は、サーバー等、パッチのドキュメントの種類に応じて、(それは論理的にヌルリソースを変更できるかどうか)と権限、新しいリソースを作成することができ
The difference between the PUT and PATCH requests is reflected in the way the server processes the enclosed entity to modify the resource identified by the Request-URI. In a PUT request, the enclosed entity is considered to be a modified version of the resource stored on the origin server, and the client is requesting that the stored version be replaced. With PATCH, however, the enclosed entity contains a set of instructions describing how a resource currently residing on the origin server should be modified to produce a new version. The PATCH method affects the resource identified by the Request-URI, and it also MAY have side effects on other resources; i.e., new resources may be created, or existing ones modified, by the application of a PATCH.
PUTとPATCHリクエストの差は、サーバがRequest-URIによって識別されるリソースを変更するために同封エンティティを処理する方法に反映されます。 PUT要求に、囲まれたエンティティはオリジンサーバ上に格納されたリソースの修正バージョンであると考えられ、そしてクライアントは、格納されたバージョンを交換することを要求されます。パッチでは、しかし、囲まれたエンティティは、現在、オリジンサーバ上にあるリソースは、新しいバージョンを生成するように変更する必要がある方法を記述する一連の命令が含まれています。 PATCHメソッドは、Request-URIで識別されるリソースに影響を与え、それはまた、他のリソースへの副作用を有していてもよいです。すなわち、新しいリソースが作成されてもよいし、既存のものは、パッチの適用によって、修飾します。
PATCH is neither safe nor idempotent as defined by [RFC2616], Section 9.1.
[RFC2616]、セクション9.1で定義されているパッチは安全でも冪等でもありません。
A PATCH request can be issued in such a way as to be idempotent, which also helps prevent bad outcomes from collisions between two PATCH requests on the same resource in a similar time frame. Collisions from multiple PATCH requests may be more dangerous than PUT collisions because some patch formats need to operate from a known base-point or else they will corrupt the resource. Clients using this kind of patch application SHOULD use a conditional request such that the request will fail if the resource has been updated since the client last accessed the resource. For example, the client can use a strong ETag [RFC2616] in an If-Match header on the PATCH request.
PATCHリクエストも同様の時間枠内で同じリソース上の2つのPATCH要求間の衝突から悪い結果を防ぐことができますされ、冪等するような方法で発行することができます。いくつかのパッチフォーマットが知られている基点から操作する必要があるか、リソース他に、彼らが破壊するので、複数のPATCHリクエストからの衝突はPUTの衝突よりも危険かもしれません。パッチこの種のアプリケーションを使用するクライアントは、クライアントが最後のリソースにアクセスするので、リソースが更新されている場合、要求は失敗するような条件付きの要求を使用すべきです。例えば、クライアントは、パッチリクエストに応じたIf-Matchヘッダに強いのETag [RFC2616]を使用することができます。
There are also cases where patch formats do not need to operate from a known base-point (e.g., appending text lines to log files, or non-colliding rows to database tables), in which case the same care in client requests is not needed.
クライアント要求で同じケアを必要とされていない場合には、パッチの形式(例えば、テキスト行を追加すると、ログファイルに、またはデータベーステーブルに行を非衝突)知ら基点から操作する必要がない場合もあります。
The server MUST apply the entire set of changes atomically and never provide (e.g., in response to a GET during this operation) a partially modified representation. If the entire patch document cannot be successfully applied, then the server MUST NOT apply any of the changes. The determination of what constitutes a successful PATCH can vary depending on the patch document and the type of resource(s) being modified. For example, the common 'diff' utility can generate a patch document that applies to multiple files in a directory hierarchy. The atomicity requirement holds for all directly affected files. See "Error Handling", Section 2.2, for details on status codes and possible error conditions.
サーバは、アトミック変更のセット全体を適用し、部分的に修飾された表現(この動作中GETに応答して、例えば)を提供してはいけません。パッチ全体の文書が正常に適用することができない場合、サーバは、変更のいずれかを適用してはなりません。成功したパッチを構成するものの決意は、パッチドキュメントと改変されたリソース(単数または複数)の種類に応じて変えることができます。たとえば、共通の「差分」ユーティリティは、ディレクトリ階層内の複数のファイルに適用されるパッチのドキュメントを生成することができます。アトミック要件はすべて直接影響を受けるファイルのために保持しています。ステータスコードと可能なエラー条件の詳細については、「エラー処理」、2.2節を参照してください。
If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. A response to this method is only cacheable if it contains explicit freshness information (such as an Expires header or "Cache-Control: max-age" directive) as well as the Content-Location header matching the Request-URI, indicating that the PATCH response body is a resource representation. A cached PATCH response can only be used to respond to subsequent GET and HEAD requests; it MUST NOT be used to respond to other methods (in particular, PATCH).
要求がキャッシュを通過し、要求URIが一つ以上の現在キャッシュされたエンティティを識別した場合、それらのエントリが古くなったとして扱われるべきです。 PATCHことを示し、並びにのRequest-URIに一致のContent-Locationヘッダ:それは明示的な鮮度情報(指令ヘッダまたは「MAX-年齢のCache-Control」の有効期限など)が含まれている場合、このメソッドへの応答は、キャッシュ可能ですレスポンスボディは、リソース表現です。キャッシュされたPATCH応答は、その後のGETとHEADリクエストに応答するために使用することができます。 (特に、PATCHで)他の方法に対応するために使用してはいけません。
Note that entity-headers contained in the request apply only to the contained patch document and MUST NOT be applied to the resource being modified. Thus, a Content-Language header could be present on the request, but it would only mean (for whatever that's worth) that the patch document had a language. Servers SHOULD NOT store such headers except as trace information, and SHOULD NOT use such header values the same way they might be used on PUT requests. Therefore, this document does not specify a way to modify a document's Content-Type or Content-Language value through headers, though a mechanism could well be designed to achieve this goal through a patch document.
要求に含まれるエンティティヘッダが含まれているパッチの文書にのみ適用され、変更されたリソースに適用されてはならないことに注意してください。このように、コンテンツ-Languageヘッダは、リクエストに応じて存在し得るが、それは唯一のパッチドキュメントは言語を持っていたこと(何のためにそれは価値がある)を意味します。サーバーは、トレース情報として以外に、このようなヘッダを保存しないでください、そして、そのようなヘッダ値に彼らがPUT要求に使用されるかもしれないのと同じ方法を使用しないでください。メカニズムがうまくパッチ文書を通じてこの目標を達成するために設計することができるもののしたがって、この文書は、ヘッダをドキュメントのContent-Typeやコンテンツ言語の値を変更する方法を指定しません。
There is no guarantee that a resource can be modified with PATCH. Further, it is expected that different patch document formats will be appropriate for different types of resources and that no single format will be appropriate for all types of resources. Therefore, there is no single default patch document format that implementations are required to support. Servers MUST ensure that a received patch document is appropriate for the type of resource identified by the Request-URI.
リソースがPATCHで変更することができるという保証はありません。さらに、別のパッチの文書フォーマットは、リソースの種類ごと及び単一のフォーマットは、すべてのタイプのリソースのために適切ではないことを適切であることが期待されます。そのため、実装がサポートするのに必要とされる単一のデフォルトのパッチの文書フォーマットはありません。サーバは、受信したパッチ文書がRequest-URIによって識別されるリソースのタイプに適していることを確認しなければなりません。
Clients need to choose when to use PATCH rather than PUT. For example, if the patch document size is larger than the size of the new resource data that would be used in a PUT, then it might make sense to use PUT instead of PATCH. A comparison to POST is even more difficult, because POST is used in widely varying ways and can encompass PUT and PATCH-like operations if the server chooses. If the operation does not modify the resource identified by the Request-URI in a predictable way, POST should be considered instead of PATCH or PUT.
PUTではなく、PATCHを使用する際にクライアントが選択する必要があります。パッチドキュメントのサイズがPUTで使用される新しいリソースデータのサイズよりも大きい場合、例えば、それはPATCHの代わりにPUTを使用しても意味があります。 POSTは、広く変化する方法で使用され、サーバが選択した場合PUTとパッチ状の操作を包含することができるので、POSTとの比較は、より一層困難です。操作は、予測可能な方法でのRequest-URIによって識別されるリソースを変更しない場合は、POSTの代わりにPATCHまたはPUTを考慮すべきです。
PATCH /file.txt HTTP/1.1 Host: www.example.com Content-Type: application/example If-Match: "e0023aa4e" Content-Length: 100
PATCH /file.txt HTTP / 1.1ホスト:www.example.comのContent-Type:アプリケーション/たとえば、一致した場合: "e0023aa4e" のContent-Length:100
[description of changes]
[変更の説明]
This example illustrates use of a hypothetical patch document on an existing resource.
この例では、既存のリソース上で仮想的なパッチドキュメントの使用を示しています。
Successful PATCH response to existing text file:
既存のテキストファイルに成功したPATCH応答:
HTTP/1.1 204 No Content Content-Location: /file.txt ETag: "e0023aa4f"
HTTP / 1.1 204コンテンツなしのContent-場所:/file.txtのETag: "e0023aa4f"
The 204 response code is used because the response does not carry a message body (which a response with the 200 code would have). Note that other success codes could be used as well.
応答が(200コードで応答がなければならない)、メッセージボディを運ばないので、204応答コードが使用されます。他の成功コードが同様に使用することができることに注意してください。
Furthermore, the ETag response header field contains the ETag for the entity created by applying the PATCH, available at http://www.example.com/file.txt, as indicated by the Content-Location response header field.
さらに、のETagレスポンスヘッダフィールドは、コンテンツロケーション応答ヘッダーフィールドによって示されるように、http://www.example.com/file.txtで、利用可能なパッチを適用することによって作成されたエンティティのためのETagを含有します。
There are several known conditions under which a PATCH request can fail.
PATCHリクエストが失敗する可能性がその下でいくつかの既知の条件があります。
Malformed patch document: When the server determines that the patch document provided by the client is not properly formatted, it SHOULD return a 400 (Bad Request) response. The definition of badly formatted depends on the patch document chosen.
不正な形式のパッチドキュメント:サーバは、クライアントが提供するパッチドキュメントが正しくフォーマットされていないと判断した場合、それは400(不正なリクエスト)レスポンスを返すべきです。不正な形式の定義は、選択したパッチのドキュメントに依存します。
Unsupported patch document: Can be specified using a 415 (Unsupported Media Type) response when the client sends a patch document format that the server does not support for the resource identified by the Request-URI. Such a response SHOULD include an Accept-Patch response header as described in Section 3.1 to notify the client what patch document media types are supported.
サポートされていないパッチドキュメント:クライアントは、サーバがRequest-URIによって識別されるリソースのためにサポートしていないパッチのドキュメント形式を送信415(サポートされていないメディアタイプ)応答を使用して指定することができます。文書のメディアタイプがサポートされているパッチをクライアントに通知するために、セクション3.1で説明したように、このような応答は受け入れパッチレスポンスヘッダを含むべきです。
Unprocessable request: Can be specified with a 422 (Unprocessable Entity) response ([RFC4918], Section 11.2) when the server understands the patch document and the syntax of the patch document appears to be valid, but the server is incapable of processing the request. This might include attempts to modify a resource in a way that would cause the resource to become invalid; for instance, a modification to a well-formed XML document that would cause it to no longer be well-formed. There may also be more specific errors like "Conflicting State" that could be signaled with this status code, but the more specific error would generally be more helpful.
処理不能の要求:サーバーが有効であると思わパッチドキュメントおよびパッチ文書の構文を理解しますが、サーバは要求を処理することができない422(処理不能エンティティ)応答([RFC4918]、セクション11.2)で指定することができます。これは、リソースが無効になりますように、リソースを変更しようとする試みが含まれることがあります。例えば、それを引き起こす整形式のXML文書への変更は、もはやよく形成されないことにします。また、このステータスコードを通知することができますが、より具体的なエラーは一般的に、より参考になる「競合状態」のような、より具体的なエラーがあるかもしれません。
Resource not found: Can be specified with a 404 (Not Found) status code when the client attempted to apply a patch document to a non-existent resource, but the patch document chosen cannot be applied to a non-existent resource.
リソースが見つかりません:クライアントが存在しないリソースへのパッチのドキュメントを適用しようとしましたが、選択したパッチの文書が存在しないリソースに適用することができないとき404(見つかりません)ステータスコードで指定することができます。
Conflicting state: Can be specified with a 409 (Conflict) status code when the request cannot be applied given the state of the resource. For example, if the client attempted to apply a structural modification and the structures assumed to exist did not exist (with XML, a patch might specify changing element 'foo' to element 'bar' but element 'foo' might not exist).
競合状態:リクエストはリソースの状態を所与適用できない場合409(競合)ステータスコードで指定できます。クライアントは、構造的な変更を適用しようとした構造が存在すると仮定たとえば、(XMLで、パッチが要素「バー」に要素「foo」を変え指定することができますが、要素「fooが」が存在しない場合があります)存在しませんでした。
Conflicting modification: When a client uses either the If-Match or If-Unmodified-Since header to define a precondition, and that precondition failed, then the 412 (Precondition Failed) error is most helpful to the client. However, that response makes no sense if there was no precondition on the request. In cases when the server detects a possible conflicting modification and no precondition was defined in the request, the server can return a 409 (Conflict) response.
変形競合する:クライアントのいずれか使用している場合、マッチまたは場合非改変-のでヘッダ前提条件を定義するために、その前提条件が失敗した場合、その後、412(前提条件が失敗した)エラーがクライアントに最も有用です。リクエストには前提条件がなかった場合は、その応答は意味がありません。サーバーが可能競合する変更を検出しない前提条件が要求に定義されていない場合のケースでは、サーバ409(競合)応答を返すことができます。
Concurrent modification: Some applications of PATCH might require the server to process requests in the order in which they are received. If a server is operating under those restrictions, and it receives concurrent requests to modify the same resource, but is unable to queue those requests, the server can usefully indicate this error by using a 409 (Conflict) response.
同時変更:PATCHの一部のアプリケーションは、それらが受信された順序で要求を処理するサーバーが必要になることがあります。サーバはそれらの制限の下で動作しており、それが同じリソースを変更するための同時要求を受信しますが、これらの要求をキューすることができない場合、サーバーは有効409(競合)応答を使用して、このエラーを示すことができます。
Note that the 409 Conflict response gives reasonably consistent information to clients. Depending on the application and the nature of the patch format, the client might be able to reissue the request as is (e.g., an instruction to append a line to a log file), have to retrieve the resource content to recalculate a patch, or have to fail the operation.
409競合応答がクライアントに合理的に一貫性のある情報を与えることに注意してください。アプリケーションやパッチ形式の性質に応じて、クライアントが(例えば、ログファイルに行を追加するための命令)、パッチを再計算するために、リソースのコンテンツを取得する必要がされたとして、要求を再発行することができるかもしれない、または操作に失敗することがあります。
Other HTTP status codes can also be used under the appropriate circumstances.
他のHTTPステータスコードは、適切な状況下で使用することができます。
The entity body of error responses SHOULD contain enough information to communicate the nature of the error to the client. The content-type of the response entity can vary across implementations.
エラー応答のエンティティボディは、クライアントにエラーの性質を通信するための十分な情報が含まれているはずです。応答エンティティのコンテンツタイプは、実装ごとに異なることができます。
A server can advertise its support for the PATCH method by adding it to the listing of allowed methods in the "Allow" OPTIONS response header defined in HTTP/1.1. The PATCH method MAY appear in the "Allow" header even if the Accept-Patch header is absent, in which case the list of allowed patch documents is not advertised.
サーバは、HTTP / 1.1で定義された「許可」OPTIONS応答ヘッダーの許容メソッドのリストに追加しPATCH方法のサポートを広告することができます。 PATCHメソッドを受け入れ、パッチヘッダが許可されたパッチの文書のリストがアドバタイズされていない場合には、存在しない場合でも、「許可」ヘッダに表示されることがあります。
This specification introduces a new response header Accept-Patch used to specify the patch document formats accepted by the server. Accept-Patch SHOULD appear in the OPTIONS response for any resource that supports the use of the PATCH method. The presence of the Accept-Patch header in response to any method is an implicit indication that PATCH is allowed on the resource identified by the Request-URI. The presence of a specific patch document format in this header indicates that that specific format is allowed on the resource identified by the Request-URI.
この仕様は新しい応答ヘッダーのAccept-パッチサーバによって受け入れパッチ文書フォーマットを指定するために使用導入します。受け入れ-パッチPATCHメソッドの使用をサポートしているすべてのリソースに対するOPTIONS応答に表示されます。いずれの方法に応じて受け入れパッチのヘッダの存在は、パッチのRequest-URIによって識別されたリソース上で許可されていることを暗黙の指標です。このヘッダ内の特定のパッチドキュメント形式の存在は、その特定のフォーマットがRequest-URIによって識別されたリソース上で許可されていることを示しています。
Accept-Patch = "Accept-Patch" ":" 1#media-type
= "にAccept-パッチ" "-パッチを受け入れる:" 1#メディア型
The Accept-Patch header specifies a comma-separated listing of media-types (with optional parameters) as defined by [RFC2616], Section 3.7.
受け入れパッチヘッダは、[RFC2616]、セクション3.7で定義されているよう(オプションのパラメータを有する)メディアタイプのカンマ区切りリストを指定します。
Example:
例:
Accept-Patch: text/example;charset=utf-8
- パッチを受け入れ:テキスト/例;のcharset = UTF-8
[request]
[要求]
OPTIONS /example/buddies.xml HTTP/1.1 Host: www.example.com
OPTIONS /example/buddies.xml HTTP / 1.1ホスト:www.example.com
[response]
[応答]
HTTP/1.1 200 OK Allow: GET, PUT, POST, OPTIONS, HEAD, DELETE, PATCH Accept-Patch: application/example, text/example
HTTP / 1.1 200 OK許可:GET、PUT、POSTは、OPTIONSは、HEADは、DELETE、PATCHのAccept-パッチ:アプリケーション/たとえば、テキスト/例
The examples show a server that supports PATCH generally using two hypothetical patch document formats.
例は、一般に2つの仮想的なパッチの文書フォーマットを使用してパッチをサポートするサーバーを示しています。
The Accept-Patch response header has been added to the permanent registry (see [RFC3864]).
受け入れパッチレスポンスヘッダは、永久レジストリに追加されている([RFC3864]を参照)。
Header field name: Accept-Patch
ヘッダフィールド名:受け入れ、パッチ
Applicable Protocol: HTTP
該当するプロトコル:HTTP
Author/Change controller: IETF
著者/変更コントローラ:IETF
Specification document: this specification
仕様書:この仕様書
The security considerations for PATCH are nearly identical to the security considerations for PUT ([RFC2616], Section 9.6). These include authorizing requests (possibly through access control and/or authentication) and ensuring that data is not corrupted through transport errors or through accidental overwrites. Whatever mechanisms are used for PUT can be used for PATCH as well. The following considerations apply especially to PATCH.
パッチのセキュリティ問題は、PUT([RFC2616]、セクション9.6)のためのセキュリティ上の考慮事項とほぼ同じです。これらは、(おそらく、アクセス制御および/または認証を介して)要求を許可し、データが転送エラーを介して、または偶発上書きによって破損していないことを保証します。 PUTのために使用されているどのようなメカニズムは、同様PATCHのために使用することができます。次の考慮事項は特にPATCHに適用されます。
A document that is patched might be more likely to be corrupted than a document that is overridden in entirety, but that concern can be addressed through the use of mechanisms such as conditional requests using ETags and the If-Match request header as described in Section 2. If a PATCH request fails, the client can issue a GET request to the resource to see what state it is in. In some cases, the client might be able to check the contents of the resource to see if the PATCH request can be resent, but in other cases, the attempt will just fail and/or a user will have to verify intent. In the case of a failure of the underlying transport channel, where a PATCH response is not received before the channel fails or some other timeout happens, the client might have to issue a GET request to see whether the request was applied. The client might want to ensure that the GET request bypasses caches using mechanisms described in HTTP specifications (see, for example, Section 13.1.6 of [RFC2616]).
パッチされた文書は、全体が上書きされる文書よりも破損されやすいかもしれないが、第2節で説明したように、その懸念は、このようなてETagとIF-対戦要求ヘッダーを使用して条件付きのリクエストなどのメカニズムを使用することによって対処することができますPATCHリクエストが失敗した場合、クライアントはそれがであるものの状態を確認するリソースへのGETリクエストを発行することができます。いくつかのケースでは、クライアントは、PATCH要求を再送信することができるかどうかを確認するために、リソースの内容を確認することができるかもしれませんが、他の例では、試みは単に失敗し、および/またはユーザーが意図を検証する必要があります。チャネルが失敗した場合や他のいくつかのタイムアウトが発生する前にPATCH応答が受信されない基礎となるトランスポートチャネルの障害が発生した場合、クライアントは、要求が適用されたかどうかを確認するためにGETリクエストを発行する必要がある場合があります。クライアントがGET要求はHTTP仕様書に記述のメカニズムを使用してキャッシュをバイパスしていることを確認したい場合があります(例えば、参照、[RFC2616]のセクション13.1.6)。
Sometimes an HTTP intermediary might try to detect viruses being sent via HTTP by checking the body of the PUT/POST request or GET response. The PATCH method complicates such watch-keeping because neither the source document nor the patch document might be a virus, yet the result could be. This security consideration is not materially different from those already introduced by byte-range downloads, downloading patch documents, uploading zipped (compressed) files, and so on.
時には、HTTPの仲介者は、PUT / POSTリクエストのボディをチェックすることにより、HTTPを経由して送信されているウイルスを検出または応答をGETしようとします。ソースドキュメントやパッチの文書でもないが、ウイルスかもしれないが、まだ結果は可能性があるためPATCHメソッドは、このような時計キーピングを複雑にします。このセキュリティ考慮事項は、まだ上のzip圧縮(圧縮)ファイルをアップロードし、パッチのドキュメントをダウンロードし、バイト範囲のダウンロードによって導入され、そしてそれらと大きく異なるではありません。
Individual patch documents will have their own specific security considerations that will likely vary depending on the types of resources being patched. The considerations for patched binary resources, for instance, will be different than those for patched XML documents. Servers MUST take adequate precautions to ensure that malicious clients cannot consume excessive server resources (e.g., CPU, disk I/O) through the client's use of PATCH.
個々のパッチ文書はおそらくパッチが適用されているリソースの種類によって異なります、独自の特定のセキュリティ上の考慮事項があります。パッチを当てたバイナリ資源のための考慮事項は、例えば、パッチを適用し、XML文書のためのものとは異なるものになります。サーバは、悪意のあるクライアントがPATCHのクライアントの使用により、過度なサーバリソース(例えば、CPU、ディスクI / O)を消費することができないことを保証するために、適切な予防策を取る必要があります。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]ブラドナーの、S.、 "要件レベルを示すためにRFCsにおける使用のためのキーワード"、BCP 14、RFC 2119、1997年3月。
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC2616]フィールディング、R.、ゲティス、J.、モーグル、J.、Frystyk、H.、Masinter、L.、リーチ、P.、およびT.バーナーズ - リー、 "ハイパーテキスト転送プロトコル - HTTP / 1.1" 、RFC 2616、1999年6月。
[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration Procedures for Message Header Fields", BCP 90, RFC 3864, September 2004.
[RFC3864] Klyne、G.、ノッティンガム、M.、およびJ.モーグル、BCP 90、RFC 3864、2004年9月 "メッセージヘッダフィールドの登録手順"。
[RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007.
[RFC4918] Dusseault、L.、RFC 4918、2007年6月 "Web分散オーサリングとバージョン管理(WebDAV)のためのHTTP拡張機能"。
Appendix A. Acknowledgements
付録A.謝辞
PATCH is not a new concept, it first appeared in HTTP in drafts of version 1.1 written by Roy Fielding and Henrik Frystyk and also appears in Section 19.6.1.1 of RFC 2068.
PATCHは新しい概念ではありません、それは最初のロイ・フィールディングとヘンリクFrystykによって書かれたバージョン1.1のドラフトでHTTPに登場し、また、RFC 2068のセクション19.6.1.1に表示されます。
Thanks to Adam Roach, Chris Sharp, Julian Reschke, Geoff Clemm, Scott Lawrence, Jeffrey Mogul, Roy Fielding, Greg Stein, Jim Luther, Alex Rousskov, Jamie Lokier, Joe Hildebrand, Mark Nottingham, Michael Balloni, Cyrus Daboo, Brian Carpenter, John Klensin, Eliot Lear, SM, and Bernie Hoeneisen for review and advice on this document. In particular, Julian Reschke did repeated reviews, made many useful suggestions, and was critical to the publication of this document.
アダムローチのおかげで、クリス・シャープ、ジュリアンReschke、ジェフClemm、スコット・ローレンス、ジェフリー・モーグル、ロイ・フィールディング、グレッグ・スタイン、ジム・ルーサー、アレックスRousskov、ジェイミーLokier、ジョー・ヒルデブラント、マーク・ノッティンガム、マイケルBalloni、サイラスDaboo、ブライアン・カーペンター、この文書のレビューや助言のためのジョン・クレンシン、エリオット・リア、SM、バーニーHoeneisen。特に、ジュリアンReschkeは、レビューを繰り返し、多くの有用な提案を行い、このドキュメントの発行に不可欠でした。
Authors' Addresses
著者のアドレス
Lisa Dusseault Linden Lab 945 Battery Street San Francisco, CA 94111 USA
リサDusseaultリンデンラボ945バッテリー・ストリート、サンフランシスコ、CA 94111 USA
EMail: lisa.dusseault@gmail.com
メールアドレス:lisa.dusseault@gmail.com
James M. Snell
ジェームズ・M.スネル
EMail: jasnell@gmail.com URI: http://www.snellspace.com
電子メール:jasnell@gmail.com URI:http://www.snellspace.com