Re: Draft for Resumable Uploads

Eric J Bowman <mellowmutt@zoho.com> Fri, 22 April 2022 11:49 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 D221B3A150A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 22 Apr 2022 04:49:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.757
X-Spam-Level:
X-Spam-Status: No, score=-2.757 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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); domainkeys=pass (768-bit key) header.from=mellowmutt@zoho.com header.d=zoho.com; dkim=pass (1024-bit key) header.d=zoho.com
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 nXam5-hX8xZN for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 22 Apr 2022 04:49:19 -0700 (PDT)
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 478E93A1578 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 22 Apr 2022 04:49:04 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1nhrkE-0006pU-5A for ietf-http-wg-dist@listhub.w3.org; Fri, 22 Apr 2022 11:46:38 +0000
Resent-Date: Fri, 22 Apr 2022 11:46:38 +0000
Resent-Message-Id: <E1nhrkE-0006pU-5A@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 <mellowmutt@zoho.com>) id 1nhrkC-0006ob-TK for ietf-http-wg@listhub.w3.org; Fri, 22 Apr 2022 11:46:36 +0000
Received: from sender4-pp-o91.zoho.com ([136.143.188.91]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <mellowmutt@zoho.com>) id 1nhrkA-0002q6-S9 for ietf-http-wg@w3.org; Fri, 22 Apr 2022 11:46:36 +0000
ARC-Seal: i=1; a=rsa-sha256; t=1650627968; cv=none; d=zohomail.com; s=zohoarc; b=jt4OOB+SR6XVrvCSUAWQGHh+bTQ7HClz8dJMLXMYNhH18Kv7pRAjrgRMPZ6bwPn81C69uRJTbQHO2FaQ/16Mr1WKQmcXDMwEhMSxMmDybdhwsTt83l2+JJus2ICnTtL82F0P6mmBt/tL364YLLDpKg4mARkpFsqccbECRM7dx3Y=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650627968; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6V6wGxM+UDh3XJSMHvz3fRpi8f/RtzloEssUbSsTiUc=; b=QqQisXkWLpUk7ggZpnJNKinOV33rvgXxX4aMphKepM8FZhu8ORf6wPvsw63GAuTnX6+dG7CUEvpEBXxqyThoN+JsU1N+N2o9bjQaD95sCii1AcgaAba0yeNFtBgR2NEjnCoYjFwiwwWzXEkSqMOGvfuU+SvJ5d9mf6CAZRfrjS4=
ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=mellowmutt@zoho.com; dmarc=pass header.from=<mellowmutt@zoho.com>
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=date:from:to:cc:message-id:in-reply-to:references:subject:mime-version:content-type:user-agent; b=fchlTHkFUfc2wjTZ8FlEtc3spY4DechwnNeSss3IzA9CUmS6VU5oIPQ9ILNDhZ9uPEFUuSewlUZV t9ZGx9ApAAmw8pvQbdtA4WdkXW8fptGGk1WnW1fxArqdL1FRNiTb
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1650627968; s=zm2022; d=zoho.com; i=mellowmutt@zoho.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-Id:Message-Id:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Reply-To; bh=6V6wGxM+UDh3XJSMHvz3fRpi8f/RtzloEssUbSsTiUc=; b=LrrP8K0XIwe7qFEsTpJGLpbvw3wU+m9z+uhR1VI9CeHjDYNwERHYYF/cjb51cebj lesl/XhexKnQ5g3m7KSjGfrYA+YraNYM4YqGFTrOmJySAZU4nF/i1h5bCImY5hyApB/ 77BTPr2ToB7FNHV9lyA5WqNe8/WRyGqrb02A/i3I=
Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1650627967691846.2385177340138; Fri, 22 Apr 2022 04:46:07 -0700 (PDT)
Received: from [65.117.211.248] by mail.zoho.com with HTTP;Fri, 22 Apr 2022 04:46:07 -0700 (PDT)
Date: Fri, 22 Apr 2022 04:46:07 -0700
From: Eric J Bowman <mellowmutt@zoho.com>
To: Eric J Bowman <mellowmutt@zoho.com>
Cc: "Roy T. Fielding" <fielding@gbiv.com>, ietf-http-wg <ietf-http-wg@w3.org>
Message-Id: <1805117fab0.e2e51ef097259.1994843136820837297@zoho.com>
In-Reply-To: <18045b2adb9.c9d5f10255708.2924994361377433781@zoho.com>
References: <CANY19NvMcPQaHRamFe-yy-E38xKo2XrmFCKVRoPbyBMQhoY6vA@mail.gmail.com> <EA8A9F25-D49F-41DE-B98E-A013E1E68CAF@apple.com> <6e64f598-e82b-bff5-5ed9-c3c3f4b01439@gmx.de> <C6907036-146C-4FAB-938E-238473CB42B4@apple.com> <17ff7558cda.10ad81f8113705.2829201994677815148@zoho.com> <2FADC394-0954-4AA2-8F55-6CDF88833CB3@apple.com> <17ff85458eb.119b6ffbd16630.2281063094525551184@zoho.com> <a0670d54-d999-807c-23e2-95e357e73104@gmx.de> <17ff868f14e.d111a4c016833.788757655885004970@zoho.com> <4c1aabee-bc23-6d19-2e5d-8fdf3b3532ad@gmx.de> <892B7A86-57D0-4B21-9899-65EF3FA84A12@bzfx.net> <17ffd4d64d2.c4f12f9734385.3620821323075353432@zoho.com> <904B5382-ADCA-461F-B47C-583874D4FB55@bzfx.net> <17ffe8ddd90.1257859fc38181.7721145847915462132@zoho.com> <54BB33F9-DF98-48DB-BA2B-C8A63208BA21@bzfx.net> <1800309bddc.ec99308354061.3626360867795203460@zoho.com> <48744eb6-4437-508c-f61c-06918839e858@gmx.de> <1801b361c47.db210b21123021.8993280150669755607@zoho.com> <9b3236fc-284f-29f5-6405-850dcc2e6fed@gmx.de> <5B3291E4-CA3B-4D6E-92F0-512D89E44A79@gbiv.com> <18045b2adb9.c9d5f10255708.2924994361377433781@zoho.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_229556_1377666194.1650627967664"
Importance: Medium
User-Agent: Zoho Mail
X-Mailer: Zoho Mail
Feedback-ID: rr0801122707cdc9de2f8db9c76c8bd2ab0000c1b0f051ca0fc3b8b0d2b1e685db0b51d7abc8acff89067501:zu08011227d84860731f6d273cf726fe6000002bb758f747e07d79e7c55c2f31b4dce7f9bc64602d0ed10bdc:rf08011232726a09c657c01d0d9531735f0000874c836e116968c217822cbae3d8ae485f7165be82fdfd4e04e35df695e664af5060d1b3:ZohoMail
Received-SPF: permerror client-ip=136.143.188.91; envelope-from=mellowmutt@zoho.com; helo=sender4-pp-o91.zoho.com
X-W3C-Hub-DKIM-Status: validation passed: (address=mellowmutt@zoho.com domain=zoho.com), signature is good
X-W3C-Hub-DKIM-Status: validation passed: (address=mellowmutt@zoho.com domain=mellowmutt@zoho.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-4.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1nhrkA-0002q6-S9 c2e534bd94385117d64a76128fa5e320
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Draft for Resumable Uploads
Archived-At: <https://www.w3.org/mid/1805117fab0.e2e51ef097259.1994843136820837297@zoho.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40001
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>

Here's a better example/questions. Given the following existing-but-undefined resource (please click through):



http://example.com/xyzzy



Wouldn't sending PATCH "404 Not Found" be reasonably expected to change the 404 response body accordingly?

(no context switching)



As opposed to "creating" a resource which eventually responds 200 OK with "404 Not Found" as its message body?

(context switching)



A DARCS patch file may contain instructions for line changes, find/replace, or filesystem ops. I've created two media types, text/vnd.darcs and text/vnd.darcs-inverse. I played around with just the first using AMEND/REVERT methods, but chose to stick with PATCH and create the -inverse media type.



If sent as a PATCH request, line-change/find-replace are interpreted as amend/revert based on media type. Filesystem ops are ignored.

(no context switching)



If sent as a POST request, line-change/find-replace are ignored. Filesystem-op instructions are followed or undone, based on media type.

(context switching)



If sent as a PUT request, I don't care which vnd.darcs media type, as the patch itself is a first-class resource in DARCS. Which either overwrites (no context switching) or creates (context switching), based on method definition -- the patch is not applied, no partial PUT.



I consider that RESTful implementation of HTTP protocol, iff the PUT target comes from the server.



I would consider it bad practice (and hard to maintain) to create text/vnd.darcs-execute to allow partial PUT (overriding the method definition) by media type, or to allow PATCH to engage in context-switching (overriding separation of concerns) by media type. A patch file shouldn't be executable, just an instruction set for an executable.



I consider those REST mismatches, for subverting the Uniform Interface constraint.



My opinion is informed by DARCS being patch-centric, as opposed to the typical snapshot-centric revision control systems or UNIX diff/patch. One or more "context" resources must first be defined, in order for any patch to have meaning. A find/replace foo/bar patch may be applied to any context. A client can derive any snapshot from a context plus one or more patches; no server-derived snapshot URI needed. Roll your own repo and define that snapshot as a context, perhaps assigning it a URI. Just a stored procedure.



DARCS is just recursive lambda calculus expressed as Haskell functions, grok that at the risk of hating git. ;) It almost solves for distributed resumable uploads: conflict management is the cutting edge of DARCS development.



Restricting PATCH to just mean "patch" and disallowing partial PUT simplifies the security scheme to "user/group by protocol method, per naming authority" copacetic with peer-to-peer distributed-repository operations. Anyone can GET/HEAD/OPTIONS/PATCH. Operators can approve (apply) a PATCH. Creators may define contexts. Etc. This is significantly harder to implement if PUT or PATCH semantics vary by media type!



Wouldn't application-layer concerns bleeding through to the protocol layer like that, indicate a layered-system mismatch? Abiding by the uniform interface constraint would preclude the layering violation. I see value in acknowledging REST mismatches even if it changes nothing (cookies still won't die even with the UI pollution legislatively mandated for using them). Serves to inform implementers who care about getting the most REST benefits HTTP has to offer, of BCP expressed as what not to do.



-Eric