Re: [httpapi] Byte range PATCH

Darrel Miller <darrel@tavis.ca> Sun, 05 February 2023 15:47 UTC

Return-Path: <darrel@tavis.ca>
X-Original-To: httpapi@ietfa.amsl.com
Delivered-To: httpapi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A94D2C14F74A for <httpapi@ietfa.amsl.com>; Sun, 5 Feb 2023 07:47:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.897
X-Spam-Level:
X-Spam-Status: No, score=-6.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-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 (1024-bit key) header.d=tavisdev.onmicrosoft.com
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 R2SqthoSH99f for <httpapi@ietfa.amsl.com>; Sun, 5 Feb 2023 07:47:36 -0800 (PST)
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::60d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 70173C14E514 for <httpapi@ietf.org>; Sun, 5 Feb 2023 07:47:35 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ziluf/Y5D1Hy4aBe3S2Sfnx7KnDqak+iZ3HdyyCLbogGyELsoCEIwH0b5Ndd0nhYTLgaeQ37qt58BMuOMGxadA7hDPu+r4ryLtI0OeNn8isWzwPXtfQEM4VKeTS8m2IS8Vd3OeWUGpNIlapOJbY8SCAMiRP1J8T+z3sPFHxPSiEWDCqM6PeDVx57MIt9G/BObkeswDisryjrfaIj/xsBmPSqhlIGFI+GYUp+x575AZFT7SXiSHbjpmWzpgBekCl0+4jhGJfW1ZizaN23GxmXbyJAaMIBIu3e7gXpLEhZ57o6p8ZQ/p7Jx9jYh2BlZKHs+j3GgAQqe4S1jph/eHsdCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ud2jQOz3J3Dcr0uIBP43LQUElJrl2Dax3rY2708/axI=; b=WbZizqgoDdiQBfsvl3Uo5WhocitnFLQy7mPPAzjatCfrvdN1SrlGCwdFdbeVBR2kPHRqhsD/cSndX8ChQ/o6DjsUBbC3pBFY3VhQf5/UbiPw8rZgF2Fa+t0kAqNY7fZlEFrJhU0YK4VMtv00p/xa6eIm6YZWxWoEGppryDkXa1RMBLku/w334gvfDfQJ5t4wPHHpdOrVlh1KIhaFU37FibdGIup0o661P4x2Qy1HU/FUq92HpW4bR8ejfVGB8Bbx872Ib3HusvcU01Hp6zfzjhLC5i825v+yVQor3fIfNq+asSPd5wLNO+xiLfnIqdXzDRlFXRlZ4U9hyV3fr/jeqg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=tavis.ca; dmarc=pass action=none header.from=tavis.ca; dkim=pass header.d=tavis.ca; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tavisdev.onmicrosoft.com; s=selector2-tavisdev-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ud2jQOz3J3Dcr0uIBP43LQUElJrl2Dax3rY2708/axI=; b=XfQ+nU+/foODpQKs0aK5es872Tv5wsAnp0vrANWenaefyQ5c/KzXTtgXiyZ3cGruxduVpICUGQapp2Oxhqjs5crffY3/nCuchnZk9D7S+D3THTk+LY6zelK9U4woSXDPcWC6yqIH7XmJSWY8u/EjjK8QAKMY7ufD5YjfjC2m2DY=
Received: from DM6PR01MB5964.prod.exchangelabs.com (2603:10b6:5:202::33) by BL0PR01MB4993.prod.exchangelabs.com (2603:10b6:208:69::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.29; Sun, 5 Feb 2023 15:47:31 +0000
Received: from DM6PR01MB5964.prod.exchangelabs.com ([fe80::46f:6683:2a0a:bcb0]) by DM6PR01MB5964.prod.exchangelabs.com ([fe80::46f:6683:2a0a:bcb0%4]) with mapi id 15.20.6064.032; Sun, 5 Feb 2023 15:47:31 +0000
From: Darrel Miller <darrel@tavis.ca>
To: Austin William Wright <aaa@bzfx.net>, HTTP APIs Working Group <httpapi@ietf.org>
Thread-Topic: [httpapi] Byte range PATCH
Thread-Index: AQHZL2+nQVHMBSrY3ES1dJcfEBp/xq7AinNm
Date: Sun, 05 Feb 2023 15:47:31 +0000
Message-ID: <DM6PR01MB59643D37BCB22B0EC5863253A3D59@DM6PR01MB5964.prod.exchangelabs.com>
References: <4589CE6D-6C89-4450-AF7A-BC7F5659F3FA@bzfx.net>
In-Reply-To: <4589CE6D-6C89-4450-AF7A-BC7F5659F3FA@bzfx.net>
Accept-Language: en-US
Content-Language: en-CA
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=tavis.ca;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DM6PR01MB5964:EE_|BL0PR01MB4993:EE_
x-ms-office365-filtering-correlation-id: 92f3f526-4728-4767-42d9-08db07904ac7
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: yQOeW1y/w6C1GpTMdi4i/z8ZsJN99SEJbJEmjzaD9n3xCCVColpHDdUYu5WZRhfcxS0O9sJfK6NCo50GdGV87oDTEncgVav5O1DkSA87drbC9nKoYD1L5IfP+kB39ZTTx9Nxsyg91Vmh1vj+BToG77kEmf+dbPGuUK6AHz+rZoAKKHNCP/2tN04T9/Y6brx58v8jfo7AeAjD/zNj4lFGbxFWGq4T8fOKBDzSMA/lTY7oFwjUhpBsHez4Ga/rX6bgm4/AvQVULvDIaq8gXOkjPBNVZPlmhLMUewCNy1NcyDCCyloFvE9G/Xt+xcqZcKgpLLzhpgg0kJhvPoiEfCNcs3vpRBn27iV2bufWxhbnxmykDxGyZliIjJASwlfGTbdUrLbqmTM5lgxCPsWdc46bbtuOzLh3+tTZiu1uXQhMuXqp+yCeqdeoYLt52B4IjE+niKwG58/N/Bs0rxy6GwFurEC5nbggW4++Vb+oWaxalJCilWzYGml+CjuyuQ2YkZc6o81zVS3ociOZ3lYDohCqu1+Jz3qDvv6vVlnvcFgrKxtXsndRtN8AuytlQdyhcnX+xmhJMHuQWGaFGp2VSvToQ+hAMhCAcOpDYqFOwegnn3M4sED8XfgTygNjLHJZY3NmEE8kKBICJJ50NSWyz7dD+Na8lwaWtFhEKz0oXSN4Hv8Vq+j8CicqoQEWYi2+rn5vxRng5NHdiYkQ28LwIXDb6s812EcaBFOpYhJ9NYAVOBg=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR01MB5964.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230025)(366004)(396003)(346002)(39830400003)(376002)(136003)(451199018)(41300700001)(7696005)(966005)(52536014)(53546011)(122000001)(6506007)(33656002)(8936002)(5660300002)(26005)(21615005)(38070700005)(38100700002)(9686003)(55016003)(186003)(478600001)(316002)(166002)(2906002)(71200400001)(83380400001)(91956017)(86362001)(66446008)(66556008)(66476007)(64756008)(8676002)(110136005)(76116006)(66946007); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 0HTIKzHTtdQ97KTg+hcSAVN0fmP0nPO0lAIQzqY/ziv+ab34puiSj9ULFUBcHmFC6Fzqs/lR18l1p5Fww+HLr+Rdf1fQJORIrfJPqoDTujCT/14vXUCfk+yW4ysM6F+YxGvue7BDigAVKOca/EPW9f4lM8ic5i/Rgt/BiWFVcCAPl+0GzkVZWK+pR+pCX9gQ675Okz93Ey1dBv8D5U+/Xx44OA0p3f4FXYeYCJemo/ODctIZQLkb6WxizGjHxHMKJtPRHPi9RsKc1ofU5roFwoySPMDg/lQoAAqf8aK6hHMA6+pIjdifmdVUUlzqagwp5AGBrhPooFFFPStgEKXRbuwxcg8oVhLMqzRQJPxv01qQKQB0ZwVMucLUh5/5bljGB2PTwYTzuWFvKv2SC0O6FsuqSNEc1WYy8K5NNrih8xgSWhTDZps8IJpJJlw+Fqvb9oCxlrf3LNG2O5GLBr3WTADmlkY+Zf3KSY2/eYV4V9FiRIiLTFIsbBgxTLMCadim9timj8SdyUzXASJdPBn/csat48r1ZxmezIWIoc1wp9PMRlrCyxD6xt+PKFl45WAGTH/wtYkGu1yR7CizZHOtJiLB5XTTq5RG+IWES+FtCigNahXLLa/9TnVdlHUamjtHTc+AyXZhUGy20jdHP0Mhb8FnYEBQpc2JyFdzGr+d9/ZnZpFU5GVxPDgOU0rknboTGCnP4+64/O6GqDG9bwQwRuSULa9LwiPtssSMiFaagZ3ULnvIKSQB5qPC88IKYzkVHkr+LN/8tl8tIkZcFhqPz7cuizlJIwxhXxzkObyMG+fGorNx92QspX9NuJt5vHYaY7wr8IsuDK+cCrCean51uPAxvFUsvhC7HFJJbPyjbCn20trikxqrlP/WvUWNVEh10gaNmSomLyfOH7u0DRi6SAd5rIzlaUO+n8rahgMX7+7GQgRp4NRvvcgYf73YGFr2XHOG/SYVmaJt17j37sXz5oHeW/Y2XkWGkaPKTSbTeUx2rDVO5Xm08/g5iCYrL6+nxyclPd3pdQh1wahxWNP+8Uo1aKZGKWjKBqYA8pJnd9Hwub60ABSsEAAeKuEPguIHv5VCiHNjzHdqKx4rAtErCYy/IIJSjmw087CvGIWkZX5TwQe8wziRMlDhOo7vnxqgAlpizEXMSA3Rb+Pk1RYNLD88t1T4vqoGk+ZWtThb3Ft/kRb5pYMH/UUofKBXIV8COqPofrOZsYDFVuXUDfHng4CWptUMyzhNdBW/JYDgdy4NQQ12dBTX3uOAktM7VFDRLQAdpBhm0CIUFRutm7rIVXGgzuoAeKZhsVXBCn1Of57jgE3IgeJEgversAsVeIIgdaSqEvxpMJd4+/Y3WV9NkT55MeH0qJUeh8huyTi1SPtuzkTZ4ToXCVZiRNj2wTazhPaSj/PcYBolveji+d1wmvo4Ux2xZ/y/9LNJ9PNLiM84l7C22e7ZXWlflPJzO/J4oxg4ZBlREJvc1DGJrFWeqIqS/hLiPN/FOTHyYMWDYwYWpK908Ry0cAlZRmpYvSTXQDBJFHlOSPYIQ4xuOW5UX0zTYZl6YNg5xh+jibhv4hpd5+20AD5Pnpq6IpeSegkIInoGBMqcN1MdlLOhA14Meg==
Content-Type: multipart/alternative; boundary="_000_DM6PR01MB59643D37BCB22B0EC5863253A3D59DM6PR01MB5964prod_"
MIME-Version: 1.0
X-OriginatorOrg: tavis.ca
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5964.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 92f3f526-4728-4767-42d9-08db07904ac7
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2023 15:47:31.4002 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8cea02ec-9788-4bac-a19b-3e782a3e9bb0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Vz6TUzCpxXTL3san1d3NJAwlmPRCq08a1qhMCQ2HQCbRsNpa+JM9JiA5dv+ftIP7
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB4993
Archived-At: <https://mailarchive.ietf.org/arch/msg/httpapi/KkFNbqBpjoLUHPDfeft-4ejlBWc>
Subject: Re: [httpapi] Byte range PATCH
X-BeenThere: httpapi@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Building Blocks for HTTP APIs <httpapi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/httpapi>, <mailto:httpapi-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/httpapi/>
List-Post: <mailto:httpapi@ietf.org>
List-Help: <mailto:httpapi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/httpapi>, <mailto:httpapi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 05 Feb 2023 15:47:40 -0000

