Re: Httpdir early review of draft-ietf-ppm-dap-09

Tim Geoghegan <timgeog+ietf@gmail.com> Thu, 04 January 2024 19:34 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=ietf.org@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 D34C7C14F6A0 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 4 Jan 2024 11:34:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.454
X-Spam-Level:
X-Spam-Status: No, score=-2.454 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=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=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (public key: invalid data)" header.d=w3.org header.b="ULRBhaut"; dkim=fail (2048-bit key) reason="fail (body has been altered)" header.d=gmail.com header.b="IXBMbFN3"
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 6OeWYqk-482p for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 4 Jan 2024 11:34:47 -0800 (PST)
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 5749FC14F6E0 for <httpbisa-archive-bis2Juki@ietf.org>; Thu, 4 Jan 2024 11:34:47 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1rLTSo-00Eoys-GV for ietf-http-wg-dist@listhub.w3.org; Thu, 04 Jan 2024 19:33:10 +0000
Resent-Message-Id: <E1rLTSo-00Eoys-GV@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 <sysbot+mod@w3.org>) id 1rLTSe-00EoPb-Qx for ietf-http-wg@listhub.w3.org; Thu, 04 Jan 2024 19:33:00 +0000
Received: from lyra.w3.org ([128.30.52.18]) by titan.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <sysbot+mod@w3.org>) id 1rLTSe-001LEP-GF for ietf-http-wg@w3.org; Thu, 04 Jan 2024 19:33:00 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Subject:Content-Type:Cc:To:Message-ID:Date:From:In-Reply-To: References:MIME-Version; bh=Y/s+spsQ608fnw85n8iS8yXkp+8TqPWooICizz8qzCQ=; b=U LRBhautdMQ0jJsgP1gmMpucA52usMlffklgDSpq6XzXv8IQLz7ccv4c42NG1bHa0llercllLTciFj EU7or+q5dcjDIj7kuD9dAO6P7hwwhFoG5cu6U4ffDN7v5dkgmwdP047yfF5OrMjKoyvpkMFAP3hOD WCCTamJk3N3OlT1vNZ6q5GBdrZ3YKMCMa2v5E33MaQcju9ZIHxIseAhX7KVht2f2tkEN5FbPq5j2B q65N4o4fe5nTDXMp1r/co942tQNuuVPiwj/dozxA1tFPD/p/m21LWM5CROGlYqBZAHg/KBryQkwLi zjf7YhNUf/RqWzkpvXgalew1pYgtE8N8A==;
Received: from www-data by lyra.w3.org with local (Exim 4.94.2) (envelope-from <sysbot+mod@w3.org>) id 1rLTSe-00EoPC-5d for ietf-http-wg@w3.org; Thu, 04 Jan 2024 19:33:00 +0000
Resent-From: List moderator <sysbot+mod@w3.org>
Resent-Date: Thu, 04 Jan 2024 19:33:00 +0000
Received: from www-data by lyra.w3.org with local (Exim 4.94.2) (envelope-from <timgeog@gmail.com>) id 1rLEY7-00DD1d-J7 for ietf-http-wg@listhub.w3.org; Thu, 04 Jan 2024 03:37:39 +0000
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <timgeog@gmail.com>) id 1rKlyN-00AR3n-B6 for ietf-http-wg@listhub.w3.org; Tue, 02 Jan 2024 21:06:51 +0000
Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by mimas.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <timgeog@gmail.com>) id 1rKlyK-00DTpf-IA for ietf-http-wg@w3.org; Tue, 02 Jan 2024 21:06:51 +0000
Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33677fb38a3so9930438f8f.0 for <ietf-http-wg@w3.org>; Tue, 02 Jan 2024 13:06:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704229604; x=1704834404; darn=w3.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2uXOaGbBtWUxZR/hjGuvbjs4gbIL+VTT53dWMhVazUw=; b=IXBMbFN35CqxDWdenCMjFwitHchgcOeYPRLElfZGTQxcq05mtPjpOfWwU3jjYd97bl +tQDpUWMLe+wX7QbaQGnNWrBsOurLhX47ySJMECjEjIFXvUwBtlYPaPmfnBWbslZn8ea zRqUZx8In69JPB1RpR3KG8NwT9yT/txoAioBj6T513dKYoWNISFmyYmo6aNLTA2Ik+DB m4H+PXyuM3le9gRfFcdMArZDSuL/xEEDvEU/L3z0GObHnCMv0hkSbF15RLIiV+eK8SwE lPWCa6nucj1qmlZqnBaO0OgyXuVfMSYFnsPkvouRre0CHkEy+//1uICQrPvuOPbGPAQo Hlrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704229604; x=1704834404; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2uXOaGbBtWUxZR/hjGuvbjs4gbIL+VTT53dWMhVazUw=; b=nZb7skd8uNaVaZtbPXYiLD9TZa8fY2Zr1R3/z+ao67HHdqvoibvBmnAAicFvoRKUQr N5AeQs2kuw5jOO8A0eswdm463MOmIsFr/GN9Ax0aHy00mt0lpNqq9MV5ADSWA/jJwTcn b3fMT7PASm9aDrRbiS5/m7HWbLZ6BsW7al/9NfVRk1cd35FfyJEFknFnZJZ9IQKs9yLb imBkEUNCH4406nZ60ZBYv+fc+7TLwyMN1ndjErDH1qi6ylbLwvoata5AxggzWAafqCGB u055bxxaHmGgPSkh1HXzr8DLgJv9aZqahsdQwretSbtscKoVlLpV9mO6wpyHp5JOps1s tc1g==
X-Gm-Message-State: AOJu0YxIIkm3uXFCXggGSyT/MsDTdEiVDF3h35pma/M6W1T1GjTqXHac WXmdZLR1CQnXbhb/2DbgdMOz01I6/r0O3UHMK84=
X-Google-Smtp-Source: AGHT+IFewLkzwnAzbi8781l9rD7XVEaRtCOBEw1aPPSTBFYQr9CB3z/PLdkIWq+zCBUB1xoPASq3OcXFT0A1aeYdL7Y=
X-Received: by 2002:a5d:5f84:0:b0:337:4916:e1e4 with SMTP id dr4-20020a5d5f84000000b003374916e1e4mr714850wrb.24.1704229603984; Tue, 02 Jan 2024 13:06:43 -0800 (PST)
MIME-Version: 1.0
References: <170384026509.4260.5375550250978716488@ietfa.amsl.com>
In-Reply-To: <170384026509.4260.5375550250978716488@ietfa.amsl.com>
From: Tim Geoghegan <timgeog+ietf@gmail.com>
Date: Tue, 02 Jan 2024 13:06:31 -0800
Message-ID: <CACsY-OduuUv0LjBB=0DR2Pj338MM9HUENkxOhKjxQG9AnCki9Q@mail.gmail.com>
To: Mark Nottingham <mnot@mnot.net>
Cc: ietf-http-wg@w3.org, draft-ietf-ppm-dap.all@ietf.org, ppm@ietf.org
Content-Type: multipart/alternative; boundary="00000000000029483a060dfce0e5"
Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=timgeog@gmail.com; helo=mail-wr1-x434.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=timgeog@gmail.com domain=gmail.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-1.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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, W3C_NW=1
X-W3C-Scan-Sig: mimas.w3.org 1rKlyK-00DTpf-IA b36513cfcabc81e428bcdb3089bb551e
X-caa-id: 42fee56269
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Httpdir early review of draft-ietf-ppm-dap-09
Archived-At: <https://www.w3.org/mid/CACsY-OduuUv0LjBB=0DR2Pj338MM9HUENkxOhKjxQG9AnCki9Q@mail.gmail.com>
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/51709
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/email/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Thank you for the thoughtful review, Mark, and especially for getting us
early feedback so quickly. It's also gratifying to know we're on the right
track! I have posted a pull request (
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540) to the draft to
address the items that I think are straightforward and non-controversial
(though naturally review of those changes and further discussion is
welcome). Beyond that, I have some comments inline:

