Re: [core] YANG-CBOR, Date formats

Carsten Bormann <cabo@tzi.org> Wed, 29 June 2022 13:37 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5A0ADC15C7E3; Wed, 29 Jun 2022 06:37:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.906
X-Spam-Level:
X-Spam-Status: No, score=-1.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=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
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 GeOx2y12nRPk; Wed, 29 Jun 2022 06:37:09 -0700 (PDT)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CCAACC15C7E0; Wed, 29 Jun 2022 06:37:07 -0700 (PDT)
Received: from [192.168.217.118] (p5089ad4f.dip0.t-ipconnect.de [80.137.173.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4LY2Z919zKzDCnn; Wed, 29 Jun 2022 15:37:05 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <274622.1656503120@dooku>
Date: Wed, 29 Jun 2022 15:37:04 +0200
Cc: cbor@ietf.org, core@ietf.org
X-Mao-Original-Outgoing-Id: 678202623.263846-94e9cf60befb5d4aa91fae240d7a3a83
Content-Transfer-Encoding: quoted-printable
Message-Id: <2913DF0F-8F46-47E0-92AE-C29E5AE20578@tzi.org>
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>
To: Michael Richardson <mcr+ietf@sandelman.ca>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/ramJEKrcp6MQGEI33grdQxCGjQY>
Subject: Re: [core] YANG-CBOR, Date formats
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Jun 2022 13:37:13 -0000

> 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