Re: [Json-canon] JSON Subtype handling. Re: Review of draft-rundgren-json-canonicalization-scheme-03

Anders Rundgren <anders.rundgren.net@gmail.com> Sat, 09 February 2019 06:10 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json-canon@ietfa.amsl.com
Delivered-To: json-canon@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6ECDA128AFB; Fri, 8 Feb 2019 22:10:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=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 fEwx2I8riM80; Fri, 8 Feb 2019 22:10:27 -0800 (PST)
Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 CDD2C124C04; Fri, 8 Feb 2019 22:10:26 -0800 (PST)
Received: by mail-wm1-x32b.google.com with SMTP id f16so6928818wmh.4; Fri, 08 Feb 2019 22:10:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tUvz9YW9TYdUaSA3NyfNdP1etr3pq0FRBm4SXG9+N3k=; b=UX17UccTr7gsNtsqxgX9p6ggVlkJVWQmxj50uN3Dw5EJ5gcJaY4i2LXP7jctrg5Fsu 6N7Qd5ScCa6G4MlVfxSfu9aCGyGsUug5jXjU2r95egfRHFg9LhrJOz963Et1Awygb5M1 uSHsmV/SupTzjTy5X17+kFbzHSIl89s9jQCBWbZ9U43D+5wecc458qPx+1qgPJzqkpVS 5+BH9O/PwtGe1jUpl38lC8GNXlX1oROn5c+zDvgH8l+r1YDbJiK0IOMPmubpZEEjH1lF jXxfMxUbqsss4IU+tCOJerKql03IqKjDYlDHoGEkIzhy1ftnCnmMJyxhdZVc5M45wKGl VqFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tUvz9YW9TYdUaSA3NyfNdP1etr3pq0FRBm4SXG9+N3k=; b=d+gUlhJIptt+r2lIjRs9m3SnTuSl5KezgYpydGdUeYC2FfpHFIKfL5368S3UpFVQbG a26AEH7yXUefWNUrzr84Qj/9H+nISPiyKRSFHhukypJ/mDxgpNhi4UPqKjoR1I26kPPr lrKDY1D23hRKGqjuKOnbJU+fNa7TXUCDfAu9Z4O+3dzYaG9EuGdzD/VwC///HKiuL4zH 0Gy03ctspGujjkD0jQslkmjL+TU+AFmB1l7trYgK4BXUyaWg8SK7uHiLGpAIcCPPiJ0D i5zJMX3bI6ke2BbGNq7krB2zEGRIc3xMzJTgYumA+dEUyH/enQWUKwa95yQY8sMScrgj Ml0g==
X-Gm-Message-State: AHQUAuZgubhMTY1xWzXU4Xn7AlZ0dllfiQ6XLi8xxXjlmpnfjaIk/+Ui rK6DvM1ykUf/1s44mG3FeqhjiRbP
X-Google-Smtp-Source: AHgI3IYx+ens4wpMMNBVAOlYsQjuVWVx+jkJRq11Jeo1J8aUzf11UTOTARceNh9b31sLVrzSXbFkIA==
X-Received: by 2002:a5d:6b8b:: with SMTP id n11mr18924871wrx.216.1549692624766; Fri, 08 Feb 2019 22:10:24 -0800 (PST)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id m21sm6007462wmi.43.2019.02.08.22.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 22:10:23 -0800 (PST)
To: Jim Schaad <ietf@augustcellars.com>
Cc: draft-rundgren-json-canonicalization-scheme@ietf.org, 'Mark Nottingham' <mnot@mnot.net>, 'Samuel Erdtman' <samuel@erdtman.se>, 'Bret Jordan' <jordan.ietf@gmail.com>, json-canon@ietf.org
References: <00dc01d4b51c$618cdbc0$24a69340$@augustcellars.com> <f4b64343-e8db-57cf-152e-aeba44dc4863@gmail.com> <060401d4c035$d35d3e10$7a17ba30$@augustcellars.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <b9c8312d-88f0-04f7-c019-e2a62fa3aea5@gmail.com>
Date: Sat, 09 Feb 2019 07:10:20 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0
MIME-Version: 1.0
In-Reply-To: <060401d4c035$d35d3e10$7a17ba30$@augustcellars.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json-canon/nxWM2M-_CDF_ozuuO1u5QSa01Ro>
Subject: Re: [Json-canon] JSON Subtype handling. Re: Review of draft-rundgren-json-canonicalization-scheme-03
X-BeenThere: json-canon@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: JSON Canonicalization <json-canon.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json-canon>, <mailto:json-canon-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json-canon/>
List-Post: <mailto:json-canon@ietf.org>
List-Help: <mailto:json-canon-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json-canon>, <mailto:json-canon-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Feb 2019 06:10:29 -0000

On 2019-02-09 06:10, Jim Schaad wrote:
> Anders,
> 
> Two items.  First note that I changed the address of the IETF mailing list as the "-request" should be omitted.  This sends mail to the administrator not to the list.

Sorry, it was just a carbon copy of the original list of recipients..

> Second.  I like the text that you have placed in Appendix E as it seems to do a good job of both describing the problem and providing a solution.

Thanx!

> The problem is that it provides two different solutions and the reference from section 3.1 does not state which of the two methods to use.  I think you probably want to state - "Use Appendix E.2 for creation of new items, but use Appendix E.1 when parsing and checking an existing JSON serialization."

I believe this rather highlights a somewhat less clear part of the 04 draft: The distinction between "Hashable" and "Comparable" JSON.

Only "Comparable" JSON actually requires Appendix E.2 measures to function while "Hashable" JSON works with both.

These are effectively forming two levels of canonicalization:
- Hashable: JSON native level canonicalization only
- Comparable: Full canonicalization including custom data types

Anders

> 
> Jim
> 
> 
>> -----Original Message-----
>> From: Anders Rundgren <anders.rundgren.net@gmail.com>
>> Sent: Friday, February 8, 2019 8:54 PM
>> To: Jim Schaad <ietf@augustcellars.com>
>> Cc: draft-rundgren-json-canonicalization-scheme@ietf.org; json-canon-
>> request@ietf.org; Mark Nottingham <mnot@mnot.net>; Samuel Erdtman
>> <samuel@erdtman.se>; Bret Jordan <jordan.ietf@gmail.com>
>> Subject: JSON Subtype handling. Re: Review of draft-rundgren-json-
>> canonicalization-scheme-03
>>
>> On 2019-01-26 03:10, Jim Schaad wrote:
>>> Here are a set of comments on the current version of the draft.
>>
>> Thank you very much for these insightful comments!
>>
>> Since the comments were many I take the liberty splitting the responses in
>> separate threads.
>>
>> Handling of subtypes in JSON strings was clearly missing in the 03 draft.
>> The 04 draft adds the following to section 3.1 "Creation of Input Data":
>>
>>       Note: parsed String data MUST NOT be altered during subsequent
>>       serializations.  For more information see Appendix E
>>
>> The added Appendix E (https://tools.ietf.org/html/draft-rundgren-json-
>> canonicalization-scheme-04#appendix-E)
>> contains a pretty extensive description of how this must be dealt with.
>>
>> A side-effect of this is that the updated draft now makes a distinction
>> between "Hashable" JSON and "true" canonicalization ("Comparable" JSON).
>> The latter is a more demanding deployment option.
>>
>> Cheers,
>> Anders
>