On Fri, Dec 29, 2023 at 12:57 AM Mark Nottingham via Datatracker <
noreply@ietf.org> wrote:

> - Throughout, 'endpoint' is used to identify nodes. In most cases, this
> should
> be 'resource' in a HTTP protocol (although it might be 'server' in some of
> these cases).
>

Addressed in commit 5dba50dd0455d3668c8e469f5fc2072db868673c in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540

- the Overview uses a DAP-specific definition of 'client', but a HTTP
> definition of 'server'. These should be aligned. I'd suggest distinguishing
> where necessary with 'HTTP client', 'HTTP server', etc. (but see point
> above
> about 'resource').
>

Addressed in commit 83dc24deb09ae2e810c1f8dac4cea96e907da7c1 in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540

- 'carried over HTTPS' isn't correct; should be 'carried over HTTP'. You
> later
> specify use of HTTPS as a requirement.
>

Addressed in commit 5c09e813c66f38081b530acd566afcc9d469e0b4 in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540


> - throughout, you use 'sub-protocol'. This is likely to confuse; suggest
> 'interaction' or similar (which is already in use, e.g., in section 4).
>

Addressed in commit 4bcd0a79ccaee41808dbf9e4404355c4d385171a in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540


> - 'Errors can be reported in DAP both at the HTTP layer and within
> challenge
> objects as defined in Section 8.' It should be noted that for HTTP
> software to
> work correctly, the appropriate status code must be used; indicating an
> error
> in the object without doing so may lead to unintended retries/caching/etc..
>

Good point. The other problem is that I don't think the reference to a
"challenge object" makes any sense. What we mean is that a message in the
response body might contain error information. So we need to fix that text.
That aside, would it suffice to amend this section to say that if the
object in the response body indicates an error, then the HTTP status MUST
indicate either a client or server error?


> - In section 4.3, it might be good to reference RFC 6570.
>

Speaking as the individual who wrote the current text: I deliberately
avoided using RFC 6570 here because its feature set is much, much richer
than what DAP needs, and so I opted for the weaker, simpler templates that
we have now.

