Re: [Cbor] [EXTERNAL] Re: CBOR tag for RFC 3339 full-date values

Mike Jones <Michael.Jones@microsoft.com> Wed, 11 March 2020 22:11 UTC

Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A750E3A077E for <cbor@ietfa.amsl.com>; Wed, 11 Mar 2020 15:11:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.101
X-Spam-Level:
X-Spam-Status: No, score=-2.101 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.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 gthf5tZiCh88 for <cbor@ietfa.amsl.com>; Wed, 11 Mar 2020 15:11:01 -0700 (PDT)
Received: from NAM06-BL2-obe.outbound.protection.outlook.com (mail-eopbgr650100.outbound.protection.outlook.com [40.107.65.100]) (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 8D81D3A07AB for <cbor@ietf.org>; Wed, 11 Mar 2020 15:11:01 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WfR0C/kog3/ev9u467ljo7Qa93n2XJO5lwjSS/A0gBXJjEt8sDEYI5C/C+cfIFg4DEkE0rXi3k84hPlYUwE0pyoKy8bjNcifqT82OhBCEKRB7p1f7qBe6BTaLA+DARxDC3C9tvCnhfU7sKh0syRtfyNdjwpIpUV44vg8COLfP2WbazXrQUHikKMFK8lh5Ox/SV3cgbTYxMoB08sBcn87xZWnnD5c+/DxID/1rf0drqVMCdk5i8JI/8spSwTjnQCviAExtIODrnZXZmBdHXoGWR9bO7W1fdljwHyFzY0DKZ1B8VjB45OD766/OMHHkT88Arf+N68csHqjEdagEqGM1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=bW78B/Tpg6cVA18JpLfka7UybRtga8BXyjkhqCiI9RU=; b=ObXFtptxmYC9io9U/jXjY3G9pVfiIixX2D09mHIr4XVE6lD3dzdHnwMOeZuZVP9zALCHWy0ygDWliUwfr3Qz3DEdj4AI77/tgvDpxkOx5Jj8zyQLRZ0dNdIXEYou/5zESdhMNRbEaFLZUWhkF/7CksqZxTUypF2w7KEuIRNqvhdijiCAl+iJ4quGmbTWBBChT6Ul3v2zLClbR2jI+UKyEN8Zu9Hxd3s1YjPilMkFc5UKNeSQ2eQSfQ+CxaNQ+qW/x2g+DOn5M3uac/hGZaNbjOkYzqeHHwOEH8WHAAoSE2nAzP1bWbkyA9TGQvnDQNV/htQ6JUbhBo2kEfKDIwmH0w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=bW78B/Tpg6cVA18JpLfka7UybRtga8BXyjkhqCiI9RU=; b=EbJ2PUqmBmUaUiLgvOTEyD+pCiWj97cc+pv757BlDRX46LQYAwqympioEKRY+Yp8VOeTPUSasR5OQXap8OOQIQkQiEom/PVckkr9kkePloelFt2Y03aleDo5nV4mSr5+0byq3JTvg9Z3k8RgnQRDaYarXtYjd8iptQjUOhavNxU=
Received: from CH2PR00MB0679.namprd00.prod.outlook.com (2603:10b6:610:af::7) by CH2PR00MB0747.namprd00.prod.outlook.com (2603:10b6:610:68::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2849.0; Wed, 11 Mar 2020 22:10:59 +0000
Received: from CH2PR00MB0679.namprd00.prod.outlook.com ([fe80::588a:9529:739a:961f]) by CH2PR00MB0679.namprd00.prod.outlook.com ([fe80::588a:9529:739a:961f%7]) with mapi id 15.20.2853.000; Wed, 11 Mar 2020 22:10:59 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Carsten Bormann <cabo@tzi.org>, "\"Richter, Jörg\"" <Joerg.Richter@pdv-FS.de>
CC: "cbor@ietf.org" <cbor@ietf.org>, Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, Anthony Nadalin <tonynad@microsoft.com>
Thread-Topic: [EXTERNAL] Re: [Cbor] CBOR tag for RFC 3339 full-date values
Thread-Index: AQHV9+QoB1aP19tdwk+LBcQJWzg8U6hD4t2AgAANTWA=
Date: Wed, 11 Mar 2020 22:10:58 +0000
Message-ID: <CH2PR00MB067912D9FA57AAD65C1C635EF5FC0@CH2PR00MB0679.namprd00.prod.outlook.com>
References: <CH2PR00MB0679818FABC93C37FF88A404F5E40@CH2PR00MB0679.namprd00.prod.outlook.com> <AB18584F-BA25-464E-8DEC-217067D7643E@tzi.org> <282209381d8b4a8b8e77515142266df2@pdv-FS.de> <DD66072D-5319-49D7-85A0-F6F2D354A52D@tzi.org> <5D27981B-81C8-43C0-A229-66343D9D67B4@tzi.org> <ca2d18b543ce4e60acadad861b8d17da@pdv-FS.de> <79EDF742-2E54-4829-93F2-BE5A009734E2@tzi.org>
In-Reply-To: <79EDF742-2E54-4829-93F2-BE5A009734E2@tzi.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=731aab9e-566c-4749-ac3a-0000f1af9fd5; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-03-11T21:56:54Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michael.Jones@microsoft.com;
x-originating-ip: [50.47.83.137]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 00427531-d4ce-44aa-83a5-08d7c6091431
x-ms-traffictypediagnostic: CH2PR00MB0747:|CH2PR00MB0747:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <CH2PR00MB07473D65EC2E91352CDA5FBDF5FC0@CH2PR00MB0747.namprd00.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0339F89554
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(199004)(52536014)(53546011)(8990500004)(2906002)(316002)(76116006)(81156014)(66946007)(7696005)(66476007)(6506007)(8676002)(81166006)(66446008)(33656002)(10290500003)(5660300002)(4326008)(66556008)(64756008)(186003)(26005)(478600001)(71200400001)(55016002)(107886003)(966005)(110136005)(86362001)(9686003)(66574012)(8936002)(54906003); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR00MB0747; H:CH2PR00MB0679.namprd00.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 6HvmdhyBKtEGQqWZk4Xn6PZtj/3Q5NtcIOhIYodO8puetUmoHPhnpjVAN2RN5s287xFGmMiUfUjs/xiXe1YUhgPFuN2YfeIG26sMEDx1ag/UmcBO6iM4YCQ4jBFBDyjNCZb9jMcIGQeOG4A25OkmfjEqeHFg+oD61zYOO8A38XaXwwui9DKh3tVTZHn9u+n5ffZMs1lz8/a9GT1QbUiwDqoU3bbXFPWrzHILypi+TjwQIbh6+Qi7PFa4Lub414k4ALXO/F2djHtggmNoR7J9xVz3nM+rrIJLbafOS0B4xyWM003nqY8vdhu5Vj7EOtnnYxfPiKYyxU7Pjeg2bVnYrPG/mmQBNtJWqLB1Sm6g93Yise9ZnYUwwUCX6Awuog/B/2iHzPn9fCNovKnENpJiikWvDZgNiYJ947AqaooQJ/ahO9XgSbjxHQgzu6TR7D6fiOvD2fdIKIUcERwgFeLOmxCKegQQJ1n9a9EHDBi6ejbadg9HQZaovx0Wap9Ef7Wn0gwMrj4vXrUm0aAdarjATA==
x-ms-exchange-antispam-messagedata: pe3bPItUT/nuKtV9gwAecxb4lzVErsubKG5XB4QV0ycomAJW+8uQ4dqFFVLPDcdrsyCqxeLBY+hJssVu8zK9dH2jSBancospQJ+pr9+Sff+I+GWT+m5c8QSJLBKDA8WO63HW6U4lDhkVw3Yo1SegIQ==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 00427531-d4ce-44aa-83a5-08d7c6091431
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2020 22:10:58.8892 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: t3g5JLNhEjlbkLLm5l2gbrJZnbmW/SG+MVNTzmuaUlxli34h422AXDOcPBwt3wY5iZovldKVWLmOPWlhxPJO0A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR00MB0747
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/A9EriQZNCVUR_H1FuUTKZ-bxjBg>
Subject: Re: [Cbor] [EXTERNAL] Re: CBOR tag for RFC 3339 full-date values
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Mar 2020 22:11:11 -0000

The point of having the tag is that the code knows what follows.  If a polymorphic tag were used, in which two unrelated representations of dates are legal, then the code doesn't know what follows.  And it also opens up questions that it would be cleaner to never have to consider - questions such as "If the polymorphic tag is adopted, must Mobile Driver's Licenses accept both representations?"  And "Will interoperability be harmed if some Mobile Driver's Licenses use one representation and some use the other?"  (The answer to that one is probably "Yes, interoperability will be harmed".)

Carsten, I take your point about both integers and floats being acceptable for tag 1.  But those are closely related (numeric) representations of the same thing.  Whereas a date string versus number of days relative to the Epoch are nearly unrelated representations, with fairly complicated conversion rules between them (involving leap years, leap centuries, leap 400th years, etc.).

Given that Jörg stated below that he's OK with using different tags, I propose that we move forward with using tag 1004 (requested) for RFC 3339 full-date values and tag char('d') (requested) for integer number of days relative to the Epoch.  If I don't hear objections soon, I'll publish that draft.

Jörg - I'll also add you as a co-author.  What affiliation and e-mail address for you should I use?  And is there a URL for a blog or Webpage you'd also like me to include for you?

				Cheers,
				-- Mike

-----Original Message-----
From: CBOR <cbor-bounces@ietf.org> On Behalf Of Carsten Bormann
Sent: Wednesday, March 11, 2020 2:09 PM
To: "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
Cc: cbor@ietf.org; Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>; Anthony Nadalin <tonynad@microsoft.com>
Subject: [EXTERNAL] Re: [Cbor] CBOR tag for RFC 3339 full-date values

On 2020-03-11, at 21:31, Richter, Jörg <Joerg.Richter@pdv-FS.de> wrote:
> 
> (Replying to more than one message here)
> 
> Carsten Bormann: 
>> Is that a good way forward?
> 
> I am fine with the suggested procedure. 

Great!

> 
>> What I like about Mike’s draft is that he references RFC 3339, which 
>> already is an established specification for how to write dates 
>> textually
> 
> ISO 8601 also defines this format for dates. It is mentioned in the "Detailed Semantics" 
> section of my proposal.

ISO 8601 is very “flexible”.  RFC 3339 uses ISO 8601, but helps by restricting this to commonly used cases.
So I think referencing RFC 3339 is strictly better than just naked ISO 8601.

> Mike Jones:
>> I'm fine merging Jörg's numeric date tag into my draft, provided that 
>> the result is not a polymorphic tag, in which the value could be either a number or a string.
>> We should allocate separate tags for string date and numeric date, 
>> just as tags
>> 0 and 1 are different, and not polymorphic.
> 
> I've got the impression that using a polymorphic tag would be no major problem.
> We can even specify that decoders might only support one representation of the tag.
> I think it would have the same effect if a decoder supports only one of the two tags.
> But either way I would have no objections to using two tags.

I’m not sure I like the term “polymorphic” here too much — in any case, the “value” would be a date.  The content could be both text and number.  Tag 1 already does this (integer vs. floating-point), so we already have to deal with these (i.e., allow applications to not just say “Tag 1”, but “Tag 1 with integer content”).  But we did separate Tag 0 and Tag 1, mostly because the semantics of the value are subtly different.  Are they here?

> Laurence Lundblade:
>> I’d suggest the numeric date be restricted to integers. No floats, 
>> bignums, decimal fractions…
> 
> Yes, that was the plan. Only major types 0 and 1. 

Finer granularity between dates would be times, which we already have, so this naturally should be integers.

>> Fractions of days can be represented by tag 0 or tag 1 using hours, 
>> minutes, seconds. 64-bit integer counts of days are large enough.
> 
> This I don't understand. The proposal only handles whole days as one number.

Right.  Only full days.  (The related observation is that these are always in the local time of some context that is not expressed, which is rather different from our time tags.)

> Another thing to consider:
> We should mention that this tag(s) use the proleptic Gregorian 
> calendar. So that dates before the Gregorian calendar have a unique semantics.

Good point.  In 7049bis, we just say:

Negative values (major type 1 and negative floating-point numbers) are interpreted as determined by the application requirements as there is no universal standard for UTC count-of-seconds time before 1970-01-01T00:00Z (this is particularly true for points in time that precede discontinuities in national calendars).  […]

That is less of a problem on the date-only side (as long as dates change on local midnight… and not noon), so we may be able to be more specific.

Grüße, Carsten

_______________________________________________
CBOR mailing list
CBOR@ietf.org
https://www.ietf.org/mailman/listinfo/cbor