Re: Digest: use in requests

Julian Reschke <julian.reschke@gmx.de> Tue, 29 December 2020 13:42 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 116AD3A13A7 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 29 Dec 2020 05:42:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.649
X-Spam-Level:
X-Spam-Status: No, score=-2.649 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, NICE_REPLY_A=-0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=gmx.net
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HmWer0gANhkR for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 29 Dec 2020 05:42:22 -0800 (PST)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (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 C27833A13EE for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 29 Dec 2020 05:42:22 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1kuFDR-0006Ph-9E for ietf-http-wg-dist@listhub.w3.org; Tue, 29 Dec 2020 13:39:09 +0000
Resent-Date: Tue, 29 Dec 2020 13:39:09 +0000
Resent-Message-Id: <E1kuFDR-0006Ph-9E@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <julian.reschke@gmx.de>) id 1kuFDQ-0006Ow-3r for ietf-http-wg@listhub.w3.org; Tue, 29 Dec 2020 13:39:08 +0000
Received: from mout.gmx.net ([212.227.15.15]) by titan.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <julian.reschke@gmx.de>) id 1kuFDN-0001H4-SY for ietf-http-wg@w3.org; Tue, 29 Dec 2020 13:39:07 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1609249133; bh=Vju7IwNjvkS43G3ZFGH7Qurwvj9uo9/XRa5flGdVYyg=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=TMHRhpw4jkU4byXjrZY5ObuotC7mguMiJvK3NHxmqF0tA6jBpePw7inWAccZNj2PO rtRFbneHxMvSNdF7HVC2HsyFYxrHM7qZp6CXbBk6CeES+kPd913TUv7vpLJYUiNN+P RDLwivvyY2wJQ+b4sunLuUKLy0VZPDmrrsJeAafs=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.178.20] ([91.61.51.65]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MWzk3-1kVnMq03pJ-00XNwe for <ietf-http-wg@w3.org>; Tue, 29 Dec 2020 14:38:53 +0100
To: ietf-http-wg@w3.org
References: <CAP9qbHVwt35L_h_F=8BsK3zSjPpSWmnhCVDGKhe4kp9Z3umkLg@mail.gmail.com> <0d0e7e90-2a4d-a4b0-3782-7ec3da1c892f@gmx.de> <CAP9qbHWMRsok2C=6JAEVUULTt2BXJ3kHGGDJ9TmNRrA_1J9mKg@mail.gmail.com> <edbc0f95-fc71-e09d-a35d-014356e3b51a@gmx.de> <CALGR9oadRYc-oQHuX13HPSCVmYcNu5z-7RL1JFKzHWkMreeL3w@mail.gmail.com>
From: Julian Reschke <julian.reschke@gmx.de>
Message-ID: <25da0612-c1e0-d2bc-39df-89fe37dc1f8a@gmx.de>
Date: Tue, 29 Dec 2020 14:38:52 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0
MIME-Version: 1.0
In-Reply-To: <CALGR9oadRYc-oQHuX13HPSCVmYcNu5z-7RL1JFKzHWkMreeL3w@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:tZKuU3TbA7+ZCaKGItdMfEiX5c6nBZwjw10rKyTxrK+m2PLS3wL b5caTskK32WP/a/4d8kMfmyaDRX4vCz0mnwFdJzKZi2ifzbg0QY0AuEMazNPON6MTl2Zvq1 5T/dPWgP8rXgBhQCPMydsCeCWlT3vEkrvNZQsCtDUPgNOsFVp0NNCG6RFg4EP1PWFSkzghB VUpkVsbtWJxr1TZo3tQpA==
X-UI-Out-Filterresults: notjunk:1;V03:K0:eagBMggX3yI=:Cd5dnGDidYVLiudpWtINYP Npz4TW0Rfa9XKuMibg6ypzfMfKIiURfyBJHwdxBrO2CxZj+ahJxRsEVT2L4uQZ8wdcX/+JS+6 UPoSwyOVlwsdfgYJevNUU2o9J3sHyKnpjyjVD6RGIu+5gMC192DpxBSKd0jz2qxsgHqmbnhGg 2mP8GxwdVCy4fw5E1TNMXrzk92GBP9eVnZTAYqbKOiZ+fCt5h/9+Vv8Akc2qkxqUKWRzZUgRD 8Lh3sQCN9jNgdTfUbK6F+02vPQCJbhgdX481tx80NmGVfj7Gg/FmxVjuBQ6KFOmkRrEGeznAD mB1KI8l2KRRv3EjMhD3nrJEXZBcldn8TQYxIpYkj3xhnh0odSY471wDBYMJuQTN4qSrZjGtYl lyv2EKHIRvIaS8dvmMCQp97pz2uaKl6Jh/G+/9Hzw/J+EOp02c4k4SJzdmQYWFURUe1sMs+9I Zj50q6HMsaESPYULeeA3y2Sb6HLl6oF1VA98dozTrjFkV2RZaIYkS/5NXzI+x7UrlM8rfhFFc 3VWEPKarfW0Vy4DWlSlQ2mrmUUl3HmrHNcjHwi1bYoS5r1AHUv9XS1G/gfq4bUNpUokYagHfq r06cENoebDMcoTfxK09EavJM0Oprq45661kPbol5Zr3n01RqcfaqJ+dbR9xWh9ewG89EcFq2D cn12gn3L2uHSqCcOPlspAMlqI2SlhHCDo34LtkUfHZOF+tpfs1RWHsCXt8vODZ8seSP1yZQms gDC8W4wHL3jfknoDo30934M72v5s7yg8aup8754m2/XdsZLs7ReNCTFSLifYKbUkxkmgsCe4h 8vRBwXbgQb566h+PzaH7/B8EtxQDvip8Nlz2TuY3azxWV3MtQlUn/sFcOzCdIu3y2TFB9AiMx Cu3FV8VuK2/ow6G1amNAJxz57IvBpvQn1QzasKv3E=
Received-SPF: pass client-ip=212.227.15.15; envelope-from=julian.reschke@gmx.de; helo=mout.gmx.net
X-W3C-Hub-Spam-Status: No, score=-6.7
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.07, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1kuFDN-0001H4-SY 2c53f9ec9e7807e76aff7899be03f1f3
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Digest: use in requests
Archived-At: <https://www.w3.org/mid/25da0612-c1e0-d2bc-39df-89fe37dc1f8a@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/38356
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Am 29.12.2020 um 13:17 schrieb Lucas Pardue:
> ...
> This is indeed the most likely use case. A very quick survey indicates
> that there seem to be some examples of PUT requests with Content-Range
> in the wild. I have no experience with these, nor knowledge of how
 > ...

Note:

"An origin server that allows PUT on a given target resource MUST send a
400 (Bad Request) response to a PUT request that contains a
Content-Range header field (Section 4.2 of [RFC7233]), since the payload
is likely to be partial content that has been mistakenly PUT as a full
representation. ..." --
<https://greenbytes.de/tech/webdav/rfc7231.html#rfc.section.4.3.4.p.11>

> ...
> "This document specifies a new media type intended for use in PATCH
>     payloads that allows a resource to be uploaded in several segments,
>     instead of a single large request."
>
> Example:
> PATCH /uploads/foo HTTP/1.1
>     Content-Type: message/byterange
>     Content-Length: 283
>     If-Match: "xyzzy"
>     If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
>
>     Content-Range: bytes 100-299/600
>     Content-Type: text/plain
>     Content-Length: 200
> ...

FWIW, use of Content-Range in PATCH is unspecified.

> Finally, Dropbox [5] does things a little differently and uses the
> Dropbox-API-Arg JSON header field to communicate a cursor containing an
> offset of the bytes uploaded so far (which I guess means that parallel
> transfers aren't supported).
>
> Example:
> curl -X POST
> https://content.dropboxapi.com/2/files/upload_session/append_v2
> <https://content.dropboxapi.com/2/files/upload_session/append_v2> \
>      --header "Authorization: Bearer"
>      --header "Dropbox-API-Arg: {\"cursor\": {\"session_id\":
> \"1234faaf0678bcde\",\"offset\": 0},\"close\": false}"
>      --header "Content-Type: application/octet-stream"
>      --data-binary @local_file.txt
>
> To conclude, I'm not exactly sure how these examples influence the
> discussion. It seems that there are actually concrete cases of "partial
> requests" but it's unclear to me if these break HTTP semantic rules
> and/or if it should be documented for formally. The examples I've seen
 > ...

The only concept that HTTP itself for "partial" is defined in RFC 7233.
This is for responses. It *could* be extended to requests, but the spec
is very very clear that it can not be used for PUT.

If there's interest in changing the above requirement, now would be the
time to raise this.

> are for APIs that also have their own custom means for integrity checks,
> or still use Content-MD5. It would be nice if something like Digest
> covered all avenues and we could get folks to switch to it, but I've not
> seen any signals that such APIs are interested in Digest. Therefore, I'm
> wary of Digest taking on too much work to describe something without any
> implementer interest. In the interest of progress, if partial requests
> for uploads is something people think needs standardising, I think that
> could be done as an independent follow-on work item e.g. a document that
> updates Digest.
> ...

Yes.

In any case, the protocol needs to state what a recipient ought to do
when a message has a "Digest" field on it. We can't just say "it depends".

Best regards, Julian