A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket
RFC 8887

Document Type RFC - Proposed Standard (August 2020; No errata)
Author Kenneth Murchison 
Last updated 2020-08-27
Replaces draft-murchison-jmap-websocket
Stream IETF
Formats plain text html xml pdf htmlized bibtex
Stream WG state Submitted to IESG for Publication
Document shepherd Jim Fenton
Shepherd write-up Show (last changed 2019-11-25)
IESG IESG state RFC 8887 (Proposed Standard)
Action Holders
Consensus Boilerplate Yes
Telechat date
Responsible AD Alexey Melnikov
Send notices to Jim Fenton <fenton@bluepopcorn.net>
IANA IANA review state IANA OK - Actions Needed
IANA action state RFC-Ed-Ack

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


   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.

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.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at

Copyright Notice

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

   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.

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
   Author's Address

1.  Introduction

   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.

   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.

   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.

2.  Conventions Used in This Document

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "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.

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

3.  Discovering Support for JMAP over WebSocket

   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:

   *  url: "String"

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

   *  supportsPush: "Boolean"

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


   "urn:ietf:params:jmap:websocket": {
     "url": "wss://server.example.com/jmap/ws/",
     "supportsPush": true

4.  JMAP Subprotocol

   The term WebSocket subprotocol refers to an application-level
Show full document text