[要約] RFC 8887は、WebSocket用のJMAPサブプロトコルであり、JSON Meta Application Protocol(JMAP)の拡張を提供します。このRFCの目的は、JMAPクライアントとサーバー間のリアルタイム通信を可能にし、効率的なデータ同期を実現することです。

Internet Engineering Task Force (IETF)                      K. Murchison
Request for Comments: 8887                                      Fastmail
Category: Standards Track                                    August 2020
ISSN: 2070-1721
        

A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket

WebSocket用のJSONメタアプリケーションプロトコル(JMAP)サブプロトコル

Abstract

概要

This document defines a binding for the JSON Meta Application Protocol (JMAP) over a WebSocket transport layer. The WebSocket binding for JMAP provides higher performance than the current HTTP binding for JMAP.

このドキュメントは、WebSocketトランスポート層を介したJSONメタアプリケーションプロトコル(JMAP)のバインディングを定義します。JMAPのWebSocketバインディングは、JMAPの現在のHTTPバインディングよりも高いパフォーマンスを提供します。

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/rfc8887.

この文書の現在のステータス、任意のエラータ、およびフィードバックを提供する方法については、https://www.rfc-editor.org/info/rfc8887で入手できます。

Copyright Notice

著作権表示

Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.

Copyright(C)2020 IETFの信頼と文書著者として識別された人。全著作権所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://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ドキュメントに関連するIETFトラストの法的規定(https://trustee.ietf.org/license-info)の対象となります。 これらのドキュメントは、このドキュメントに関するお客様の権利と制限について説明しているため、注意深く確認してください。 このドキュメントから抽出されたコードコンポーネントには、Trust LegalProvisionsのセクション4.eで説明されているSimplifiedBSD Licenseテキストが含まれている必要があり、Simplified BSDLicenseで説明されているように保証なしで提供されます。

Table of Contents

目次

   1.  Introduction
   2.  Conventions Used in This Document
   3.  Discovering Support for JMAP over WebSocket
   4.  JMAP Subprotocol
     4.1.  Authentication
     4.2.  Handshake
     4.3.  WebSocket Messages
       4.3.1.  Handling Invalid Data
       4.3.2.  JMAP Requests
       4.3.3.  JMAP Responses
       4.3.4.  JMAP Request-Level Errors
       4.3.5.  JMAP Push Notifications
     4.4.  Examples
   5.  Security Considerations
     5.1.  Connection Confidentiality and Integrity
     5.2.  Non-browser Clients
   6.  IANA Considerations
     6.1.  Registration of the WebSocket JMAP Subprotocol
   7.  References
     7.1.  Normative References
     7.2.  Informative References
   Acknowledgments
   Author's Address
        
1. Introduction
1. はじめに

JMAP [RFC8620] over HTTP [RFC7235] requires that every JMAP API request be authenticated. Depending on the type of authentication used by the JMAP client and the configuration of the JMAP server, authentication could be an expensive operation both in time and resources. In such circumstances, reauthenticating for every JMAP API request may harm performance.

JMAP [RFC8620] over HTTP [RFC7235]は、すべてのJMAP API要求を認証する必要があります。JMAPクライアントが使用する認証の種類とJMAPサーバーの構成に応じて、認証は時間とリソースの両方で高価な操作になる可能性があります。そのような状況では、JMAP API要求ごとに再認証が発生する可能性があります。

The WebSocket [RFC6455] binding for JMAP eliminates this performance hit by authenticating just the WebSocket handshake request and having those credentials remain in effect for the duration of the WebSocket connection. This binding supports JMAP API requests and responses, with optional support for push notifications.

JMAPのWebSocket [RFC6455]のバインディングは、WebSocketハンドシェイク要求だけを認証し、それらの認証情報をWebSocket接続の期間中に有効にすることによってこのパフォーマンスを排除します。このバインディングはJMAP API要求と応答をサポートし、プッシュ通知のオプションのサポートをサポートしています。

Furthermore, the WebSocket binding for JMAP can optionally compress [RFC7692] both JMAP API requests and responses. Although compression of HTTP responses is ubiquitous, compression of HTTP requests has very low, if any, deployment and therefore isn't a viable option for JMAP API requests over HTTP.

さらに、JMAP用のWebSocketバインディングは、JMAP API要求と応答の両方をオプションで圧縮できます。HTTP応答の圧縮はユビキタスであるが、HTTP要求の圧縮は非常に低く、展開し、したがってJMAP API要求に対する実行可能なオプションではありません。