Speaking as a document editor/WG member: I have no doubt that the templates
and expansions DAP uses can be expressed in RFC 6570 syntax, and will
switch over to it if the WG consensus is to do so, but personally I don't
see a compelling reason to go that way (I'm open to hearing arguments about
this of course).


> - Section 4.4.1 and afterwards use static paths for subresources, hindering
> flexibility and violating at least the spirit of BCP 190. If the
> configuration
> were to allow specification of URI templates, it would be much more
> flexible.
>

We tried to write the text to allow serving of the API relative to any
prefix. So in a template like "{aggregator}/hpke_config" (4.4.1),
"{aggregator}" can have arbitrary path components in it relative to the
hostname. Did we express this incorrectly?

Past that, are you objecting to DAP spelling out templates like
"{aggregator}/hpke_config" or
"{helper}/tasks/{task-id}/aggregation_jobs/{aggregation-job-id}"? Are you
suggesting that a deployment should be able to use a template like
"{helper}/foo/{task-id}/bar/{aggregation-job-id}" if it so wishes?


> - 4.4.1 also requires the client to abort if a GET request fails. In
> practice,
> GETs can and will be retried, sometimes automatically (by clients and/or
> infrastructure), so this will be impractical to enforce.
>

Addressed in commit 52cc0134182c1542815d2262fe0bef07a2a18f0f in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540


> - Also in 4.4.1 the cache-control example looks like it specifies a
> particular
> freshness lifetime; it would be good to explicitly say that is only an
> example.
>

Addressed in commit 7aa8141f54ad624a9036a7abcfbe4f328db10bcf in
https://github.com/ietf-wg-ppm/draft-ietf-ppm-dap/pull/540


> - 4.4.2 uses PUT to create a report, but doesn't seem to make the uploaded
> report available for later GETs at the same URL. If this stays the same
> (i.e.,
> if the server is going to manage the URL of the report), it should be
> POST. It
> should only be PUT if the client is effectively deciding what the URL
> should be
> (by PUTting to a URL it can later GET). Also, if it can't be GET later, the
> response status code should be 200, not 201. If it can and POST is used, it
> should be 201 + a Location header pointing to where it was created.
>

First, there is a unique identifier for a report that does get chosen by
the client, but it only appears inside the request body (this is
`Report.report_metadata.report_id`). We could hoist it up to the request
path, yielding a template `{leader}/tasks/{task-id}/reports/{report-id}`,
and then you'd have a unique URI for each report. I'm inclined to do this
much no matter what, for consistency with the aggregation job and
collection job resource paths.

That said, I'm not sure if it makes sense for that to be a GETtable
resource. DAP doesn't need GET on reports to function and more importantly,
I worry about the implementation burden for servers. In many cases, the
initial uploaded form of a report isn't useful after the first round of
preparation. Servers may wish to discard per-report information
aggressively to limit the growth of their databases, which makes it
difficult to serve up anything meaningful in response to a GET request. So
I'm reluctant to add a requirement or a MUST about GET on this resource.

I really like having this be a PUT request because of the implied
idempotency semantics. What if we leave it as a PUT and change the path
template to incorporate the unique report ID, but then don't say anything
about GET requests (or at most put in a MAY)? I think then implementations
would be free to either respond to GET requests with HTTP 200 and a `struct
Report`, or with HTTP 204 or 410 if they happen to have chucked out the
relevant database row.

If that's inappropriate, then I think we can switch to a POST as you
recommend, but what about idempotency? Would we just have to state in DAP
that this particular POST is safe to retry?


> - Similar considerations for 4.5.1.1 and 4.5.1.2. In an nutshell, use PUT
> when
> you can expect to GET the same thing from the same URI later (delta
> whatever
> the server does to it in the meantime). Use POST when you want "process
> this",
> "this" being identified by the media type + URL, and it optionally has the
> side
> effect of creating a new resource at a URL that the server controls
> (indicated
> by 201 + Location).
>

Besides the fact that aggregation job paths already incorporate the unique
aggregation job ID, I have the same thoughts here as I did for the upload
endpoints:

- the protocol does not require a GETtable aggregation job resource to
function
- implementations are free to wire that up if they want to
- I find it useful to be able to use the HTTP method to distinguish between
"idempotently create this aggregation job" (PUT) and "mutate the existing
aggregation job by advancing its state" (POST)

However we could make this all POST, all the time, and have aggregators key
off of the media type to decide which handler to invoke.


> - Use of 201 in 4.6.1 seems incorrect if I understand correctly.
>

The request in question is PUT
{leader}/tasks/{task-id}/collection_jobs/{collection-job-id}, which is
intended to create a collection job resource with the specified ID, in the
specified task. RFC 9110 9.3.4 (
https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.4-2) states:

If the target resource does not have a current representation and the PUT
successfully creates one, then the origin server MUST inform the user agent
by sending a 201 (Created) response.


So 201 seems correct: on success, the collection job gets created. The same
paragraph in 9110 discusses using 200 or 204 when successfully mutating an
existing resource, but DAP explicitly forbids that in this request.

Thanks again,
Tim