Idempotency-Key for resuming requests (TUS Resumable Uploads Protocol)

Austin William Wright <aaa@bzfx.net> Wed, 05 October 2022 23:11 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 A9089C14CF09 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 5 Oct 2022 16:11:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.76
X-Spam-Level:
X-Spam-Status: No, score=-2.76 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.249, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H2=-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); dkim=pass (1024-bit key) header.d=bzfx.net
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 aITGdPzzePnm for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 5 Oct 2022 16:11:05 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D738CC14CF00 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 5 Oct 2022 16:11:05 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ogDUS-00GaCM-7H for ietf-http-wg-dist@listhub.w3.org; Wed, 05 Oct 2022 23:07:48 +0000
Resent-Date: Wed, 05 Oct 2022 23:07:48 +0000
Resent-Message-Id: <E1ogDUS-00GaCM-7H@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <aaa@bzfx.net>) id 1ogDUR-00GaBU-6x for ietf-http-wg@listhub.w3.org; Wed, 05 Oct 2022 23:07:47 +0000
Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by titan.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <aaa@bzfx.net>) id 1ogDUP-008mC5-KP for ietf-http-wg@w3.org; Wed, 05 Oct 2022 23:07:46 +0000
Received: by mail-pl1-x635.google.com with SMTP id 10so182775pli.0 for <ietf-http-wg@w3.org>; Wed, 05 Oct 2022 16:07:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bzfx.net; s=google; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date; bh=ArS2J6jI9fBzJ170fIsu4JnhA8ZlJJlwehn+RgX6uZI=; b=T2wjb1y/JRXkpAUJdR+bBNM2GrtXvdKVKbptzW++2farUnfu+Y8AVQuj+uHFBKVMSs RbTz616xmQfZO1y3qSpxJ07qt2FAjHLRN7rdPMhh+bQxOnn9p0bKbwFof7PrKvd0qpOd aW1ieec0SpMjumayRbCY2oPcqj/hLI1eJr0A0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date; bh=ArS2J6jI9fBzJ170fIsu4JnhA8ZlJJlwehn+RgX6uZI=; b=46cLILAzmvcuHzFV7cIiP7fcuOKDcOWaoo9RoJlQ8aVXhL+kZvYJNn6LGP8N5D1lVn bhdEb6D9SoHqrvha5f4bKVqTUNiNQ6f+Flg+6JD5yX3T3GVlpGvdvd4yeOijdt7GnYo1 GgEd8+J37T9h6coBeLotqy0pXwlUJA65/DZ6fdJh8NghOBFswxxXtx82JfFT7nHDE6Zk OIn92W/PfCYykUPDHE7/EZktkhdnqkRwoouM9EGcbzYx/MIJ5PPNH1D/xRWLER26yAMl watzCo2j70y87QVL4a1E44ilSfYugS6YYRP0H3kEs/43nAhyRPtvlxg0JrX2wg/f+3Sn 2uIw==
X-Gm-Message-State: ACrzQf2GjnhqFvLqzq8Xhfj76zSBWU60aTD7pPWS4tX+nKUYuzZ6YRGo A7gRIjdyRDlqOid8OwZ+Kw+1A8SzYTgBUQ==
X-Google-Smtp-Source: AMsMyM4UKMmW6xT5a1CG4SqJYKGhnCUMIFJNeGLVvnxm8edtlPOCwTYogi6F2iJlpAiFoQljKuv7uA==
X-Received: by 2002:a17:902:6945:b0:17b:f38b:900f with SMTP id k5-20020a170902694500b0017bf38b900fmr1683902plt.85.1665011253501; Wed, 05 Oct 2022 16:07:33 -0700 (PDT)
Received: from smtpclient.apple (71-223-234-98.phnx.qwest.net. [71.223.234.98]) by smtp.gmail.com with ESMTPSA id 61-20020a17090a0fc300b001fd7e56da4csm1606221pjz.39.2022.10.05.16.07.32 for <ietf-http-wg@w3.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2022 16:07:32 -0700 (PDT)
From: Austin William Wright <aaa@bzfx.net>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Message-Id: <9CB21DA8-9DBD-429B-930A-E67774652B06@bzfx.net>
Date: Wed, 05 Oct 2022 16:07:29 -0700
To: ietf-http-wg <ietf-http-wg@w3.org>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=aaa@bzfx.net; helo=mail-pl1-x635.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=aaa@bzfx.net domain=bzfx.net), signature is good
X-W3C-Hub-Spam-Status: No, score=-6.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1ogDUP-008mC5-KP 73a7c911ad75365bd7719a8348e93a81
X-Original-To: ietf-http-wg@w3.org
Subject: Idempotency-Key for resuming requests (TUS Resumable Uploads Protocol)
Archived-At: <https://www.w3.org/mid/9CB21DA8-9DBD-429B-930A-E67774652B06@bzfx.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40424
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>

Hello HTTP WG,

It occurred to me that, in general, where a client wants resumable requests, it also wants those requests be idempotent. I noted the HTTP APIs WG is considering an Idempotency-Key header, and it seems to me these should be part of the same mechanism. Let me explain how that might work:

If the client sends an Idempotency-Key, then the server can respond with a 1xx (Resumption Supported) confirming that the key will be honored for resuming the request.

Clients that want resumption SHOULD send Idempotency-Key, but they don’t have to (for example, to minimize UA fingerprinting). If the client does not send Idempotency-Key, the server should still send 1xx (Resumption Supported) to assign the request an Idempotency-Key. But it doesn’t have to (for example, 1xx is filtered by gateways).

Then when the request is interrupted, the client may resume the request with the same URI and Idempotency-Key of the request being resumed. By defining a RESUME method, a client could attempt to send a RESUME request in the hopes the server supports resumption, even if it didn’t receive a 1xx response. (Using the same URI allows the server to partition incomplete requests/uploads by the resource URI. There should be little need to re-send the method, since the server must store the details of the original request anyways, but a header could be defined if such a need is found.)

I see few downsides with this technique. There’s some builtin redundancy so resumption will work even if one party is buggy, and if a new method is used, there’s no possibility that a server could misinterpret the request. Idempotency-Key would replace "Upload-Token” entirely.

Thoughts?

Thanks,

Austin.