2. Conventions Used in This Document
2. この文書で使用されている規約

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", "MAY", および "OPTIONAL" はBCP 14 [RFC2119] [RFC8174]で説明されているように、すべて大文字の場合にのみ解釈されます。

This document uses the terminology defined in the core JMAP specification [RFC8620].

この文書は、Core JMAP仕様[RFC8620]で定義されている用語を使用しています。

3. Discovering Support for JMAP over WebSocket
3. WebSocketを介したJMAPのサポートを検出します

The JMAP capabilities object is returned as part of the standard JMAP Session object (see Section 2 of [RFC8620]). Servers supporting this specification MUST add a property named "urn:ietf:params:jmap:websocket" to the capabilities object. The value of this property is an object that MUST contain the following information on server capabilities:

JMAP機能オブジェクトは、標準のJMAPセッションオブジェクトの一部として返されます([RFC8620]のセクション2を参照)。この仕様をサポートするサーバーは、「urn:ietf:params:jmap:jmap:websocket」という名前のプロパティを機能オブジェクトに追加する必要があります。このプロパティの値は、サーバー機能に関する次の情報を含める必要があるオブジェクトです。

* url: "String"

* URL: "string"

The wss-URI (see Section 3 of [RFC6455]) to use for initiating a JMAP-over-WebSocket handshake (the "WebSocket URL endpoint" colloquially).

JMap-over-websocketハンドシェイクを開始するために使用するWSS-URI([RFC6455]のセクション3を参照)(「WebSocket URLエンドポイント」とコポリック)。

* supportsPush: "Boolean"

* supportspush: "boolean"

This is true if the server supports push notifications over the WebSocket, as described in Section 4.3.5.

セクション4.3.5で説明されているように、サーバーがWebSocketを介してプッシュ通知をサポートしている場合、これは当てはまります。

Example:

例:

   "urn:ietf:params:jmap:websocket": {
     "url": "wss://server.example.com/jmap/ws/",
     "supportsPush": true
   }
        
4. JMAP Subprotocol
4. JMAPサブプロトコル

The term WebSocket subprotocol refers to an application-level protocol layered on top of a WebSocket connection. This document specifies the WebSocket JMAP subprotocol for carrying JMAP API requests, responses, and optional push notifications through a WebSocket connection. Binary data is handled per Section 6 of [RFC8620] (via a separate HTTP connection or stream) or per a future extension to JMAP or this specification.

WebSocketサブプロトコルという用語は、WebSocket接続の上に階層化されたアプリケーションレベルプロトコルを指します。このドキュメントは、WebSocket接続を介してJMAP API要求、応答、およびオプションのプッシュ通知を搬送するためのWebSocket JMAPサブプロトコルを指定します。バイナリデータは、[RFC8620]のセクション6(別のHTTP接続またはストリームを介して)またはJMAPまたはこの仕様への将来の拡張子ごとに処理されます。

4.1. Authentication
4.1. 認証

A JMAP WebSocket connection is authenticated by presenting a user's credentials in the HTTP request [RFC7235] that initiates the WebSocket handshake. See Section 8.2 of [RFC8620] for recommendations regarding the selection of HTTP authentication schemes.

JMAP WebSocket接続は、WebSocketハンドシェイクを開始するHTTPリクエスト[RFC7235]にユーザーの資格情報を表示することによって認証されます。HTTP認証方式の選択に関する推奨事項については、[RFC8620]のセクション8.2を参照してください。

4.2. Handshake
4.2. ハンドシェーク

The JMAP WebSocket client and JMAP WebSocket server negotiate the use of the WebSocket JMAP subprotocol during the WebSocket handshake, either via an HTTP/1.1 Upgrade request (see Section 4 of [RFC6455]) or an HTTP/2 Extended CONNECT request (see Section 5 of [RFC8441]). The WebSocket JMAP subprotocol is also intended to run over future bindings of HTTP (e.g., HTTP/3) provided that there is a defined mechanism for performing a WebSocket handshake over that binding.

JMAP WebSocketクライアントおよびJMAP WebSocketサーバーは、WebSocketハンドシェイク中のWebSocket jmapサブプロトコルの使用を、HTTP / 1.1アップグレード要求(RFC6455]のセクション4)またはHTTP / 2 Extended Connectリクエスト(セクション5を参照)をネゴシエートします。[RFC8441]の。WebSocket JMAPサブプロトコルはまた、そのバインディングを介してWebSocketハンドシェイクを実行するための定義されたメカニズムがあると、将来のHTTP(http / 3)の将来のバインディングを実行することを目的としています。

