Re: signatures vs sf-date

Lucas Pardue <lucaspardue.24.7@gmail.com> Mon, 23 January 2023 15:26 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 6A9A9C1524A5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 23 Jan 2023 07:26:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.75
X-Spam-Level:
X-Spam-Status: No, score=-7.75 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, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 3JjeNZ3yq9wE for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 23 Jan 2023 07:26:38 -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 8DA0EC1522B2 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 23 Jan 2023 07:26:38 -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 1pJyfd-00577b-Mh for ietf-http-wg-dist@listhub.w3.org; Mon, 23 Jan 2023 15:23:41 +0000
Resent-Date: Mon, 23 Jan 2023 15:23:41 +0000
Resent-Message-Id: <E1pJyfd-00577b-Mh@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 <lucaspardue.24.7@gmail.com>) id 1pJyfa-00576J-RT for ietf-http-wg@listhub.w3.org; Mon, 23 Jan 2023 15:23:38 +0000
Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by titan.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <lucaspardue.24.7@gmail.com>) id 1pJyfX-00475e-E2 for ietf-http-wg@w3.org; Mon, 23 Jan 2023 15:23:38 +0000
Received: by mail-oi1-x233.google.com with SMTP id v17so10630831oie.5 for <ietf-http-wg@w3.org>; Mon, 23 Jan 2023 07:23:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=C3Ekg6rPpjNLokAAJwmP+IPg00nUlb5ZLcM6K47Ckmo=; b=jKu+kn8put44PXZmpDjmwML7e39n30ES4ZUtLLLVmYIYPJRWjAtQfu/CIpFnP6HTqB zrLZxjWHOst91SdYOe9Lbyros9D2XPshEncmIFAPCdQpYn8dQ1qBKrXfuS+UC/zNN81S GnXMZLmdVQj6IXR3vQZgXxsT3fyH/pACCphvpgmMc3jttmMoTzNPXw1wolylt29s6MKZ icYlqCIzw1566hZgZ8cY0WlnTQg1H/PimjuBs5I9Ry1/Cx3V99phyRwMWweUQjQs/lEz PE9qu3YKmKWSbib8ps7CtSzNDxsWctQhgbFhaesrkrjSOK8koWyt6haw+dTnJSUwkfXF k40w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=C3Ekg6rPpjNLokAAJwmP+IPg00nUlb5ZLcM6K47Ckmo=; b=n2W5WuUqawz9BoEvs7VaiIeypyfIs6nNc7z9cd7GHoV3YW5DvHVJFM3TwnZqZ/Ue5I ceFJsRC2Ez9lW7w3Xxs6BTPDQ7Fc1nwvdGXbUWVvM5WBSG7n3ojCxzou5P6HgxGDM28v kz3ubJl1PAP7DrcnIVA+l9eZQIw6FCAAqMnyTKzSFOxjQOFYZqbMHp7fmkGCvfld9kYA zgq8SLTGICYEe9EV+Nwoiq4wPjC8HvP/CZC+XtPU2fYffSY8La9+8SDi+TGGY6Ll1613 MycABI2T2U+8po2TVw5zG2im/3BTlgGMwub8PFXqF+3dY4JGJ4L9dfAv74Zg1KR9Vwj1 CZhA==
X-Gm-Message-State: AFqh2kp/+v9RctxCf6ZPLY3neJ0HHpGSilMcnpMQi6gSx/bdFCug3YRT gt+W+81V2Xkhzwtg0TgcMjJNTecEYPcP6P2L/i+wcK5sr2o=
X-Google-Smtp-Source: AMrXdXudOSrnm8DBYV4p+sVzW3NMyYi4SE1JYR8O51kpC/WHr6GraZeVGabe07uw5QC82VzqKS0j0+iLwUy4Lwhlb48=
X-Received: by 2002:aca:2201:0:b0:364:5ff6:dd8c with SMTP id b1-20020aca2201000000b003645ff6dd8cmr1376061oic.4.1674487406293; Mon, 23 Jan 2023 07:23:26 -0800 (PST)
MIME-Version: 1.0
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>
In-Reply-To: <a4cae48c-960f-0edb-33c5-19e01b7e4093@gmx.de>
From: Lucas Pardue <lucaspardue.24.7@gmail.com>
Date: Mon, 23 Jan 2023 15:23:15 +0000
Message-ID: <CALGR9oZMYhB8MXZzJHjb1QM+x7f3w_bENDLDqr39+BR5=t5r3w@mail.gmail.com>
To: Julian Reschke <julian.reschke@gmx.de>
Cc: Mark Nottingham <mnot@mnot.net>, ietf-http-wg@w3.org
Content-Type: multipart/alternative; boundary="00000000000008788905f2effb8e"
Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=lucaspardue.24.7@gmail.com; helo=mail-oi1-x233.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=lucaspardue.24.7@gmail.com domain=gmail.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-4.8
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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 1pJyfX-00475e-E2 2c62ada2c37f0574f88d01d492c65816
X-Original-To: ietf-http-wg@w3.org
Subject: Re: signatures vs sf-date
Archived-At: <https://www.w3.org/mid/CALGR9oZMYhB8MXZzJHjb1QM+x7f3w_bENDLDqr39+BR5=t5r3w@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40700
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>

Hey,

On Mon, Jan 23, 2023 at 10:05 AM Julian Reschke <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>
> 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