RFC 9670: JSON Meta Application Protocol (JMAP) Sharing
- N. Jenkins, Ed.
Abstract
This document specifies a data model for sharing data between users using the JSON Meta Application Protocol (JMAP). Future documents can reference this document when defining data types to support a consistent model of sharing.¶
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
https://
Copyright Notice
Copyright (c) 2024 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://
1. Introduction
The JSON Meta Application Protocol (JMAP) [RFC8620] is a generic protocol for synchronizing data, such as mail, calendars, or contacts, between a client and a server. It is optimized for mobile and web environments and provides a consistent interface to query, read, and modify different data types, including comprehensive error handling.¶
This specification defines a data model to represent entities in a collaborative environment and a framework for sharing data between them that can be used to provide a consistent sharing model for different data types. It does not define what may be shared or the granularity of permissions, as this will depend on the data in question.¶
1.1. Notational Conventions
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.¶
Type signatures, examples, and property descriptions in this document follow the conventions established in Section 1.1 of [RFC8620]. Data types defined in the core specification are also used in this document.¶
Examples of API exchanges only show the methodCalls array of the Request object or the methodResponses array of the Response object. For compactness, the rest of the Request
1.2. Terminology
The same terminology is used in this document as in the core JMAP specification. See [RFC8620], Section 1.6.¶
The terms "Principal" and "Share
1.3. Data Model Overview
A Principal (see Section 2) represents an individual, team, or resource (e.g., a room or projector). The object contains information about the entity being represented, such as a name, description, and time zone. It may also hold domain-specific information. A Principal may be associated with zero or more Accounts (see [RFC8620], Section 1.6.2) containing data belonging to the Principal. Managing the set of Principals within a system is out of scope for this specification, as it is highly domain specific. It is likely to map directly from a directory service or other user management system.¶
Data types may allow users to share data with others by assigning permissions to Principals. When a user's permissions are changed, a Share
1.4. Subscribing to Shared Data
Permissions determine whether a user may access data but not whether they want to. Some shared data is of equal importance as the user's own, while other data is just there should the user wish to explicitly go find it. Clients will often want to differentiate the two. For example, a company may share mailing list archives for all departments with all employees, but a user may only generally be interested in the few they belong to. They would have permission to access many mailboxes but can subscribe to just the ones they care about. The client would provide separate interfaces for reading mail in subscribed mailboxes and browsing all mailboxes they have permission to access in order to manage those that they are subscribed to.¶
The JMAP Session object (see [RFC8620], Section 2) is defined to include an object in the "accounts" property for every Account that the user has access to. Collaborative systems may share data between a very large number of Principals, most of which the user does not care about day to day. For servers implementing this specification, the Session object MUST only include Accounts where either the user is subscribed to at least one record (see [RFC8620], Section 1.6.3) in the Account or the Account belongs to the user. StateChange events ([RFC8620], Section 7.1) for changes to data SHOULD only be sent for data the user has subscribed to and MUST NOT be sent for any Account where the user is not subscribed to any records in the Account, except where that Account belongs to the user.¶
The server MAY reject the user's attempt to subscribe to some resources even if they have permission to access them (e.g., a calendar representing a location).¶
A user can query the set of Principals they have access to with "Principal
1.5. Addition to the Capabilities Object
The capabilities object is returned as part of the JMAP Session object; see [RFC8620], Section 2. This document defines two additional capability URIs.¶
1.5.1. urn:ietf:params:jmap:principals
The urn capability represents support for the Principal and Share
The value of this property in the JMAP Session "capabilities" property is an empty object.¶
The value of this property in an Account's "account
-
current
User :Principal Id Id|null - The id of the Principal in this Account that corresponds to the user fetching this object, if any.¶
1.5.2. urn:ietf:params:jmap:principals:owner
The URI urn is solely used as a key in an Account's "accounturn URI being present in the session capabilities.¶
If urn is a key in an Account's "account
The value of this property is an object with the following properties:¶
2. Principals
A Principal represents an individual, a group, a location (e.g., a room), a resource (e.g., a projector), or another entity in a collaborative environment. Sharing in JMAP is generally configured by assigning rights to certain data within an Account to other Principals. For example, a user may assign permission to read their calendar to a Principal representing another user or their team.¶
In a shared environment, such as a workplace, a user may have access to a large number of Principals.¶
In most systems, the user will have access to a single Account containing Principal objects. In some situations, for example, when aggregating data from different places, there may be multiple Accounts containing Principal objects.¶
A Principal object has the following properties:¶
-
id:
Id(immutable; server-set) - The id of the Principal.¶
-
type:
String -
This MUST be one of the following values:¶
-
name:
String - The name of the Principal, e.g., "Jane Doe" or "Room 4B".¶
-
description:
String|null - A longer description of the Principal, for example, details about the facilities of a resource, or null if no description is available.¶
-
email:
String|null - An email address for the Principal, or
nullif no email is available. If given, the value MUST conform to the "addr-spec" syntax, as defined in [RFC5322], Section 3.4.1.¶ -
timeZone:
String|null - The time zone for this Principal, if known. If not
null, the value MUST be a time zone name from the IANA Time Zone Database [IANA-TZDB].¶ -
capabilities:
String[Object](server-set) - A map of JMAP capability URIs to domain-specific information about the Principal in relation to that capability, as defined in the document that registered the capability.¶
-
accounts:
Id[Account]|null(server-set) - A map of Account id to Account object for each JMAP Account containing data
for this Principal that the user has access to, or
nullif none.¶
2.1. Principal/get
This is a standard "/get" method as described in [RFC8620], Section 5.1.¶
2.2. Principal/changes
This is a standard "/changes" method as described in [RFC8620], Section 5.2.¶
2.3. Principal/set
This is a standard "/set" method as described in [RFC8620], Section 5.3.¶
Managing Principals is likely tied to a directory service or some other vendor-specific solution. This management may occur out of band or via an additional capability defined elsewhere. Allowing direct user modification of properties has security considerations, as noted in Section 6. A server MUST reject any change it doesn't allow with a "forbidden" SetError.¶
Where a server does support changes via this API, it SHOULD allow an update to the "name", "description", and "timeZone" properties of the Principal with the same id as the "current
2.4. Principal/query
This is a standard "/query" method as described in [RFC8620], Section 5.5.¶
2.4.1. Filtering
A FilterCondition object has the following properties, all of which are optional:¶
-
accountIds:
String[] - A list of Account ids. The Principal matches if any of the ids in this list are keys in the Principal's "accounts" property (i.e., if any of the Account ids belong to the Principal).¶
-
email:
String - The email property of the Principal contains the given string.¶
-
name:
String - The name property of the Principal contains the given string.¶
-
text:
String - The name, email, or description property of the Principal contains the given string.¶
-
type:
String - The type must be exactly as given to match the condition.¶
-
timeZone:
String - The timeZone must be exactly as given to match the condition.¶
All given conditions in the FilterCondition object must match for the Principal to match.¶
Text matches for "contains" SHOULD be simple substring matches.¶
2.5. Principal/queryChanges
This is a standard "/queryChanges" method as described in [RFC8620], Section 5.6.¶
5. Internationalization Considerations
Experience has shown that unrestricted use of Unicode can lead to problems such as inconsistent rendering, users reading text and interpreting it differently than intended, and unexpected results when copying text from one location to another. Servers MAY choose to mitigate this by restricting the set of characters allowed in otherwise unconstrained String fields. The FreeformClass, as documented in [RFC8264], Section 4.3, might be a good starting point for this.¶
Attempts to set a value containing code points outside of the permissible set can be handled in a few ways by the server. The first option is to simply strip the forbidden characters and store the resulting string. This is likely to be appropriate for control characters, for example, where they can end up in data accidentally due to copy-and-paste issues and are probably invisible to the end user. JMAP allows the server to transform data on create/update, as long as any changed properties are returned to the client in the "/set" response so it knows what has changed, as per [RFC8620], Section 5.3. Alternatively, the server MAY just reject the create/update with an "invalid
6. Security Considerations
All security considerations of JMAP [RFC8620] apply to this specification. Additional considerations are detailed below.¶
6.1. Spoofing
Allowing users to edit their own Principal's name (and, to a lesser extent, email, description, or type) could allow a user to change their Principal to look like another user in the system, potentially tricking others into sharing private data with them. Servers may choose to forbid this and SHOULD keep logs of such changes to provide an audit trail.¶
Note that simply forbidding the use of a name already in the system is insufficient protection, as a malicious user could still change their name to something easily confused with the existing name by using trivial misspellings or visually similar Unicode characters.¶
6.2. Unnoticed Sharing
Sharing data with another user allows someone to turn a transitory account compromise (e.g., brief access to an unlocked or logged-in client) into a persistent compromise (by setting up sharing with a user that is controlled by the attacker). This can be mitigated by requiring further authorization for configuring sharing or sending notifications to the sharer via another channel whenever a new permission is added.¶
6.3. Denial of Service
By creating many changes to the sharing status of objects, a user can cause many Share
7. IANA Considerations
7.1. JMAP Capability Registration for "principals"
IANA has registered "principals" in the "JMAP Capabilities" registry as follows:¶
7.2. JMAP Capability Registration for "principals:owner"
IANA has registered "principals
8. References
8.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC5322]
-
Resnick, P., Ed., "Internet Message Format", RFC 5322, DOI 10
.17487 , , <https:///RFC5322 www >..rfc -editor .org /info /rfc5322 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8620]
-
Jenkins, N. and C. Newman, "The JSON Meta Application Protocol (JMAP)", RFC 8620, DOI 10
.17487 , , <https:///RFC8620 www >..rfc -editor .org /info /rfc8620
8.2. Informative References
- [IANA-JMAP]
-
IANA, "JMAP Data Types", <https://
www >..iana .org /assignments /jmap - [IANA-TZDB]
-
IANA, "Time Zone Database", <https://
www >..iana .org /time -zones - [RFC8264]
-
Saint-Andre, P. and M. Blanchet, "PRECIS Framework: Preparation, Enforcement, and Comparison of Internationaliz
ed Strings in Application Protocols" , RFC 8264, DOI 10.17487 , , <https:///RFC8264 www >..rfc -editor .org /info /rfc8264