Austin,

Thank you for sharing your proposal.  It is definitely the case that API providers do need this ability to perform partial updates to a resource.

However, it was my assumption that the updates to RFC 9110 that explicitly call out the potential for doing partial PUT https://www.rfc-editor.org/rfc/rfc9110.html#name-partial-put using the Content-Range header was the acknowledgement that this is what folks are doing and its ok to do it.

There are several assertions in your draft that suggest you don’t agree with this.

“this technique cannot generally be used in PUT, because the server may ignore the Content-Range header”

“However, if an upload is interrupted, no mechanism exists to upload only the remaining data; the entire request must be retried.”

“Although the Content-Range field cannot be used in the request headers without risking data corruption...”

In section 14.5 there is guidance that a server SHOULD respond with a 400 if Content-Range is received but not supported.  If this were a MUST, would that mitigate the concerns you raised?

Regarding your proposal, I do think there is value to being able to provide multiple parts to the content of the PATCH request.  I could imagine certain sync scenarios where that would be an efficient way of  communicating changes.

I’m not sure I understand the value of having a Content-Type as part of the header. I would have thought that patching would happen assuming the target is effectively application/octet-stream.  It would seem problematic to suggest doing a byte range update to a content-type that is text/plain when the charset is either not known or unspecified.  I don’t see how any kind of media type semantics would impact how the patch is performed.  I am only considering the case where range units are bytes.

