Re: [Cbor] Unusual map labels, dCBOR and interop

Henk Birkholz <henk.birkholz@ietf.contact> Mon, 18 March 2024 00:35 UTC

Return-Path: <henk.birkholz@ietf.contact>
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 C3601C14F61E for <cbor@ietfa.amsl.com>; Sun, 17 Mar 2024 17:35:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.199
X-Spam-Level:
X-Spam-Status: No, score=-7.199 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, NICE_REPLY_A=-0.091, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 (2048-bit key) header.d=ietf.contact
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 DCsUnWjMhKip for <cbor@ietfa.amsl.com>; Sun, 17 Mar 2024 17:35:18 -0700 (PDT)
Received: from smtp04-ext3.udag.de (smtp04-ext3.udag.de [62.146.106.41]) (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 87CD0C14F618 for <cbor@ietf.org>; Sun, 17 Mar 2024 17:35:18 -0700 (PDT)
Received: from [31.133.134.154] (dhcp-869a.meeting.ietf.org [31.133.134.154]) by smtp04-ext3.udag.de (Postfix) with ESMTPA id 99127E03C2; Mon, 18 Mar 2024 01:35:07 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ietf.contact; s=uddkim-202310; t=1710722109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lvEXgdylHmd9rQQsQQmPcoRVRPr+UhVK7vuZjEmw3Gs=; b=3EMbrTY5VX7qgihPAVAhyq9haqs6bfQ/p4bPVzjeRlYce5B6E8wHx4n37uSriWkZdbL6Z1 sydvzYVSyFvUSjuoOznX+pHt3Jxc4UFBXhP77T4+DOR+SR44gbw4YDdYtPB+RTU7jq8iEu ZM9Pg6p9GrH8ZdqlPODdQrdSgFRyGz+IY4YgPtxXB4BuUFGNAgpyOIzZNphumLY2KBJlTH 4aVhMToZ8kI08+tCzSIVisx+ar0zrYh7STjwvBhHiNdvEJR+xZyeE17Tl7PhZxLITvZwNK AT0MXmSRDpQ76ctl5+3iDxQHZgMZjJ8WkhiXGDPF0sSW6PkJNvZbb46qjzWPcA==
Message-ID: <49eed1ea-f6d7-bb8c-adfa-a0943f715bb2@ietf.contact>
Date: Mon, 18 Mar 2024 01:35:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
Content-Language: en-US
To: "lgl island-resort.com" <lgl@island-resort.com>, "cbor@ietf.org" <cbor@ietf.org>
References: <8C245824-1990-4616-AB70-FFD4FACB1AE9@island-resort.com>
From: Henk Birkholz <henk.birkholz@ietf.contact>
In-Reply-To: <8C245824-1990-4616-AB70-FFD4FACB1AE9@island-resort.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Authentication-Results: smtp04-ext3.udag.de; auth=pass smtp.auth=henk.birkholz@ietf.contact smtp.mailfrom=henk.birkholz@ietf.contact
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/ENdnFijtVOAoiam5bM6wxnNv_P0>
Subject: Re: [Cbor] Unusual map labels, dCBOR and interop
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: Mon, 18 Mar 2024 00:35:25 -0000

Hi Laurence,

Why are map labels special here?
Or does your comment imply that dCBOR relies on a "symmetric" dJSON?

More comments in-line.

On 17.03.24 19:41, lgl island-resort.com wrote:
> A CBOR map label (aka map key) can be any data type including perverse things like an array or a map. Here’s a sample I made for dCBOR testing:

"perverse"

> 
>      {[]: 7, 1(88): 2, "text": 3, 1: 1, {}: 4, h'7878': 5, true: 6, 8.77: 7}
> 
> It has a map label of each major data type.
> 
> Probably dCBOR should disallow map labels that are not strings or numbers because they don’t translate to JSON. Same reason simple type undef is disallowed.
> 
> Probably we should state a general CBOR preference that map labels only be strings and integers.  QCBOR only supports text/byte strings and integers for map labels.

It is not an implementation of RFC9254 then. Maybe that should be noted 
somewhere.

> It’s been like this for years now and I’ve had no comment or request. Probably any use case that considers unusual labels can be redesigned to avoid them.  We only state a preference, not a prohibition, just like with indefinite lengths.

For a while, arrays where (considered and tested) as map keys in 
suit-manifests. Again, if you do not want to implement RFC9254, please 
set up some warning signs.

> 
> LL

Viele Grüße,

Henk

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