Re: [Json] Proposed minimal change for duplicate names in objects

Nico Williams <nico@cryptonector.com> Sun, 07 July 2013 02:57 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 50ADE21F9DF0 for <json@ietfa.amsl.com>; Sat, 6 Jul 2013 19:57:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WzMsIPE4b2AB for <json@ietfa.amsl.com>; Sat, 6 Jul 2013 19:57:54 -0700 (PDT)
Received: from homiemail-a25.g.dreamhost.com (mailbigip.dreamhost.com [208.97.132.5]) by ietfa.amsl.com (Postfix) with ESMTP id 5B4D421F9DCC for <json@ietf.org>; Sat, 6 Jul 2013 19:57:54 -0700 (PDT)
Received: from homiemail-a25.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a25.g.dreamhost.com (Postfix) with ESMTP id E7903678058 for <json@ietf.org>; Sat, 6 Jul 2013 19:57:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type:content-transfer-encoding; s= cryptonector.com; bh=BHlVcdw5zrJg6d12j3Jnw8Qd6Sw=; b=lI9lH2eiohw CH1onGA9fVVInRx7MeVwd3th1JhebqM2quXXVe32vLtfSJCQ0ujBQ/+5PZnOxC9W JSOC/tPFL3touTq0CG6nXrjhlTxIWul8I3Ix1FWpluNrMsBUa3tkXgpOJ4pG2j09 acbCbz1L7xt3errBG6ty+FUosom1n1rs=
Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a25.g.dreamhost.com (Postfix) with ESMTPSA id 9E26D678057 for <json@ietf.org>; Sat, 6 Jul 2013 19:57:53 -0700 (PDT)
Received: by mail-wi0-f178.google.com with SMTP id k10so3046809wiv.11 for <json@ietf.org>; Sat, 06 Jul 2013 19:57:52 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=p+ZZCUFwMuSDeiNRMHtp5rbw11VVH6lxWqIM0nflyAY=; b=I+sC1ock9pPdN934pym8axZM0fmqs/KPpQNsyQSaPdwEiuylyafwTQciqNu5DSdcNQ hlpn9hEx9ZYRZ11Dug5aNCp/6e15CyxBoRLW8XPHeanLVBdo/ahLlqz3V6ELJiz4shEG UxDGqiul9qKHtib/rnwwev/GvMqNRY/EM9alOHrpemmpvJg+MPQFvqBN/kEd4VRBeuyw 55zMXoWgRznbS8RvbjTV5IkykQnzfeCS2vK7q7M21n6bavfRj4iBYppfiJxaXbTn2W0j LhDYSmHHyAFN4PjBniW84OpIJ0zGR7CPNq7T0LFYhGDda7vLr/tZQmvNrhE1HszjMPfW yw8Q==
MIME-Version: 1.0
X-Received: by 10.194.7.137 with SMTP id j9mr9481429wja.11.1373165872139; Sat, 06 Jul 2013 19:57:52 -0700 (PDT)
Received: by 10.216.152.73 with HTTP; Sat, 6 Jul 2013 19:57:52 -0700 (PDT)
In-Reply-To: <CAHBU6itdi3B1rWv2TiOYhL1QuOVxrFKt7OTWRoG+6TgV8Bc_uw@mail.gmail.com>
References: <B86E1D4B-1DC8-4AD6-B8B3-E989599E0537@vpnc.org> <CAK3OfOj3MNNhjwo2bMa5CgoqynzMRVvviBXC8szxt5D17Z7FDg@mail.gmail.com> <51D3C63C.5030703@cisco.com> <51D48023.1020008@qti.qualcomm.com> <20130703201143.GL32044@mercury.ccil.org> <00cd01ce7a9f$19adeaa0$4d09bfe0$@augustcellars.com> <00d701ce7aa6$cc5fe700$651fb500$@augustcellars.com> <CAK3OfOiWrWCvNQneokyycV1Jb98M=UR-U7z0dhxUjzVdf+PwDw@mail.gmail.com> <CAHBU6itdi3B1rWv2TiOYhL1QuOVxrFKt7OTWRoG+6TgV8Bc_uw@mail.gmail.com>
Date: Sat, 06 Jul 2013 21:57:52 -0500
Message-ID: <CAK3OfOgOYA5fas0oomF5amjP1bR5F=0+uve7mFD4=FMoEV7sWg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: Jim Schaad <ietf@augustcellars.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Proposed minimal change for duplicate names in objects
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Jul 2013 02:57:59 -0000

On Sat, Jul 6, 2013 at 8:44 PM, Tim Bray <tbray@textuality.com> wrote:
> This feels like a no-brainer to me, but that’s probably because (as I’ve
> said before) I’m an API guy, and the only use for JSON objects in my world
> is to transfer a hash table or database record or whatever from here to
> there, and there, and in such a situation dupes can never be useful or
> intended and can only be a symptom of breakage (or, in the JOSE case, a
> symptom of a malicious attack on my crypto).

I agree.  As a security guy I would prefer if one way or another we
end up with no dup names, but as an "API guy" myself I think of the
streaming parsers (they offer an API after all).  Just say the magic
words: "to hell with minimal state streaming parsers" or perhaps
something to the effect that *some* component of a layered application
MUST reject objects with dup names.  It's either or.  Let's choose.

I'm happy with "some component of a layered application MUST reject
objects with duplicate names" -- I prefer this to the "no minimal
state streaming parsers" alternative.

I will assume that in general objects rarely have lots of names, so
that parsers need not keep that much state in order to check for dups.
 Requiring parsers to reject objects with dup names is my second
choice.

Nico
--