My only other thought here is, are we reinventing things like VCDIFF https://www.rfc-editor.org/rfc/rfc3284 at this point?

Darrel


From: Austin William Wright<mailto:aaa@bzfx.net>
Sent: January 23, 2023 4:14 PM
To: HTTP APIs Working Group<mailto:httpapi@ietf.org>
Subject: [httpapi] Byte range PATCH

Hello HTTP APIs,

I’m seeking to standardize a media type for writing to particular byte offsets in a target document. This seems to be a common problem in HTTP applications, including in my own work with streaming parsers.

This sort of operation is common in filesystems. For example, you append audio data to a .wav file, and then you update the header at the start of the file. I don’t know of any way to do this operation over HTTP, except a PUT that replaces the entire resource.

This has been discussed in the HTTP WG list, as part of “resumable uploads”<https://httpwg.org/http-extensions/draft-ietf-httpbis-resumable-upload.html>, and I emailed there some months ago about this I-D. But aside from the resumable uploads being in HTTP WG, this seems more like an API-related feature.

Here’s the I-D I’ve written: draft-wright-http-patch-byterange-01<https://www.ietf.org/archive/id/draft-wright-http-patch-byterange-01.html>

Editor’s copy: https://awwright.github.io/http-progress/draft-wright-http-patch-byterange.html

This is the successor to version 00; in response to some feedback, I added a binary format. And I discuss what is necessary to support “splicing” (an insertion that shifts other content around) and indeterminate-length uploads, which is a requested feature for the “resumable uploads” spec.

Is HTTP APIs the best place to pursue this? I’m hoping I can discuss this at IETF 116.

Thanks,

Austin Wright.