Regardless of the method used for the WebSocket handshake, the client MUST first perform a TLS handshake on a JMAP WebSocket URL endpoint (Section 3) having the "wss://" scheme (WebSocket over TLS) in accordance with the requirements of running the particular binding of HTTP over TLS (see [RFC2818] and Section 4.1 of [RFC6455] for HTTP/1.1 and Section 9.2 of [RFC7540] for HTTP/2). If the TLS handshake fails, the client MUST close the connection. Otherwise, the client MUST make an authenticated HTTP request [RFC7235] on the encrypted connection and MUST include the value "jmap" in the list of protocols for the "Sec-WebSocket-Protocol" header field.

WebSocketハンドシェイクに使用される方法にかかわらず、クライアントは最初に "WSS://"スキーム(WebSocket:// "スキーム(TLSを介してTLS over)のTLSハンドシェイクを実行する必要があります。HTTP over TLSの特定のバインディング(HTTP / 2.1の[RFC6455]、[RFC6455]の[RFC6455]および[RFC7540]のセクション9.2(HTTP / 2のセクション4.1を参照)。TLSハンドシェイクが失敗した場合、クライアントは接続を閉じる必要があります。それ以外の場合、クライアントは暗号化された接続で認証されたHTTPリクエスト[RFC7235]を作成し、「sec-websocket-protocol」ヘッダーフィールドのプロトコルのリストに値 "jmap"を含める必要があります。

The reply from the server MUST also contain a corresponding "Sec-WebSocket-Protocol" header field with a value of "jmap" in order for a JMAP subprotocol connection to be established.

サーバーからの応答には、JMAPサブプロタコジー接続を確立するために、値「JMAP」の値を持つ対応する「SEC-WEBSOST-PROTOCOL」ヘッダーフィールドも含まなければなりません。

Once the handshake has successfully completed, the WebSocket connection is established and can be used for JMAP API requests, responses, and optional push notifications. Other message types MUST NOT be transmitted over this connection.

ハンドシェイクが正常に完了すると、WebSocket接続が確立され、JMAP API要求、応答、およびオプションのプッシュ通知に使用できます。他のメッセージタイプはこの接続を介して送信しないでください。

The credentials used for authenticating the HTTP request to initiate the handshake remain in effect for the duration of the WebSocket connection. If the authentication credentials for the user expire, the server can either treat subsequent requests as if they are unauthenticated or close the WebSocket connection. In the latter case, the server MAY send a Close frame with a status code of 1008 (Policy Violation), as defined in Section 7.4.1 of [RFC6455].

HTTPリクエストを認証するために使用される認証情報は、WebSocket接続の期間に有効なままです。ユーザーが期限切れになる認証認証情報があれば、サーバーは、それらが認証されていないか、WebSocket接続を閉じるかのように後続の要求を処理できます。後者の場合、サーバーは[RFC6455]のセクション7.4.1で定義されているように、ステータスコード1008(ポリシー違反)でクローズフレームを送信することができます。

4.3. WebSocket Messages
4.3. WebSocketメッセージ

Data frame messages in the JMAP subprotocol MUST be text frames and contain UTF-8 encoded data. The messages MUST be in the form of a single JMAP Request object (see Section 3.3 of [RFC8620]), JMAP WebSocketPushEnable object (see Section 4.3.5.2), or JMAP WebSocketPushDisable object (see Section 4.3.5.3) when sent from the client to the server, and MUST be in the form of a single JMAP Response object, JSON Problem Details object, or JMAP StateChange object (see Sections 3.4, 3.6.1, and 7.1 of [RFC8620], respectively) when sent from the server to the client.

JMAPサブプロトコルのデータフレームメッセージはテキストフレームで、UTF-8エンコードされたデータを含みます。メッセージは、単一のJMAP要求オブジェクトの形式でなければなりません([RFC8620]のセクション3.3)、JMap WebSocketPushableオブジェクト(セクション4.3.5.2を参照)、またはクライアントから送信されたときのJMap WebSocketPushDisableオブジェクト(セクション4.3.5.3を参照)サーバーに、単一のJMAP Responseオブジェクト、JSON Problem Detailsオブジェクト、またはJMAP StateChangeオブジェクト(それぞれのセクション3.4,3.6.1、および7.1を参照)の形式で、サーバーから送信された場合クライアント。

Note that fragmented WebSocket messages (split over multiple text frames) MUST be coalesced prior to parsing them as JSON objects.

断片化されたWebSocketメッセージ(複数のテキストフレームを介して分割)をJSONオブジェクトとして解析する前に合体する必要があります。

4.3.1. Handling Invalid Data
4.3.1. 無効なデータを処理する

If a client or server receives a binary frame, the endpoint can either ignore the frame or close the WebSocket connection. In the latter case, the endpoint MAY send a Close frame with a status code of 1003 (Unsupported Data), as defined in Section 7.4.1 of [RFC6455].

クライアントまたはサーバーがバイナリフレームを受信した場合、エンドポイントはフレームを無視するか、またはWebSocket接続を閉じることができます。後者の場合、エンドポイントは、[RFC6455]のセクション7.4.1で定義されているように、ステータスコード(サポートされていないデータ)でクローズフレームを送信することができます。

If a client receives a message that is not in the form of a JSON Problem Details object, a JMAP Response object, or a JMAP StateChange object, the client can either ignore the message or close the WebSocket connection. In the latter case, the endpoint MAY send a Close frame with a status code of 1007 (Invalid frame payload data), as defined in Section 7.4.1 of [RFC6455].

クライアントがJSON問題の詳細オブジェクト、JMAP Responseオブジェクト、またはJMAP StateChangeオブジェクトの形式ではないメッセージを受信した場合、クライアントはメッセージを無視するか、またはWebSocket接続を閉じることができます。後者の場合、エンドポイントは、[RFC6455]のセクション7.4.1で定義されているように、ステータスコード1007(無効なフレームペイロードデータ)を含むクローズフレームを送信することができる。

A server MUST return an appropriate JSON Problem Details object (Section 4.3.4) for any request-level errors (e.g., an invalid JMAP object, an unsupported capability or method call, or exceeding a server request limit).

サーバーは、要求レベルのエラー(例えば、無効なJMAPオブジェクト、サポートされていない機能またはメソッド呼び出し、またはサーバー要求制限を超える)について、適切なJSON問題の詳細オブジェクト(セクション4.3.4)を返す必要があります。

4.3.2. JMAP Requests
4.3.2. JMAPリクエスト

The specification extends the Request object with two additional arguments when used over a WebSocket:

仕様は、WebSocketを介して使用されると、リクエストオブジェクトを2つの追加の引数で拡張します。

   *  @type: "String"
        

This MUST be the string "Request".

これは文字列 "要求"でなければなりません。

* id: "String" (optional)

* ID: "string"(オプション)

A client-specified identifier for the request to be echoed back in the response to this request.

この要求に対する応答でエコーされる要求に対するクライアント指定の識別子。

JMAP over WebSocket allows the server to process requests out of order. The client-specified identifier is used as a mechanism for the client to correlate requests and responses.

JMAP上のWebSocketを使用すると、サーバーは要求を順番に処理できます。クライアント指定の識別子は、クライアントが要求と応答を関連付けるためのメカニズムとして使用されます。

Additionally, the "maxConcurrentRequests" limit in the "capabilities" object (see Section 2 of [RFC8620]) also applies to requests made on the WebSocket connection. When using the WebSocket JMAP subprotocol over a binding of HTTP that allows multiplexing of requests (e.g., HTTP/2), this limit applies to the sum of requests made on both the JMAP API endpoint and the WebSocket connection.

さらに、 "Capabilities"オブジェクト([RFC8620]のセクション2を参照)の「MaxConcurrentRequests」の制限も、WebSocket接続で行われた要求にも適用されます。要求の多重化を可能にするHTTPのバインディングでWebSocket JMAPサブプロトコルを使用する場合(例えば、HTTP / 2)、この制限は、JMAP APIエンドポイントとWebSocket接続の両方で行われた要求の合計に適用されます。

4.3.3. JMAP Responses
4.3.3. JMAP応答

The specification extends the Response object with two additional arguments when used over a WebSocket:

この仕様は、WebSocketを介して使用されると、応答オブジェクトを2つの追加の引数で拡張します。

   *  @type: "String"
        

This MUST be the string "Response".

これは文字列 "応答"でなければなりません。

* requestId: "String" (optional; MUST be returned if an identifier is included in the request)

* requestID: "string"(任意;識別子が要求に含まれている場合は返す必要があります)

The client-specified identifier in the corresponding request.

対応する要求内のクライアント指定の識別子。

4.3.4. JMAP Request-Level Errors
4.3.4. JMAPリクエストレベルエラー

The specification extends the Problem Details object for request-level errors (see Section 3.6.1 of [RFC8620]) with two additional arguments when used over a WebSocket:

この仕様は、WebSocketを介して使用されるときに2つの追加の引数を持つ、リクエストレベルのエラー([RFC8620]のセクション3.6.1参照)を参照してください。

   *  @type: "String"
        

This MUST be the string "RequestError".

これは文字列 "requestError"でなければなりません。

* requestId: "String" (optional; MUST be returned if given in the request)

* requestID: "string"(オプション。要求に指定されている場合は返す必要があります)

The client-specified identifier in the corresponding request.

対応する要求内のクライアント指定の識別子。

4.3.5. JMAP Push Notifications
4.3.5. JMAPプッシュ通知

JMAP-over-WebSocket servers that support push notifications on the WebSocket will advertise a "supportsPush" property with a value of true in the "urn:ietf:params:jmap:websocket" server capabilities object.

WebSocket上のプッシュ通知をサポートするJMAP-over-websocketサーバーは、 "urn:ietf:params:jmap:WebSocket"サーバー機能オブジェクトで "Supportspush"プロパティをtrueの値に宣伝します。

4.3.5.1. Notification Format
4.3.5.1. 通知フォーマット

All push notifications take the form of a standard StateChange object (see Section 7.1 of [RFC8620]).

すべてのプッシュ通知は標準のStateChangeオブジェクトの形式を取ります([RFC8620]のセクション7.1参照)。

The specification extends the StateChange object with one additional argument when used over a WebSocket:

この仕様は、WebSocketを介して使用されると、StateChangeオブジェクトを1つの追加の引数で拡張します。

* pushState: "String" (optional)

* プッシュステート: "string"(オプション)

A (preferably short) string that encodes the entire server state visible to the user (not just the objects returned in this call).

(好ましくは短い)サーバ状態全体をユーザに表示する(この呼び出しで返されたオブジェクトだけでなく)文字列。

The purpose of the "pushState" token is to allow a client to immediately get any changes that occurred while it was disconnected (see Section 4.3.5.2). If the server does not support "pushState" tokens, the client will have to issue a series of "/changes" requests (see Section 5.2 of [RFC8620]) upon reconnection to update its state to match that of the server.

「PushState」トークンの目的は、クライアントが切断されている間に発生した変更をすぐに取得できるようにすることです(セクション4.3.5.2を参照)。サーバーが「PushState」トークンをサポートしていない場合、クライアントは、サーバーの状態に一致するようにその状態を更新するために、再接続時に一連の「/変更」要求を発行する必要があります([RFC8620]のセクション5.2を参照)。

4.3.5.2. Enabling Notifications
4.3.5.2. 通知を有効にする

A client enables push notifications from the server for the current connection by sending a WebSocketPushEnable object to the server. A WebSocketPushEnable object has the following properties:

クライアントは、WebSocketPushenableオブジェクトをサーバーに送信することによって、現在の接続のサーバーからのプッシュ通知を有効にします。WebSocketPuseEnableオブジェクトには、次のプロパティがあります。

   *  @type: "String"
        

This MUST be the string "WebSocketPushEnable".

これは文字列 "WebSocketPushenable"でなければなりません。

* dataTypes: "String[]|null"

* データ型: "String []

A list of data type names (e.g., "Mailbox" or "Email") that the client is interested in. A StateChange notification will only be sent if the data for one of these types changes. Other types are omitted from the TypeState object. If null, changes will be pushed for all supported data types.

クライアントが興味があるデータ型名(例えば、「メールボックス」または「電子メール」)のリスト。これらのタイプの1つのデータが変更された場合にのみStateChange通知が送信されます。Typestateオブジェクトから他のタイプは省略されています。NULLの場合、サポートされているすべてのデータ型に対して変更がプッシュされます。

* pushState: "String" (optional)

* プッシュステート: "string"(オプション)

The last "pushState" token that the client received from the server. Upon receipt of a "pushState" token, the server SHOULD immediately send all changes since that state token.

クライアントがサーバーから受信した最後の "PushState"トークン。「プッシュステート」トークンを受信すると、サーバーはその状態トークン以降にすべての変更をすぐに送信する必要があります。

4.3.5.3. Disabling Notifications
4.3.5.3. 通知を無効にする

A client disables push notifications from the server for the current connection by sending a WebSocketPushDisable object to the server. A WebSocketPushDisable object has the following property:

クライアントは、WebSocketPushDisableオブジェクトをサーバーに送信することによって、現在の接続のサーバーからのプッシュ通知を無効にします。WebSocketPushDisableオブジェクトには、次のプロパティがあります。

   *  @type: "String"
        

This MUST be the string "WebSocketPushDisable".

これは文字列 "WebSocketPushDisable"でなければなりません。

4.4. Examples
4.4. 例

The following examples show WebSocket JMAP opening handshakes, a JMAP Core/echo request and response, and a subsequent closing handshake. The examples assume that the JMAP WebSocket URL endpoint has been advertised in the JMAP Session object as having a path of "/jmap/ws/" and that TLS negotiation has already succeeded. Note that folding of header fields is for editorial purposes only.

次の例は、WebSocket JMAP開始ハンドシェイク、JMAPコア/エコー要求および応答、およびその後の閉鎖ハンドシェイクを示しています。例では、JMAP WebSocket URLエンドポイントが「/ JMAP / WS /」のパスを持つようにJMAPセッションオブジェクトでアドバタイズし、そのTLSネゴシエーションがすでに成功していると仮定しています。ヘッダーフィールドの折りたたみは、編集目的のためだけのものです。

WebSocket JMAP connection via HTTP/1.1 with push notifications for mail [RFC8621] is enabled. This example assumes that the client has cached pushState "aaa" from a previous connection.

http / 1.1を介したWebSocket JMAP接続メール[RFC8621]のプッシュ通知が有効になります。この例では、クライアントが以前の接続からPushState "AAA"をキャッシュしたと想定しています。

[[ From Client ]] [[ From Server ]]

[[クライアントから] [[サーバーから]]

   GET /jmap/ws/ HTTP/1.1
   Host: server.example.com
   Upgrade: websocket
   Connection: Upgrade
   Authorization: Basic Zm9vOmJhcg==
   Sec-WebSocket-Key:
     dGhlIHNhbXBsZSBub25jZQ==
   Sec-WebSocket-Protocol: jmap
   Sec-WebSocket-Version: 13
   Origin: https://www.example.com
        

HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: jmap

HTTP / 1.1 101スイッチングプロトコルアップグレード:WebSocket接続:UPGRADE SEC-WEBSOST-appect:s3pplmbitxaq9kygzzhzrbk xoo = sec-websocket-protocol:JMAP

[WebSocket connection established]

[WebSocket接続確立]

   WS_DATA
   {
     "@type": "WebSocketPushEnable",
     "dataTypes": [ "Mailbox", "Email" ],
     "pushState": "aaa"
   }
        
                                    WS_DATA
                                    {
                                      "@type": "StateChange",
                                      "changed": {
                                        "a456": {
                                          "Mailbox": "d35ecb040aab"
                                        }
                                      },
                                      "pushState": "bbb"
                                    }
        
   WS_DATA
   {
     "@type": "Request",
     "id": "R1",
     "using": [ "urn:ietf:params:jmap:core" ],
     "methodCalls": [
       [
         "Core/echo", {
           "hello": true,
           "high": 5
         },
         "b3ff"
       ]
     ]
   }
        
                                    WS_DATA
                                    {
                                      "@type": "Response",
                                      "requestId": "R1",
                                      "methodResponses": [
                                        [
                                          "Core/echo", {
                                            "hello": true,
                                            "high": 5
                                          },
                                          "b3ff"
                                        ]
                                      ]
                                    }
        

WS_DATA The quick brown fox jumps over the lazy dog.

ws_dataクイックブラウンフォックスは怠惰な犬の上に飛びます。

                                    WS_DATA
                                    {
                                      "@type": "RequestError",
                                      "requestId": null,
                                      "type":
                                "urn:ietf:params:jmap:error:notJSON",
                                      "status": 400,
                                      "detail":
                                "The request did not parse as I-JSON."
                                    }
        

[A new email is received]

[新しいEメールが受信されます]

                                    WS_DATA
                                    {
                                      "@type": "StateChange",
                                      "changed": {
                                        "a123": {
                                          "Email": "0af7a512ce70"
                                        }
                                      }
                                      "pushState": "ccc"
                                    }
        

WS_CLOSE

ws_close.

WS_CLOSE

ws_close.

[WebSocket connection closed]

[WebSocket接続が閉まっています]

WebSocket JMAP connection on an HTTP/2 stream that also negotiates compression [RFC7692]:

HTTP / 2ストリーム上のWebSocket JMAP接続も圧縮をネゴシエートする[RFC7692]:

[[ From Client ]] [[ From Server ]]

[[クライアントから] [[サーバーから]]

SETTINGS SETTINGS_ENABLE_CONNECT_PROTOCOL = 1

設定設定_enable_connect_protocol = 1

   HEADERS + END_HEADERS
   :method = CONNECT
   :protocol = websocket
   :scheme = https
   :path = /jmap/ws/
   :authority = server.example.com
   origin: https://example.com
   authorization = Basic Zm9vOmJhcg==
   sec-websocket-protocol = jmap
   sec-websocket-version = 13
   sec-websocket-extensions =
     permessage-deflate
   origin = https://www.example.com
        

HEADERS + END_HEADERS :status = 200 sec-websocket-protocol = jmap sec-websocket-extensions = permessage-deflate

ヘッダEND_HEADERS:STATUS = 200 SEC-WEBSOST-PROTOCOL = JMAP SEC-WEBSOSTENT-EXTENSIONS = PERMESSAGE-DEFLATE

[WebSocket connection established]

[WebSocket接続確立]

DATA WS_DATA [compressed text]

データWS_DATA [圧縮テキスト]

DATA WS_DATA [compressed text]

データWS_DATA [圧縮テキスト]

...

...

DATA + END_STREAM WS_CLOSE

データend_stream WS_CLOSE.

DATA + END_STREAM WS_CLOSE

データend_stream WS_CLOSE.

[WebSocket connection closed] [HTTP/2 stream closed]

[WebSocket接続閉会] [HTTP / 2ストリームクローズ]

5. Security Considerations
5. セキュリティに関する考慮事項

The security considerations for both WebSocket (see Section 10 of [RFC6455]) and JMAP (see Section 8 of [RFC8620]) apply to the WebSocket JMAP subprotocol. Specific security considerations are described below.

両方のWebScocketのセキュリティ上の考慮事項([RFC6455]のセクション10を参照)およびJMAP([RFC8620]のセクション8を参照)は、WebSocket JMAPサブプロトコルに適用されます。具体的なセキュリティ上の考慮事項については後述する。

5.1. Connection Confidentiality and Integrity
5.1. 接続機密性と完全性

To ensure the confidentiality and integrity of data sent and received via JMAP over WebSocket, the WebSocket connection MUST use TLS 1.2 [RFC5246] or later, following the recommendations in BCP 195 [RFC7525]. Servers SHOULD support TLS 1.3 [RFC8446] or later.

WebSocketを介してJMAPを介して送信および受信されたデータの機密保持と整合性を確保するために、WebSocket接続はBCP 195 [RFC7525]の推奨事項に従ってTLS 1.2 [RFC5246]以降を使用する必要があります。サーバーはTLS 1.3 [RFC8446]以降をサポートする必要があります。

5.2. Non-browser Clients
5.2. 非ブラウザクライアント

JMAP over WebSocket can be used by clients both running inside and outside of a web browser. As such, the security considerations in Sections 10.2 and 10.1 of [RFC6455] apply to those respective environments.

Webブラウザの内外で実行されているクライアントでは、WebSocketを介してJMAPを使用できます。このように、[RFC6455]のセクション10.2および10.1のセキュリティ上の考慮事項は、それらのそれぞれの環境に適用されます。

6. IANA Considerations
6. IANAの考慮事項
6.1. Registration of the WebSocket JMAP Subprotocol
6.1. WebSocket JMAPサブプロトコルの登録

Per this specification, IANA has registered the following in the "WebSocket Subprotocol Name Registry" within the "WebSocket Protocol Registries".

この仕様ごとに、IANAは「WebSocket Protocol Registries」内の「WebSocketサブプロトコル名レジストリ」に次のものを登録しました。

Subprotocol Identifier: jmap

サブプロトコル識別子:JMAP.

Subprotocol Common Name: WebSocket Transport for JMAP (JSON Meta Application Protocol)

サブプロトコル共通名:JMAP用WebSocketトランスポート(JSONメタアプリケーションプロトコル)

Subprotocol Definition: RFC 8887

サブプロトコルの定義:RFC 8887

7. References
7. 参考文献
7.1. Normative References
7.1. 引用文献

[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>.

[RFC2119] BRADNER、S、「RFCSで使用するためのキーワード」、BCP 14、RFC 2119、DOI 10.17487 / RFC2119、1997年3月、<https://www.rfc-editor.org/info/RFC2119>。

[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/RFC2818, May 2000, <https://www.rfc-editor.org/info/rfc2818>.

[RFC2818] RESCORLA、E.、「HTTP over TLS」、RFC 2818、DOI 10.17487 / RFC2818、2000年5月、<https://www.rfc-editor.org/info/rfc2818>。

[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/RFC5246, August 2008, <https://www.rfc-editor.org/info/rfc5246>.

[RFC5246] Dierks、T.およびE. Rescorla、「トランスポート層セキュリティ(TLS)プロトコルバージョン1.2」、RFC 5246、DOI 10.17487 / RFC5246、2008年8月、<https://www.rfc-editor.org/info/ RFC5246>。

[RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, DOI 10.17487/RFC6455, December 2011, <https://www.rfc-editor.org/info/rfc6455>.

[RFC6455] Fette、I.およびA.Melnikov、「WebSocketプロトコル」、RFC 6455、DOI 10.17487 / RFC6455、2011年12月、<https://www.rfc-editor.org/info/rfc6455>。

[RFC7235] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Authentication", RFC 7235, DOI 10.17487/RFC7235, June 2014, <https://www.rfc-editor.org/info/rfc7235>.

[RFC7235] Fielding、R.、Ed。J.Reschke、Ed。、「Hypertext Transfer Protocol(HTTP / 1.1):認証」、RFC 7235、DOI 10.17487 / RFC7235、2014年6月、<https://www.rfc-editor.org/info/rfc7235>。

[RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 2015, <https://www.rfc-editor.org/info/rfc7525>.

[RFC7525] Sheffer、Y、Holz、R.およびP.Saint-Andre、「トランスポート層セキュリティ(TLS)およびデータグラムトランスポート層セキュリティ(DTLS)」、BCP 195、RFC 7525、DOI 10.17487/ RFC7525、2015年5月、<https://www.rfc-editor.org/info/rfc7525>。

[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>.

[RFC7540] Belshe、M.、Peon、R.およびM.Thomson、Ed。、「Hypertext Transfer Protocol Version 2(HTTP / 2)」、RFC 7540、DOI 10.17487 / RFC7540、2015年5月、<https://www.rfc-editor.org/info/rfc7540>。

[RFC7692] Yoshino, T., "Compression Extensions for WebSocket", RFC 7692, DOI 10.17487/RFC7692, December 2015, <https://www.rfc-editor.org/info/rfc7692>.

[RFC7692]吉野、T.、「WebSocketの圧縮拡張」、RFC 7692、DOI 10.17487 / RFC7692、2015年12月、<https://www.rfc-editor.org/info/rfc7692>。

[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>.

[RFC8174] Leiba、B、「RFC 2119キーワードの大文字の曖昧さ」、BCP 14、RFC 8174、DOI 10.17487 / RFC8174、2017年5月、<https://www.rfc-editor.org/info/RFC8174>。

[RFC8441] McManus, P., "Bootstrapping WebSockets with HTTP/2", RFC 8441, DOI 10.17487/RFC8441, September 2018, <https://www.rfc-editor.org/info/rfc8441>.

[RFC8441] McManus、P.、「HTTP / 2のBootstraping WebSockets、RFC 8441、DOI 10.17487 / RFC8441、2018年9月、<https://www.rfc-editor.org/info/rfc8441>。

[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <https://www.rfc-editor.org/info/rfc8446>.

[RFC8446] RESCORLA、E.、「トランスポート層セキュリティ(TLS)プロトコルバージョン1.3」、RFC 8446、DOI 10.17487 / RFC8446、2018年8月、<https://www.rfc-editor.org/info/rfc8446>。

[RFC8620] Jenkins, N. and C. Newman, "The JSON Meta Application Protocol (JMAP)", RFC 8620, DOI 10.17487/RFC8620, July 2019, <https://www.rfc-editor.org/info/rfc8620>.

[RFC8620] Jenkins、N.およびC. Newman、「JSONメタApplication Protocol(JMAP)」、RFC 8620、DOI 10.17487 / RFC8620、2019年7月、<https://www.rfc-editor.org/info/rfc8620>。

7.2. Informative References
7.2. 参考引用

[RFC8621] Jenkins, N. and C. Newman, "The JSON Meta Application Protocol (JMAP) for Mail", RFC 8621, DOI 10.17487/RFC8621, August 2019, <https://www.rfc-editor.org/info/rfc8621>.

[RFC8621] Jenkins、N.およびC. NEWMAN、「MAIN用JSONメタApplication Protocol(JMAP)」、RFC 8621、DOI 10.17487 / RFC8621、2019年8月、<https://www.rfc-editor.org/info/ RFC8621>。

Acknowledgments

謝辞

The author would like to thank the following individuals for contributing their ideas and support for writing this specification: Neil Jenkins, Robert Mueller, and Chris Newman.

著者は、この仕様書を書くための彼らの考えやサポートを貢献するために、次の個人に感謝します.Neil Jenkins、Robert Mueller、およびChris Newman。

Author's Address

著者の住所

Kenneth Murchison Fastmail US LLC 1429 Walnut Street, Suite 1201 Philadelphia, PA 19102 United States of America

Kenneth Murchison Fastmail US LLC 1429 Walnut Street、Suite 1201 Philadelphia、PA 19102アメリカ

   Email: murch@fastmailteam.com
   URI:   http://www.fastmail.com/