Re: [Cbor] [core] YANG-CBOR, Date formats

Esko Dijk <esko.dijk@iotconsultancy.nl> Wed, 06 July 2022 12:18 UTC

Return-Path: <esko.dijk@iotconsultancy.nl>
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 99D00C15CF4F; Wed, 6 Jul 2022 05:18:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[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_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-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=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=iotconsultancy.nl
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 AMjehSH-Rhs3; Wed, 6 Jul 2022 05:18:54 -0700 (PDT)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60134.outbound.protection.outlook.com [40.107.6.134]) (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 7A53CC14F738; Wed, 6 Jul 2022 05:18:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hNYUQYXODiPQEnnmQFQ9edxSVuawyqxV2982uc2E13RQJvb4w8FlkYOHJDJKZaW+g8IHixGw9ZayESUwXC+dwXK8iJX/e83utCeHZfGm7T1qtwnk0YF0ypGC6IV+QIz7RpU8Ol5xyV7ZfnL5orrqp0ITI8/sOHkipuIerIWhyYVjTMHwmL91mm22iY8wze+CDRmkoJ953VLKJNatIbH/YVlfEyH4qizEkAUJStyE2ele9y3UkDEUabsA9HkEeqHxASMoZAS4o7JT0Ia32CD5fwNGJxnJM9jFnUWHJWdoenFIiTDL0Z57p/07h6nNylrKnDrJ+Fw1C92CSmxerScOGA==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QkTMG/gxJuWR03yRcZ9o4t81zWF4sATQOZnnjbqbu+g=; b=Q5aDb0OmGHdJoc7fudCAAGyvLggfHckMmlG72M8XmvH6D0vOdyH1UnaZBQSyKFi3VWj2tbb4Uye0/9yQnZsclEbZavvbVQtlpq8xbSGT3IOdyGpImtIXlE6ngijXqd2t3ImtQSXLQ48aB59PBbJE2iO/BNl7tKKrx9G1iOMv8B9VuOxxMtXJx7TmmbGIUtDyXf8VR5jGpnCQWcu1p/7Ds/ugNrRl03ohyK4zWvDMi8RZXLkxOEPVsRRMpd42ijKQ8ZO1YT3OKjmgpN2gEGIiowV3acJZrYjMchC7jX7K42LTYBTa7pFUjA4lWZICBdln6dS1GvfTDI4eyKDs6PfnTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=iotconsultancy.nl; dmarc=pass action=none header.from=iotconsultancy.nl; dkim=pass header.d=iotconsultancy.nl; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iotconsultancy.nl; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QkTMG/gxJuWR03yRcZ9o4t81zWF4sATQOZnnjbqbu+g=; b=IBwPTcgZoUTbiFzE0qYhwHnn6qfrvljXReZMk0hgddAEaVYhDd7i2Hhm6x3k4COFU8oBxWkB4jHC6WaN1WK1o6EVtl4pqVW3D5LBHmWk7WiHNF8e8v35YCzCyw20qve89zELwbiNU8a6DXf8by5w6r3eavjWiUZ3lvwE+mTwYYA=
Received: from DU0P190MB1978.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:3b9::20) by PR3P190MB0938.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:80::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 12:18:50 +0000
Received: from DU0P190MB1978.EURP190.PROD.OUTLOOK.COM ([fe80::50a1:9a72:f2e6:587e]) by DU0P190MB1978.EURP190.PROD.OUTLOOK.COM ([fe80::50a1:9a72:f2e6:587e%5]) with mapi id 15.20.5395.021; Wed, 6 Jul 2022 12:18:49 +0000
From: Esko Dijk <esko.dijk@iotconsultancy.nl>
To: Carsten Bormann <cabo@tzi.org>, Michael Richardson <mcr+ietf@sandelman.ca>
CC: "cbor@ietf.org" <cbor@ietf.org>, "core@ietf.org" <core@ietf.org>
Thread-Topic: [core] YANG-CBOR, Date formats
Thread-Index: AQHYi7WPl09Y7ALapkmg54v/36vuDa1mRAAAgAAfNwCACugIsA==
Date: Wed, 06 Jul 2022 12:18:49 +0000
Message-ID: <DU0P190MB197851016C1B73DD8E86F2B9FD809@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
References: <CALaySJLPtUjdfVss17noK=18RyczpcCGNu=im8CBpiQz=WiLWA@mail.gmail.com> <CALaySJKUNh-AkJa87sCDpzf9OHV8H367VQyzyozXCCXxphUARw@mail.gmail.com> <CALaySJ+P2sP7BU7bNSxRJBByyp04rzVZuukq_e+9wbb5WPRSFQ@mail.gmail.com> <CALaySJKxht1gd1+3mNiAH-kLUAxjdPPk3doK50C_xS74LG+YTQ@mail.gmail.com> <CALaySJJNXpcaBhWQiK+4vmUk+s6mfMvwQFnB9d4YfDtdet09OQ@mail.gmail.com> <CALaySJ+8qLX6kuqXcRp6-OHU_MBkkASfH80bf2EePueduMsCTw@mail.gmail.com> <CALaySJJ+rhJMOfhhc9jDxz_9y+VpyrNoMcFy_b00Ui05c+g4zw@mail.gmail.com> <258768.1656499296@dooku> <274622.1656503120@dooku> <2913DF0F-8F46-47E0-92AE-C29E5AE20578@tzi.org>
In-Reply-To: <2913DF0F-8F46-47E0-92AE-C29E5AE20578@tzi.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=iotconsultancy.nl;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: e45d456a-ff41-4f4c-f0d1-08da5f49aefe
x-ms-traffictypediagnostic: PR3P190MB0938:EE_
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: jY/dAjrcoIMa3s8sXJJbfB37Urw9AQxeLsgO7EKZcvlDkKAt4hfM2o4tOb0rcHzvUIb0RjuSXUNwMiQ2rnDR0yXBqypbz0XI66LbTJRulXrOzvTOaMnPQhtCl9OtJx25lOOOatM9lkwiVbx3EjVyIalgYI27Tt3CAgv5IV0OLH0ESdw/LZvSIKGt0Njm1sUVCdsMWF+Fo2UsME9LMNXNYRH0S1029ZCQKMKmDYroFFpA0yk92LX7m9VuUp0n3oui67RtVsU/1wDQrbNepYTuCpWa9khjn50c40iK0yS0uTI3sILLzmE3Uw/C8S+LWUDmW4DTRcul23c+/kH2LSXxX5/BGLhM/TdHkXCV8XG93onI5VB/rIOBiizA83y6GO8NtQQAXXgGj9IhUB5eNHCkNk3yavcDuiLIN6J8XnwfdVMzoyEfQHeWNISgK4c+peGtfkahHVB79qGQ71lzUfZpSuAuATUa1nFA8/V2t0NtlvuhQc4gCU09lexwZ8kDVCw8c0gI2eTLMpBUjBKHNEx+IJYIFFw87E6bf00NgMdVmjAUlJzQx3jDbOKWhOIHn6iKmC8mgu/77FPfIdB6kz01et93NvtxgSlUz7DyqWSsogsTF/TmzuiP879CVNbtI/ciA64y86aclcaTMzTu8Zb5PKZASsJ0VkqTYQ1x/OdkanaE7Ww/FH5R0TMC9DdUaejQ2sedcn7WmYUrogsmFzgoSHCFsggEgFbkWXRr56EPwRoUBq4sRKg1DT3FjBraUVV9w55m+sdsWLn5AqsS07jGCrp+/aYSumJPL1gLIc74tDPlsTKTT8W+g77lSjeAFDaO5NO+Qq+0vib5AJHYezk4dw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0P190MB1978.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(346002)(39830400003)(376002)(136003)(52536014)(76116006)(8936002)(5660300002)(54906003)(66476007)(66556008)(66946007)(4326008)(41300700001)(86362001)(66446008)(71200400001)(316002)(110136005)(64756008)(186003)(38070700005)(7696005)(9686003)(6506007)(2906002)(38100700002)(122000001)(55016003)(8676002)(966005)(33656002)(44832011)(53546011)(83380400001)(478600001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 1EK7cP9qoHjM4kTkmrqPsW6zRzKJ2Ei299/J0mFbk3Dzm52b0a+F7qJyQQQ97RyT4d692quFnWlVLnZyGvhMjLiE+RNZ+QTNy6PCtBP4p8skZIT0gxA4KQEaP+HHKzh5oic73F+IqJyNT5afwBGG6Bd879m6CI7nVLNqSnsQXZrSu4/kvzjPXLOebLVG4s6FO0qNBJjvp3zPtulqYUMhCkw8qD3ldZVxgxzsp/p9UW9oVeS7jqc7PJReea+5dcTxRxTmtkBsUPBTeCZYmihS0xOgA0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q7+3Njh2uSIR5El7BQn9bomlGWVGU6E0GbapOcXwCXqpnaNU5KOg6Rtrw/Z7nBRuRz8Qomb5djE5DeXfJf1JnJuL4e0hvs+RxDxb1ASZDhzaUYJu3iQprfzJsUfJvAmepss01r6tqs0dxmqwq8Aiye/llG9FK6zXS7N71vhBcZf1OSqmP++u17vRzNVcqUOzQdDX+YL7OH/vYtojEZHSBhbVjwko9VvbCApd0DPjj4yAEm/N/dcWC5i4/IYfbxnI6ZjFzkvLtDw80JqfqMEwqWgAyVRc6gP2+mlE0/sAClEczGmDdEjkpoGYi0YSI5d8VlMqF6Amumhg==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: iotconsultancy.nl
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DU0P190MB1978.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: e45d456a-ff41-4f4c-f0d1-08da5f49aefe
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2022 12:18:49.9384 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 58bbf628-15d2-46bc-820b-863b6774d44b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bI3hvE9UB3to0OKvSmTPUE/xwqYe9tNgQITXI6VRgB0lJTkeYt5lLFbQsDAH5hQO0TvsCKXYpWE2hgK/YCnGwY2iECT4mJGk0zsEjwfOguU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0938
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/DRC9MbzHWHeJBt6INgtWyEf3rf8>
Subject: Re: [Cbor] [core] YANG-CBOR, Date formats
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
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, 06 Jul 2022 12:18:59 -0000

I see a simpler solution available now, for this date-format question. 

In draft-constrained-voucher we for example already define alternative representations using a leaf with another name.
For example, proximity-registrar-pubk is defined as a new field that can be used instead of proximity-registrar-cert, effectively specifying an alternative format for identification of a registrar.

We can do the same for date fields, e.g.
"created-on" -> "created-on-epochtime"
"expires-on" -> "expires-on-epochtime"

Where we can require in the YANG model that the new field is only of uint type; and point to the RFC 8949 section 3.4.2 definition.
The nice thing is that a Registrar or a MASA can easily handle either format, while the Pledge can be code-optimized to handle only the numeric uint format. (And MASA knows what the Pledge can support so will use the proper encoding the Pledge can understand.)

I suspect this can't be wrong, because we're doing the same for other fields (e.g. the proximity-registrar-cert as mentioned earlier.)

regards
Esko


-----Original Message-----
From: core <core-bounces@ietf.org> On Behalf Of Carsten Bormann
Sent: Wednesday, June 29, 2022 15:37
To: Michael Richardson <mcr+ietf@sandelman.ca>
Cc: cbor@ietf.org; core@ietf.org
Subject: Re: [core] YANG-CBOR, Date formats

> What SHOULD a compliant yang-cbor decoder *do* if it sees a representation
> node (I think that I used the right term), which is encoded using one of the
> standard RFC8949 tag types at:
>  https://www.rfc-editor.org/rfc/rfc8949#name-tagging-of-items

Answer: Croak.

There is a well-defined number of tags that can occur in YANG-CBOR.

Now, with the extension we are discussing, there would be a defined set of tags that have a translation: conceptually, these are translated into the equivalent YANG strings (1(1656449295) ➔ "2022-06-28T20:48:15Z"); in practice, they become the platform types that correspond to the tags.

You could define your own media type and simply specify that this transformation happens (conceptually, again) to turn the representation into the yang-data+cbor media type.

The breakage that could happen is that a generator misses converting a string into concise, or that a consumer breaks with non-concise form in a place that would allow a concise form.  That’s why it probably is a good idea to have something at the schema level — as a YANG extension (preferred) or hidden in the SID file.

                 .oOo.

The underlying problem is that you got what you wished for.

There is no need for YANG to define a security format.
Once it was decided to use YANG anyway, you had the baggage.

Now you are complaining that YANG-CBOR didn’t magically carry that baggage.

I think the learning is a different one:  
Don’t light your kitchen stove with a flame thrower.

Grüße, Carsten

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