Re: [Json] I-JSON

Anders Rundgren <anders.rundgren.net@gmail.com> Wed, 16 November 2016 06:33 UTC

Return-Path: <anders.rundgren.net@gmail.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 A90EA1294C7 for <json@ietfa.amsl.com>; Tue, 15 Nov 2016 22:33:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 dBSYfKTQHnPz for <json@ietfa.amsl.com>; Tue, 15 Nov 2016 22:33:14 -0800 (PST)
Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4CE71129498 for <json@ietf.org>; Tue, 15 Nov 2016 22:33:14 -0800 (PST)
Received: by mail-wm0-x243.google.com with SMTP id m203so7617096wma.3 for <json@ietf.org>; Tue, 15 Nov 2016 22:33:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=n1+EIpcHG1TKFipxMkSKUuuxsFXqCDi57NcXPg/C0JY=; b=Gg38QxeiZDW7Lh53U/0Dr51yWNw+OlL6HMI7kRsg1XSmAvO6O1qhbav1YWW5RUhAAX ulEcWv7N6S5lXiWLTzgb3N5V2q3at46NrRncjGhZLPH84xSHbJQS/U8yNMx/RDyxVHVi xwTOS/N8rbaqfIgSbzULv29PCR2RFkDmCaVDXqTRIOxESWqW0xNanlZUB0nJkOUiWT2O VTEHwI7CYsN9bm0nEzF2EFMpLmxTrybbU5Jq3rNZ8lupM9Wck9ps/ANfugQVES2HRP64 US58HnhfKbvuIL3dtiG6KrRhPYup0+7vbqJurOt3qZhwaEVsaipJ9P1PqvEwVqzKcHdH 1K3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=n1+EIpcHG1TKFipxMkSKUuuxsFXqCDi57NcXPg/C0JY=; b=ZvDCe1HdshYq2g3007VDewiQv1FzPQxkZAx4OlxZPy24aMRcyeZSAvis1xWERxmZE7 W2qzUR2rwKUwcXK6twN+BFXqFzhpEw1vp8wlDQbljfXcz3wZaFwrcm67/8i6dKlBdSJR MLS4lLa2w6fHSCf2VMUHtcuyvaHiKOLpDe+pfji9ZzW5FyrfuBjgSzSOceDUEEpueXg2 ouco7DVWh8IJTITOoL9L4goWuJzemZEQkXmg1/f5BxHd8JKjtmcJLYu/72OwxDGVaWYT osW29pAs64MNLAIf/d9eR9AgIv9vBnEpm5VrupP6ZHhJzjz9lvnVDojDKGZ0X6sS1amL 65YQ==
X-Gm-Message-State: ABUngvcHR8zG9asBaZGl0qXcK8vQd8b+tOGdNa/CV+7TjDMjtVMHqoVIJFdc1cNjFSiHOA==
X-Received: by 10.28.173.4 with SMTP id w4mr7183027wme.70.1479277992629; Tue, 15 Nov 2016 22:33:12 -0800 (PST)
Received: from [192.168.1.79] (124.25.176.95.rev.sfr.net. [95.176.25.124]) by smtp.googlemail.com with ESMTPSA id 6sm14087901wjt.5.2016.11.15.22.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2016 22:33:12 -0800 (PST)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: Tim Bray <tbray@textuality.com>, Ladislav Lhotka <lhotka@nic.cz>
References: <CD8E44F2-3B0F-46A4-B50E-091ED67F5553@mnot.net> <541B4A9D-97F4-4335-8B82-49682EE46D78@nic.cz> <CAHBU6iuM9Lw=rJbpoV=tvaO0zT-AYsn708nZXjAg16N6o8yfNA@mail.gmail.com>
Message-ID: <a3f13120-3a8f-57dd-482d-0cc99e96a22d@gmail.com>
Date: Wed, 16 Nov 2016 07:33:01 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <CAHBU6iuM9Lw=rJbpoV=tvaO0zT-AYsn708nZXjAg16N6o8yfNA@mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/tDZR5DnN9eZGgGpvJAip-n2X-3w>
Cc: Mark Nottingham <mnot@mnot.net>, json@ietf.org
Subject: Re: [Json] I-JSON
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Wed, 16 Nov 2016 06:33:18 -0000

On 2016-11-14 18:19, Tim Bray wrote:
> I would be very happy if some of the popular JSON tools were to implement I-JSON modes.

That's easier said than done.

In my maybe-not-so-popular JSON toolkit[1], I-JSON compatible strictness is
achieved by performing JSON syntax checking during parsing but deferring
Number conversions until the actual fetch of a value like getInt("counter").

This presumes that the argument text is preserved in order to flag "weird"
integers like 156.0 which probably isn't the most common way of doing things.


I'm not entirely convinced that the "Must-Ignore Policy" is universally applicable.
For example there are security-related JSON constructs like JOSE where you shouldn't
find any unknown properties.  In the mentioned JSON toolkit this is addressed through:

- checkForUnread() : Explicit deep check for unread properties
- scanAway("property") : Setting a property as "read" (including possible child elements)
           which typically would be applied to specific "extension" sections.

For long-lived sophisticated peer-to-peer applications, I doubt that any of these
measures suffice because unrecognized or unread properties still means that the
sender and receiver are not completely on the same page.

To cope with that I'm looking into publishing objects describing entities' state
wrt to extensions so that a sender never emits "garbage" or may even conclude
(in advance) that it cannot communicate with the intended receiver at all.
For details see "Extending Protocols" in:
https://cyberphone.github.io/doc/defensive-publications/authority-objects.pdf

Anders

1] https://cyberphone.github.io/doc/openkeystore/javaapi/org/webpki/json/package-summary.html

>
>
> On Nov 14, 2016 12:31 AM, "Ladislav Lhotka" <lhotka@nic.cz <mailto:lhotka@nic.cz>> wrote:
>
>
>     > On 14 Nov 2016, at 13:03, Mark Nottingham <mnot@mnot.net <mailto:mnot@mnot.net>> wrote:
>     >
>     > It seems like I-JSON is the answer to many of the issues that have cropped up with JSON.
>     >
>     > However, as a protocol designer, it's not terribly useful to specify I-JSON, because it's very likely that people will just use their existing JSON tools.
>
>     My understanding of I-JSON is that it specifically allows people to use their existing JSON tools. In RFC 7951 we use I-JSON and, for example, encode 64-bit integers as strings even though it is awkward and adds extra processing steps in most tools.
>
>     Lada
>
>     >
>     > A simple answer might be to define a new media type that has a header that's guaranteed to break a JSON parser prepended, but I-JSON as the body.
>     >
>     > It might be that people just strip the header and continue to process as JSON, but they have to actively do that, which may be enough of a bar to discourage it (and encourage I-JSON tools to bloom).
>     >
>     > Of course, we could define a syntax that's more deeply incompatible with JSON. Not sure if that's necessary, though.
>     >
>     > Thoughts?
>     >
>     >
>     > --
>     > Mark Nottingham   https://www.mnot.net/
>     >
>     >
>     >
>     >
>     > _______________________________________________
>     > json mailing list
>     > json@ietf.org <mailto:json@ietf.org>
>     > https://www.ietf.org/mailman/listinfo/json <https://www.ietf.org/mailman/listinfo/json>
>
>     --
>     Ladislav Lhotka, CZ.NIC Labs
>     PGP Key ID: E74E8C0C
>
>
>
>
>     _______________________________________________
>     json mailing list
>     json@ietf.org <mailto:json@ietf.org>
>     https://www.ietf.org/mailman/listinfo/json <https://www.ietf.org/mailman/listinfo/json>
>
>
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>