draft-ietf-jmap-quotas-01.txt   draft-ietf-jmap-quotas-02.txt 
JMAP R. Cordier, Ed. JMAP R.C. Cordier, Ed.
Internet-Draft M. Bailly, Ed. Internet-Draft Linagora Vietnam
Intended status: Standards Track Linagora Intended status: Standards Track 23 August 2021
Expires: September 5, 2020 March 4, 2020 Expires: 24 February 2022
JMAP for Quotas JMAP for Quotas
draft-ietf-jmap-quotas-01 draft-ietf-jmap-quotas-02
Abstract Abstract
This document specifies a data model for handling quotas on accounts This document specifies a data model for handling quotas on accounts
with a server using JMAP. with a server using JMAP.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 31 skipping to change at page 1, line 31
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 5, 2020. This Internet-Draft will expire on 24 February 2022.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents (https://trustee.ietf.org/
(https://trustee.ietf.org/license-info) in effect on the date of license-info) in effect on the date of publication of this document.
publication of this document. Please review these documents Please review these documents carefully, as they describe your rights
carefully, as they describe your rights and restrictions with respect and restrictions with respect to this document. Code Components
to this document. Code Components extracted from this document must extracted from this document must include Simplified BSD License text
include Simplified BSD License text as described in Section 4.e of as described in Section 4.e of the Trust Legal Provisions and are
the Trust Legal Provisions and are provided without warranty as provided without warranty as described in the Simplified BSD License.
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Notational conventions . . . . . . . . . . . . . . . . . 2 1.1. Notational conventions . . . . . . . . . . . . . . . . . 2
1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1. Quota . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Addition to the capabilities object . . . . . . . . . . . 3 1.3. Addition to the capabilities object . . . . . . . . . . . 3
1.3.1. urn::ietf::params::jmap::quota . . . . . . . . . . . 3 1.3.1. urn::ietf::params::jmap::quota . . . . . . . . . . . 3
1.4. Push . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4. Data types . . . . . . . . . . . . . . . . . . . . . . . 3
2. Quota definition . . . . . . . . . . . . . . . . . . . . . . 3 1.4.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1. The Scope Data Type . . . . . . . . . . . . . . . . . . . 4 1.4.2. ResourceType . . . . . . . . . . . . . . . . . . . . 4
2.2. The ResourceType Data Type . . . . . . . . . . . . . . . 4 1.5. Push . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3. The Quota Object . . . . . . . . . . . . . . . . . . . . 4 2. Quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4. Example . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1. Quota/get . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5. Quota/get . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2. Quota/changes . . . . . . . . . . . . . . . . . . . . . . 5
2.5.1. Example . . . . . . . . . . . . . . . . . . . . . . . 6 2.3. Quota/query . . . . . . . . . . . . . . . . . . . . . . . 6
2.6. Quota/changes . . . . . . . . . . . . . . . . . . . . . . 7 2.4. Quota/queryChanges . . . . . . . . . . . . . . . . . . . 7
2.6.1. Example . . . . . . . . . . . . . . . . . . . . . . . 7 2.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7. Quota/query . . . . . . . . . . . . . . . . . . . . . . . 8 2.5.1. Fetching quotas . . . . . . . . . . . . . . . . . . . 7
2.8. Quota/queryChanges . . . . . . . . . . . . . . . . . . . 9 2.5.2. Requesting latest quota changes . . . . . . . . . . . 7
3. Security considerations . . . . . . . . . . . . . . . . . . . 9 3. Security considerations . . . . . . . . . . . . . . . . . . . 8
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
4.1. JMAP Capability Registration for "quota" . . . . . . . . 9 4.1. JMAP Capability Registration for "quota" . . . . . . . . 9
5. Normative References . . . . . . . . . . . . . . . . . . . . 10 5. Normative References . . . . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
JMAP ([RFC8620] - JSON Meta Application Protocol) is a generic JMAP ([RFC8620] - JSON Meta Application Protocol) is a generic
protocol for synchronising data, such as mails, calendars or protocol for synchronising data, such as mails, calendars or
contacts, between a client and a server. It is optimised for mobile contacts, between a client and a server. It is optimised for mobile
and web environments, and aims to provide a consistent interface to and web environments, and aims to provide a consistent interface to
different data types. different data types.
This specification defines a data model for handling mail quotas over This specification defines a data model for handling quotas over
JMAP, allowing you to read and explain quota information. JMAP, allowing you to read and explain quota information.
This specification does not address quota administration, which This specification does not address quota administration, which
should be handled by other means. should be handled by other means.
1.1. Notational conventions 1.1. Notational conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
skipping to change at page 3, line 15 skipping to change at page 3, line 10
Type signatures, examples and property descriptions in this document Type signatures, examples and property descriptions in this document
follow the conventions established in section 1.1 of [RFC8620]. Data follow the conventions established in section 1.1 of [RFC8620]. Data
types defined in the core specification are also used in this types defined in the core specification are also used in this
document. document.
Servers MUST support all properties specified for the new data types Servers MUST support all properties specified for the new data types
defined in this document. defined in this document.
1.2. Terminology 1.2. Terminology
1.2.1. Quota The same terminology is used in this document as in the core JMAP
specification.
A quota is a numeric upper limit that the server is enforcing. The term Quota (with that specific capitalization) is used to refer
Quotas are applied to accounts. to the data type defined in this document and instance of that data
type.
1.3. Addition to the capabilities object 1.3. Addition to the capabilities object
The capabilities object is returned as part of the JMAP Session The capabilities object is returned as part of the JMAP Session
object; see [RFC8620], section 2. object; see [RFC8620], section 2.
This document defines one additional capability URI. This document defines one additional capability URI.
1.3.1. urn::ietf::params::jmap::quota 1.3.1. urn::ietf::params::jmap::quota
This represents support for the Quota data type and associated API This represents support for the Quota data type and associated API
methods. The value of this property in the JMAP session capabilities methods. The value of this property in the JMAP session capabilities
property is an empty object. property is an empty object.
The value of this property in an account's accountCapabilities The value of this property in an account's accountCapabilities
property is an object that MUST contain the following information on property is an object that MUST contain the following information on
server capabilities and permissions for that account: server capabilities and permissions for that account:
o *quotaIds:* "Id[]" (default: "[]") A list of quota ids bound to * *quotaIds:* "Id[]" (default: "[]") A list of quota ids bound to
that account, or "[]" if that account has no quota restrictions. that account, or "[]" if that account has no quota restrictions.
1.4. Push 1.4. Data types
Servers MUST support the JMAP push mechanisms, as specified in
[RFC8620] Section 7, to receive notifications when the state changes
for the Quota type defined in this specification.
2. Quota definition
The quota is an object that displays the limit set to an account In addition to the standard JSON data types, a couple of additional
usage as well as the current usage in regard to that limit. data types are common to the definition of Quota objects and
properties.
2.1. The Scope Data Type 1.4.1. Scope
The *Scope* is a "String" from an enumeration defined list of values, The *Scope* is a "String" from an enumeration defined list of values,
handled by the server. handled by the server.
It explains the entities this value applies to. Some custom It explains the entities this value applies to. Some custom
specifications might provide some additional values. If the client specifications might provide some additional values. If the client
does not specify custom scope specifications in the "using" parameter does not specify custom scope specifications in the "using" parameter
of the request, the server should respond the JSON value "null", of the request, the server should respond the JSON value "null",
instead of answering a scope value that the client does not support. instead of answering a scope value that the client does not support.
Standard values are: Standard values are:
o "account": Applies for this account * "account": Applies for this account
o "domain": All users of this domain share this part of the quota * "domain": All accounts of this domain share this part of the quota
o "global": All users of this mail server share this part of the * "global": All accounts of this server share this part of the quota
quota
2.2. The ResourceType Data Type 1.4.2. ResourceType
The *ResourceType* is a "String" from an enumeration defined list of The *ResourceType* is a "String" from an enumeration defined list of
values, handled by the server. values, handled by the server.
A resource type is like an unit of measure for the quota usage. Some A resource type is like an unit of measure for the quota usage. Some
custom specifications might provide some additional values. If the custom specifications might provide some additional values. If the
client does not specify custom resource type specifications in the client does not specify custom resource type specifications in the
"using" parameter of the request, the server should respond the JSON "using" parameter of the request, the server should respond the JSON
value "null", instead of answering a resource type value that the value "null", instead of answering a resource type value that the
client does not support. Standard values are: client does not support. Standard values are:
o "count": The quota is measured in number of data type objects. * "count": The quota is measured in number of data type objects.
For example, a quota can have a limit of 50 "Mail" objects. For example, a quota can have a limit of 50 "Mail" objects.
o "size": The quota is measured in size. The default unit is in * "size": The quota is measured in size (in "bytes"). For example,
"bytes", but a server can decide of the unit it wants to use (like a quota can have a limit of 25000 "bytes".
in "octets"). For example, a quota can have a limit of 25000
"bytes"
2.3. The Quota Object 1.5. Push
Servers MUST support the JMAP push mechanisms, as specified in
[RFC8620] Section 7, to receive notifications when the state changes
for the Quota type defined in this specification.
2. Quota
The quota is an object that displays the limit set to an account
usage as well as the current usage in regard to that limit.
The quota object MUST contain the following fields: The quota object MUST contain the following fields:
o *id*: "Id" The unique identifier for this object. It should * *id*: "Id" The unique identifier for this object. It should
respect the JMAP ID datatype defined in section 1.2 of [RFC8620] respect the JMAP ID datatype defined in section 1.2 of [RFC8620]
o *resourceType*: "ResourceType" The resource type of the quota. * *resourceType*: "ResourceType" The resource type of the quota.
o *used*: "UnsignedInt" The current usage of the mailbox. * *used*: "UnsignedInt" The current usage of the defined quota.
Computation of this value is handled by the server. Computation of this value is handled by the server.
o *limit*: "UnsignedInt" The hard limit set by this quota object. * *limit*: "UnsignedInt" The hard limit set by this quota object.
No more outgoing and ingoing messages should be allowed if we No more outgoing and ingoing objects should be allowed if we reach
reach this limit. It should higher than the "warnLimit" and the this limit. It should be higher than the "warnLimit" and the
"softLimit". "softLimit".
o *scope*: "Scope" The "Scope" of this quota. * *scope*: "Scope" The "Scope" of this quota.
o *name*: "String" The name of the quota object. Useful for * *name*: "String" The name of the quota object. Useful for
managing quotas and use queries for searching. managing quotas and use queries for searching.
o *datatypes*: "String[]" A list of all the data types values that * *datatypes*: "String[]" A list of all the data types values that
are applying to this quota. This allows to assign quotas to are applying to this quota. This allows to assign quotas to
separated or shared data types. This MAY include data types the separated or shared data types. This MAY include data types the
client does not recognise. Clients MUST ignore any unknown data client does not recognise. Clients MUST ignore any unknown data
type in the list. type in the list.
The quota object MAY contain the following field: The quota object MAY contain the following field:
o *warnLimit*: "UnsignedInt|null" The warn limit set by this quota * *warnLimit*: "UnsignedInt|null" The warn limit set by this quota
object. It can be used to send a warning to an user that he is object. It can be used to send a warning to an entity about to
going to reach the hard limit soon, but no action is taken. If reach the hard limit soon, but with no action taken yet. If set,
set, it should be lower than the "softLimit" and the "limit". it should be lower than the "softLimit" and the "limit".
o *softLimit*: "UnsignedInt|null" The soft limit set by this quota * *softLimit*: "UnsignedInt|null" The soft limit set by this quota
object. It can be used to block outgoing messages, but still object. It can be used to still allow some operations, but
allowing incoming messages. If set, it should be higher than the refusing some others. What is allowed or not is up to the server.
"warnLimit" but lower than the "limit". If set, it should be higher than the "warnLimit" but lower than
the "limit".
o *description*: "String|null" Arbitrary free, human readable, * *description*: "String|null" Arbitrary free, human readable,
description of this quota. Might be used to explain where the description of this quota. Might be used to explain where the
limit comes from and explain the entities this quota applies to. limit comes from and explain the entities and data types this
quota applies to.
2.4. Example
{
"id": "2a06df0d-9865-4e74-a92f-74dcc814270e",
"resourceType": "count",
"used": 1056,
"warnLimit": 1600,
"softLimit": 1800,
"limit": 2000,
"scope": "account",
"name": "bob@example.com",
"description": "Personal account usage",
"datatypes" : [ "Mail", "Calendar", "Contact" ]
}
2.5. Quota/get 2.1. Quota/get
Standard "/get" method as described in [RFC8620] section 5.1. The Standard "/get" method as described in [RFC8620] section 5.1. The
ids argument may be "null" to fetch all at once. ids argument may be "null" to fetch all at once.
2.5.1. Example 2.2. Quota/changes
Standard "/changes" method as described in [RFC8620] section 5.2 but
with one extra argument to the response:
* *updatedProperties*: "String[]|null" If only the "used" Quota
properties has changed since the old state, this will be the list
of properties that may have changed. If the server is unable to
tell if only "used" has changed, it MUST just be null.
Since "used" frequently changes but other properties are generally
only changed rarely, the server can help the client optimise data
transfer by keeping track of changes to Quota usage separate from
other state changes. The updatedProperties array may be used
directly via a back-reference in a subsequent Quota/get call in the
same request, so only these properties are returned if nothing else
has changed.
Servers MAY decide to add other properties to the list that they
judge changing frequently.
2.3. Quota/query
This is a standard "/query" method as described in [RFC8620],
Section 5.5.
A *FilterCondition* object has the following properties, any of which
may be omitted:
* *name*: "String" The Quota _name_ property contains the given
string.
* *scopes*: "Scope[]" The Quota _scope_ property must be in this
list to match the condition.
* *resourceTypes*: "ResourceType[]" The Quota _resourceType_
property must be in this list to match the condition.
* *datatypes*: "String[]" The Quota _datatypes_ property must
contain the elements in this list to match the condition.
A Quota object matches the FilterCondition if and only if all of the
given conditions match. If zero properties are specified, it is
automatically true for all objects.
The following Quota properties MUST be supported for sorting:
* *name*
* *used*
2.4. Quota/queryChanges
This is a standard "/queryChanges" method as described in [RFC8620],
Section 5.6.
2.5. Examples
2.5.1. Fetching quotas
Request fetching all quotas related to an account : Request fetching all quotas related to an account :
[[ "Quota/get", { [[ "Quota/get", {
"accountId": "u33084183", "accountId": "u33084183",
"ids": null "ids": null
}, "0" ]] }, "0" ]]
With response : With response :
skipping to change at page 7, line 27 skipping to change at page 7, line 45
"description": "Personal account usage", "description": "Personal account usage",
"datatypes" : [ "Mail", "Calendar", "Contact" ] "datatypes" : [ "Mail", "Calendar", "Contact" ]
}, { }, {
"id": "3b06df0e-3761-4s74-a92f-74dcc963501x", "id": "3b06df0e-3761-4s74-a92f-74dcc963501x",
"resourceType": "size", "resourceType": "size",
... ...
}, ...], }, ...],
"notFound": [] "notFound": []
}, "0" ]] }, "0" ]]
2.6. Quota/changes 2.5.2. Requesting latest quota changes
Standard "/changes" method as described in [RFC8620] section 5.2 but
with one extra argument to the response:
o *updatedProperties*: "String[]|null" If only the "used" Quota
properties has changed since the old state, this will be the list
of properties that may have changed. If the server is unable to
tell if only "used" has changed, it MUST just be null.
Since "used" frequently changes but other properties are generally
only changed rarely, the server can help the client optimise data
transfer by keeping track of changes to Quota usage separate from
other state changes. The updatedProperties array may be used
directly via a back-reference in a subsequent Quota/get call in the
same request, so only these properties are returned if nothing else
has changed.
Servers MAY decide to add other properties to the list that they
judge changing frequently.
2.6.1. Example
Request: Request fetching the changes for a specific quota:
[[ "Quota/changes", { [[ "Quota/changes", {
"accountId": "u33084183", "accountId": "u33084183",
"sinceState": "10824", "sinceState": "10824",
"maxChanges": 20 "maxChanges": 20
}, "0" ], }, "0" ],
[ "Quota/get", { [ "Quota/get", {
"accountId": "u33084183", "accountId": "u33084183",
"#ids": { "#ids": {
"resultOf": "0", "resultOf": "0",
"name": "Quota/changes", "name": "Quota/changes",
"path": "/updated" "path": "/updated"
}, },
"#properties": { "#properties": {
"resultOf": "0", "resultOf": "0",
"name": "Quota/changes", "name": "Quota/changes",
"path": "/updatedProperties" "path": "/updatedProperties"
} }
}, "1" ]] }, "1" ]]
Response: With response:
[[ "Quota/changes", { [[ "Quota/changes", {
"accountId": "u33084183", "accountId": "u33084183",
"oldState": "10824", "oldState": "10824",
"newState": "10826", "newState": "10826",
"hasMoreChanges": false, "hasMoreChanges": false,
"created": [], "created": [],
"updated": ["2a06df0d-9865-4e74-a92f-74dcc814270e"], "updated": ["2a06df0d-9865-4e74-a92f-74dcc814270e"],
"destroyed": [] "destroyed": []
}, "0" ], }, "0" ],
[ "Quota/get", { [ "Quota/get", {
"accountId": "u33084183", "accountId": "u33084183",
"state": "10826", "state": "10826",
"list": [{ "list": [{
"id": "2a06df0d-9865-4e74-a92f-74dcc814270e", "id": "2a06df0d-9865-4e74-a92f-74dcc814270e",
"used": 1246 "used": 1246
}], }],
"notFound": [] "notFound": []
}, "1" ]] }, "1" ]]
2.7. Quota/query
This is a standard "/query" method as described in [RFC8620],
Section 5.5.
A *FilterCondition* object has the following properties, any of which
may be omitted:
o *name*: "String" The Quota _name_ property contains the given
string.
o *scopes*: "Scope[]" The Quota _scope_ property must be in this
list to match the condition.
o *resourceTypes*: "ResourceType[]" The Quota _resourceType_
property must be in this list to match the condition.
o *datatypes*: "String[]" The Quota _datatypes_ property must
contain the elements in this list to match the condition.
A Quota object matches the FilterCondition if and only if all of the
given conditions match. If zero properties are specified, it is
automatically true for all objects.
The following Quota properties MUST be supported for sorting:
o *name*
o *used*
2.8. Quota/queryChanges
This is a standard "/queryChanges" method as described in [RFC8620],
Section 5.6.
3. Security considerations 3. Security considerations
All security considerations of JMAP ([RFC8620]) apply to this All security considerations of JMAP ([RFC8620]) apply to this
specification. specification.
4. IANA Considerations 4. IANA Considerations
4.1. JMAP Capability Registration for "quota" 4.1. JMAP Capability Registration for "quota"
IANA will register the "quota" JMAP Capability as follows: IANA will register the "quota" JMAP Capability as follows:
skipping to change at page 10, line 20 skipping to change at page 9, line 36
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8620] Jenkins, N. and C. Newman, "The JSON Meta Application [RFC8620] Jenkins, N. and C. Newman, "The JSON Meta Application
Protocol (JMAP)", RFC 8620, DOI 10.17487/RFC8620, July Protocol (JMAP)", RFC 8620, DOI 10.17487/RFC8620, July
2019, <https://www.rfc-editor.org/info/rfc8620>. 2019, <https://www.rfc-editor.org/info/rfc8620>.
Authors' Addresses Author's Address
Rene Cordier (editor) René Cordier (editor)
Linagora Linagora Vietnam
100 Terrasse Boieldieu - Tour Franklin 5 Dien Bien Phu
Paris - La Defense CEDEX 92042 Hanoi
France 10000
Vietnam
Email: rcordier@linagora.com Email: rcordier@linagora.com
URI: https://www.linagora.com URI: https://linagora.vn
Michael Bailly (editor)
Linagora
100 Terrasse Boieldieu - Tour Franklin
Paris - La Defense CEDEX 92042
France
Email: mbailly@linagora.com
URI: https://www.linagora.com
 End of changes. 42 change blocks. 
157 lines changed or deleted 149 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/