Re: [Cbor] What's your opinion of using CDDL to simultaneously define CBOR and JSON?

Michael Richardson <mcr+ietf@sandelman.ca> Thu, 09 September 2021 01:27 UTC

Return-Path: <mcr+ietf@sandelman.ca>
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 99F053A1118 for <cbor@ietfa.amsl.com>; Wed, 8 Sep 2021 18:27:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 zY6KDWOOL4LG for <cbor@ietfa.amsl.com>; Wed, 8 Sep 2021 18:27:50 -0700 (PDT)
Received: from tuna.sandelman.ca (tuna.sandelman.ca [IPv6:2607:f0b0:f:3:216:3eff:fe7c:d1f3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8C7AA3A1117 for <cbor@ietf.org>; Wed, 8 Sep 2021 18:27:49 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by tuna.sandelman.ca (Postfix) with ESMTP id 07363398CF; Wed, 8 Sep 2021 21:34:12 -0400 (EDT)
Received: from tuna.sandelman.ca ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id z-cfHeKdiR3o; Wed, 8 Sep 2021 21:34:06 -0400 (EDT)
Received: from sandelman.ca (obiwan.sandelman.ca [IPv6:2607:f0b0:f:2::247]) by tuna.sandelman.ca (Postfix) with ESMTP id 263CA398CA; Wed, 8 Sep 2021 21:34:06 -0400 (EDT)
Received: from localhost (localhost [IPv6:::1]) by sandelman.ca (Postfix) with ESMTP id 24C4C7B; Wed, 8 Sep 2021 21:27:40 -0400 (EDT)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: Laurence Lundblade <lgl@island-resort.com>, Henk Birkholz <henk.birkholz@sit.fraunhofer.de>, cbor@ietf.org
In-Reply-To: <1408D50A-18CC-42AA-BCF9-E8D8E6F87354@island-resort.com>
References: <51537C68-F495-4750-9376-A637BD0E78DD@island-resort.com> <0d4b6a9a-dc26-ee31-725b-3689dfdce041@sit.fraunhofer.de> <4BD93D61-1668-4AE8-B59B-ABC2D3F5C455@island-resort.com> <14293.1631135238@localhost> <1408D50A-18CC-42AA-BCF9-E8D8E6F87354@island-resort.com>
X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 26.1
X-Face: $\n1pF)h^`}$H>Hk{L"x@)JS7<%Az}5RyS@k9X%29-lHB$Ti.V>2bi.~ehC0; <'$9xN5Ub# z!G,p`nR&p7Fz@^UXIn156S8.~^@MJ*mMsD7=QFeq%AL4m<nPbLgmtKK-5dC@#:k
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha512"; protocol="application/pgp-signature"
Date: Wed, 08 Sep 2021 21:27:40 -0400
Message-ID: <6488.1631150860@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/WuHjpn2HgAgrrCyOczDD8W_yRmw>
Subject: Re: [Cbor] What's your opinion of using CDDL to simultaneously define CBOR and JSON?
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: Thu, 09 Sep 2021 01:27:56 -0000

Laurence Lundblade <lgl@island-resort.com> wrote:
    >> On Sep 8, 2021, at 2:07 PM, Michael Richardson <mcr+ietf@sandelman.ca>
    >> wrote:
    >>
    >> Laurence Lundblade <lgl@island-resort.com> wrote:
    >>> As far as I know, no I-D or standard has defined a protocol solely,
    >>> directly, and abstractly in CDDL such that it simultaneously
    >>> specifies CBOR, JSON and other encoding except EAT.
    >>
    >> RFC8995 uses CDDL to describe a JSON encoding of enrollment status,
    >> and voucher status POST content.
    >>
    >> draft-ietf-anima-constrained-voucher uses the same CDDL with a CBOR
    >> encoding.
    >>
    >> Is that what you are looking for?

    > In concept yes, but in practice not what I was thinking/expecting. As
    > far as I can see draft-ietf-anima-constrained-voucher does not make
    > direct normative reference to voucherstatus-post or voucherstatus.cddl.

Appendix B provides examples.
   Appendix B.  Constrained BRSKI-EST messages . . . . . . . . . . .  37
     B.1.  enrollstatus  . . . . . . . . . . . . . . . . . . . . . .  37
     B.2.  voucher_status  . . . . . . . . . . . . . . . . . . . . .  38

Section 5.1 refers to them via /vs and /es resources:

The Content-Format 50 ("application/json") MAY be supported and
Content-Format 60 ("application/cbor") MUST be supported by the Registrar for
the /vs and /es resources.
Content-Format TBD3 MUST be supported by the Registrar for the /rv resource.
If the "ct" attribute is not indicated for the /rv resource in the link
format description, this implies that at least TBD3 is supported.

    > I didn’t try to read these documents so hopefully I haven’t missed
    > something. I did some greps to look for the references I was
    > expecting. Is there some way that draft-ietf-anima-constrained-voucher
    > is directly referencing the CDDL (e.g. voucherstatus-post) that I’ve
    > missed. It looks like a parallel/equivalen definition to me.

It doesn't reference the CDDL at all.
Why would it?  We don't need to change it.
We simply say that having that content in CBOR format is a MUST.

Perhaps the document is deficient and should say things more explicitely.

--
Michael Richardson <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
           Sandelman Software Works Inc, Ottawa and Worldwide