Re: signatures vs sf-date

Julian Reschke <julian.reschke@gmx.de> Mon, 23 January 2023 16:10 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 4C086C15E406 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 23 Jan 2023 08:10:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.05
X-Spam-Level:
X-Spam-Status: No, score=-5.05 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.25, MAILING_LIST_MULTI=-1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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 (2048-bit key) header.d=gmx.de
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 k1sHLR6alXSQ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 23 Jan 2023 08:10:16 -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 1F2DAC14069A for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 23 Jan 2023 08:10:15 -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 1pJzOL-005Jc1-7z for ietf-http-wg-dist@listhub.w3.org; Mon, 23 Jan 2023 16:09:53 +0000
Resent-Date: Mon, 23 Jan 2023 16:09:53 +0000
Resent-Message-Id: <E1pJzOL-005Jc1-7z@lyra.w3.org>
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 <julian.reschke@gmx.de>) id 1pJzOK-005Jat-5U for ietf-http-wg@listhub.w3.org; Mon, 23 Jan 2023 16:09:52 +0000
Received: from mout.gmx.net ([212.227.15.15]) by mimas.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <julian.reschke@gmx.de>) id 1pJzOI-00EBPH-Jj for ietf-http-wg@w3.org; Mon, 23 Jan 2023 16:09:51 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674490173; bh=86NxjYHgki8gV8kZUkBJpZoQqe7ASPaHjC0djcVIITc=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=SbZjUSrbNP4tYEOl6hJ92mWtGfMtlMDcmMBhdFHFQfaYrjIKFJoR++iXjjshoHPsJ YaDgnb5HS+oNMvxPhTfAV5LNUihXwYOYvx6JRqh1aCmH1c7ICHjEvRYKTK174TbhIb i7xKGUh+r7qV4vYAJuUJAfcykORav+YaU4tnxtubte1uHhHI8TVndYd6HapWx+cN8Q yXLROCDnK38w8iSIXtY33t8HyJExUD/CogUvyEya5Ue8ZsBhgGLqJZf9S4Y793c+Ng crza78rr/FblPw79bmV+uh3z84yYYIjNrRrKiZjPlg/HXciPKJKuDPJS2zzVii1BWa nafPLolWoQ9QQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.178.179] ([217.251.134.184]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M9Wys-1pNHAX3OS4-005dQ1; Mon, 23 Jan 2023 17:09:33 +0100
Message-ID: <4e63a31d-1168-2736-53f1-13b80a03dd05@gmx.de>
Date: Mon, 23 Jan 2023 17:09:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
To: Lucas Pardue <lucaspardue.24.7@gmail.com>
Cc: Mark Nottingham <mnot@mnot.net>, ietf-http-wg@w3.org
References: <2070c8e0-98d6-7b63-77c3-550bcd661397@gmx.de> <8b547e17-1f24-ff1f-90d1-ec4c974de88f@gmx.de> <FEA9B22C-B3AC-48D0-B4AC-64BADB8E8F18@mnot.net> <a4cae48c-960f-0edb-33c5-19e01b7e4093@gmx.de> <CALGR9oZMYhB8MXZzJHjb1QM+x7f3w_bENDLDqr39+BR5=t5r3w@mail.gmail.com>
From: Julian Reschke <julian.reschke@gmx.de>
In-Reply-To: <CALGR9oZMYhB8MXZzJHjb1QM+x7f3w_bENDLDqr39+BR5=t5r3w@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:BJjS4YERcR989EB1iZinbDQ9sRsOdkgNfXHgoqI3mdGc/oi6xdf tLQyXyUnLYqWwV1pCrETUXOe/8fVVYZnW6CGtct4DQv+YybCwwCyEYQu/OL1phLGFHBN1nF bit9qhyOCRnXxc6dTxZX38t6eBkQ6YWb/5rBPK238qXza64XBj6P/j9uGX6jIE3Xz58XZ2V 9UydyA9+9d4nJcXpVdN8w==
UI-OutboundReport: notjunk:1;M01:P0:dUHm1J8vKa0=;IHJPUVsP/kV4jIOSxQa9uUdCzk/ 5VmH0Dsi9trI8cN73Sk0BQCoDIgwpJDsvqO3qK0+YD2eaaEveXIzwjPPrMw2ZRv9Bd2180X9M 9ZGJY+dUoGHYxpBIXwrD4ap2nftnghl372tzmO8xIa4LWjFoVVkorjMprG1TUzkrCkm2nR3ZE 00mV8ToIDNNw9myiQCSSuNhukwoq7fBo/Gze3C0mSztv02zirIBfVUvE/bMNGnJUOoSzObavG ZIhZaiuP7ZnOu8VoPZpNkWHfNhwlC01qaeN+U5VEAPYitXa8HElrJwOPsERA7APPE48E23+4F p1PwmZNBj4mL0aCQII2HyOVlpofP4cI2ob75pIEhMq4dyxBXlrvSg1EGfbhOaru9JshNVlNDV a14jKFpu02lCuYIAGds4Yo3cXd3Xm5O9dpuNm5huUSnMFcGXKAmjT1t0fYVeXAdCjrIQ/bNHG wnx8Sup6BijPfra0O2GPGQ7tev4UyxUKoBoi6ToUM0f5q8EX1PRi4LEH8YcExsABGjzb+6+0+ Mq8W0xt3mEtNFrfz51892j3uYbD0kVivYppPiLe7tF3VPCO10jV/GAeUWujkz2Ks39PJdQAxl HeNfv8bcHXGifP119GNg0Hrnqzs5ABpXAGwa25Mmd0XRM8rGvya2CVvoGRG6irTrpX8ajeNbr 7V68RThXHvKSDulD6kT8kMSTe0st1S5aw5T1wcN23vKomGolhmOd2BQrhPKdsSnWUHA7K5S7f BjJQH02EBpvljDc2tEIiKrHT3jZJ0oILfJhe9WzGIMANDXQNjHtsl/3Mm46XVYt1gjpwy4Ar/ UzLUD7/EDKOEvIAW7KWvngqAimbqxiVrlqXGCxVTRYqxf0m6M6plVjza2BzSK6H6QCKM3CfWW sB/d0rQgEMSqDDKDHyrK4z/C1eKOaj/niEr6v4MR4T4lvcMpRSocPBpD3a2lz/qdvWb26LEEa 1F5eaMW60GOmUFcYM+jnZWvWnaM=
Received-SPF: pass client-ip=212.227.15.15; envelope-from=julian.reschke@gmx.de; helo=mout.gmx.net
X-W3C-Hub-DKIM-Status: validation passed: (address=julian.reschke@gmx.de domain=gmx.de), signature is good
X-W3C-Hub-Spam-Status: No, score=-6.9
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, NICE_REPLY_A=-1.147, 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: mimas.w3.org 1pJzOI-00EBPH-Jj feb5216653733aa6eae476912b176c99
X-Original-To: ietf-http-wg@w3.org
Subject: Re: signatures vs sf-date
Archived-At: <https://www.w3.org/mid/4e63a31d-1168-2736-53f1-13b80a03dd05@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40701
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>

On 23.01.2023 16:23, Lucas Pardue wrote:
> Hey,
>
> On Mon, Jan 23, 2023 at 10:05 AM Julian Reschke <julian.reschke@gmx.de
> <mailto:julian.reschke@gmx.de>> wrote:
>
>     On 23.01.2023 07:56, Mark Nottingham wrote:
>      >
>      >
>      >> On 19 Dec 2022, at 9:28 pm, Julian Reschke
>     <julian.reschke@gmx.de <mailto:julian.reschke@gmx.de>> wrote:
>      >>
>      >> This sort of confirms that we really need to figure out what the
>      >> expectations for users of SF (be it implementations or
>     specifications)
>      >> are - is support of sf-date an extension you need to opt in somehow?
>      >
>      > Yes - by emitting or consuming a field that uses it.
>
>     When I invoke an SF parser - how do I signal to the parser that I want
>     support for sf-date?
>
>
> I use the Rust sfv crate, which at the time of writing doesn't support
> sf-date. Generally for Item parsing, I pass it a character iterator, and
> it returns a Rust enum with associated data that I pattern match on.
> Some examples are in the test cases [1]. Say I have a field that is
> expected to be a Boolean, I'd call parse_bare_item(<input>) and if the
> result is not Ok(BareItem::Boolean(<actual value>)), then something is
> wrong and there's various things I could do (log it, ignore it, reject
> it, etc).
>
> For sf-date support in sfv, I'd expect there to be a new BareItern::Date
> enum added to the library. When parsing a field I expect to be a date,
> I'd do a similar pattern match in my app. Of course, I'd need to update
> my apps dependency to a library version that provided that enum
> otherwise my application wouldn't compile.
>
> Should an update to the library include sf-date by default? I'm not
> sure. If I no longer get an error when I was expecting it, that might
> affect program flow. Its probably easier to reason about in Rust due to
> compiler checks. Since this is an additional type, I guess support could
> be stuck behind a feature flag, so that the old behaviour could be
> preserved if it was really necessary. The flag could be default on, or
> default off.
>
> Cheers,
> Lucas
>
> [1] -
> https://github.com/undef1nd/sfv/blob/master/src/test_parser.rs#L324
> <https://github.com/undef1nd/sfv/blob/master/src/test_parser.rs#L324>

Bare items are simple; there's no optionality involved.

What about a dictionary, where you're only looking for "x" (expected to
be an integer), but the sender adds an extension parameter "y" as sf-date?

A conforming parser (of the current spec) will reject the whole field
value, and the recipient will not be able to see the value for "x".

Best regards, Julian