Re: [Jmap] Httpdir early review of draft-ietf-jmap-rest-00

Mark Nottingham <mnot@mnot.net> Mon, 26 February 2024 10:39 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: jmap@ietfa.amsl.com
Delivered-To: jmap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1253FC14F689; Mon, 26 Feb 2024 02:39:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.095
X-Spam-Level:
X-Spam-Status: No, score=-7.095 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b="htAL4nsu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="DZZ6lRAE"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTC0smk25kKm; Mon, 26 Feb 2024 02:39:02 -0800 (PST)
Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6BB05C14F693; Mon, 26 Feb 2024 02:38:57 -0800 (PST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 1B11913800A0; Mon, 26 Feb 2024 05:38:56 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 26 Feb 2024 05:38:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1708943936; x=1709030336; bh=dVfxiVbd99IY5zbeY9h8pNZ/geCLK7AYTgpnvZ4cWEY=; b= htAL4nsunhTwKEemMjEF64ZUpFtZtzqNZVkfstctJ4bMwENoO82A2CJrB+YOC+dn HzyExcMMTvSBTtKjyCBXpjJvesKivdFjrIL/m9nVSCIZLeyhH9eBh3iLUcs2MnDy VoGVLXCTjEqzLnXcsJGC7wdU/hI0+yeihTjZiwlLm86oj6a92gaEgyQUSuLijF0/ I2LTexKD1feU9MXrwLMPCH50kUa0r6+oDyZ4c9EK2j+/LpbQMjhZxZDmcyraeuLL llFcfQrUh3v4RSqEEsoUDKn1U3iIYBMnR4FnKuSKz7IL5PCC4zCMM8i7mNOrdvQj H+v5KM8DNHQOorRxoP6TkQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708943936; x= 1709030336; bh=dVfxiVbd99IY5zbeY9h8pNZ/geCLK7AYTgpnvZ4cWEY=; b=D ZZ6lRAEKOmVotojIfmAkXt47PHix+PgeA9ypAj7CIGdS/jXuGjCcXeuvIHMOqQYU O5LW8Yq4pJADOHzuECyEcYBJ3QkhL2ZvcqnnOeCDDVZ1C/3WSdoOxeob2nBflIWu HlbSmypyiMaZgnTRTlFsqLZCsLT+palVxjHTvXkWLIub1QB24wnTNeO4+WBvKGVo nNJub7b5oc2DJXWFzqlKoMQbl92JF1sNJStNi/Xzp5EZgpVIhPHdO/sdqOMIjLUd shtv92Y3rSNv5SGRh8ThEEtujFBhjXDi1taZ2IGGqcIkeo/hfDFYIkxag5Vku9tk rwIdknIiCH9qO3a1+vcvQ==
X-ME-Sender: <xms:P2rcZTajJcTaVwDCuJD5HMN3k85orq96MhXnm1a_jPllg0lOx-jYjA> <xme:P2rcZSYeZ-Zc0rtNi64B4LiGH4UjOMjom2Syn_ntGwM0lV0b8oNsQQ-eRFRfKvA7_ rlUPdTa3jOTJoCvQA>
X-ME-Received: <xmr:P2rcZV9SZnUEzvf5CoFhKqVDY0XYfBYcZH9eGbgFqUErB3_19SoG28srRvOOhUm_aTDwGsHKdtZ2sJMxfkBFYYyvfHcnZpkEOZUIwT0eTSOlYcy50ELVkGFL>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgedvgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjffevgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepofgrrhhk ucfpohhtthhinhhghhgrmhcuoehmnhhothesmhhnohhtrdhnvghtqeenucggtffrrghtth gvrhhnpeekhfevhedtudehiefftdfhtdehteeggfeuieeghedvjeeikedthfektdfhgefh udenucffohhmrghinheprghuughrihhgrgdrtghomhdpthifihhtthgvrhdrtghomhdpmh hnohhtrdhnvghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhnohhtsehmnhhothdrnhgvth
X-ME-Proxy: <xmx:P2rcZZrYCYE9i51VUhjX8g2UCrWWWuSVtzliuF13-7cSMaRhx97nkA> <xmx:P2rcZepZB0Asgd2vpBPhXGQ5M7JrXkXqrBb2bqN-i3wGVqTuGTIhTw> <xmx:P2rcZfQgiC5vJK8tiIOOGJAyRXsaFTgEqw0juGRB08hgIznzjtMavA> <xmx:QGrcZbAGJ74L5y-Y38DuP1Itl9o3zmZb5lL4IIZ_JhZLe9Fif7H7KA>
Feedback-ID: ie6694242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Feb 2024 05:38:53 -0500 (EST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <3c63212b-42c0-423d-a582-771f2bebf30d@audriga.com>
Date: Mon, 26 Feb 2024 21:38:53 +1100
Cc: Neil Jenkins <neilj@fastmailteam.com>, ietf-http-wg@w3.org, draft-ietf-jmap-rest.all@ietf.org, IETF JMAP Mailing List <jmap@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <0978C454-3B38-4D3F-BDBF-4B28D79AED63@mnot.net>
References: <170857809922.36013.3477270772418859864@ietfa.amsl.com> <39d25b51-8161-4781-b7a7-51191a3ef867@dogfoodapp.fastmail.com> <3c63212b-42c0-423d-a582-771f2bebf30d@audriga.com>
To: Joris Baum <joris@audriga.com>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/Ot_o9kCZeGcG4Cn3usq9PsTpIqc>
Subject: Re: [Jmap] Httpdir early review of draft-ietf-jmap-rest-00
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: JSON Message Access Protocol <jmap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jmap>, <mailto:jmap-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap/>
List-Post: <mailto:jmap@ietf.org>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jmap>, <mailto:jmap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 26 Feb 2024 10:39:09 -0000

Hi Joris,

My pleasure; it's nice to hear it was helpful.

Cheers!


> On 26 Feb 2024, at 18:43, Joris Baum <joris@audriga.com> wrote:
> 
> Thanks for the reviews!
> I am a bit unhappy about the state of the document myself. Your comments definitely helped and gave me some ideas on how to approach this. I will try to come up with something soon to address this.
> Regards,
> Joris
> On 26.02.24 02:35, Neil Jenkins wrote:
>> On Thu, 22 Feb 2024, at 16:01, Mark Nottingham via Datatracker wrote:
>>> * Section 2 always uses POST. Is it possible to map some calls to GET to obtain
>>> benefits such as caching, idempotence, retry ability, etc.?
>> 
>> I agree. I think for this mapping to be useful, it should aim to work as this style of API normally does, rather than aim to have the full capabilities of JMAP. So just map the CRUD operations, with each request operating on a single object rather than any kind of batching. Don't worry about the state strings. You'd probably still only need a single templated URL like:
>> 
>> apiRestUrl: "/api/{accountId}/{typeName}
>> 
>> 
>> Then you would map everything onto this. I would expect fetching a record to look something like:
>> GET /api/account1/Calendar/123-12345?properties=["name", "color"]
>> 
>> 
>> Returning:
>> {
>> "id": "123-12345",
>> "name": "Personal",
>> "color": "#ff0000"
>> }
>> 
>> or a 404  if not found.
>> 
>> Creates would be a POST to the type collection, updates would be a PATCH to the specific resource for an object, and destroys would be a DELETE to the resource.
>> 
>> Querying is the more interesting one, and a bit trickier to specify. I would expect something like:
>> 
>> GET /api/account1/Email?filter={"inMailbox":"inbox-id"}&position=10&limit=10&properties=["to","cc","receviedAt"]
>> 
>> to do an Email/query with the given filter/position/limit, then an Email/get for each of the results, with the properties passed through to that. Probably a JSON array of objects would be the response. You could again omit delta changes, state strings, returning the overall total, anchor-based querying etc. — just keep it simple.
>> 
>> Cheers,
>> Neil.
> -- 
> Joris Baum
> Tel: +49 721 170293 16
> Fax: +49 721 170293 179
> 
> http://www.audriga.com | http://www.twitter.com/audriga
> 
> --------------------------------------------------------------------------
> audriga GmbH | Alter Schlachthof 57 | 76137 Karlsruhe
> Sitz der Gesellschaft: Karlsruhe - Amtsgericht Mannheim - HRB 713034
> Geschäftsführer: Dr. Frank Dengler, Dr. Hans-Jörg Happel
> --------------------------------------------------------------------------

--
Mark Nottingham   https://www.mnot.net/