Re: [ogpx] type-system : binary elements in JSON serializations

Joshua Bell <josh@lindenlab.com> Tue, 30 March 2010 17:22 UTC

Return-Path: <josh@lindenlab.com>
X-Original-To: ogpx@core3.amsl.com
Delivered-To: ogpx@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id C64D43A6980 for <ogpx@core3.amsl.com>; Tue, 30 Mar 2010 10:22:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.083
X-Spam-Level:
X-Spam-Status: No, score=0.083 tagged_above=-999 required=5 tests=[AWL=0.929, BAYES_00=-2.599, DNS_FROM_OPENWHOIS=1.13, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yc38ABjRn6hw for <ogpx@core3.amsl.com>; Tue, 30 Mar 2010 10:22:40 -0700 (PDT)
Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by core3.amsl.com (Postfix) with ESMTP id D8B303A6A79 for <ogpx@ietf.org>; Tue, 30 Mar 2010 10:22:31 -0700 (PDT)
Received: by ewy24 with SMTP id 24so1560925ewy.13 for <ogpx@ietf.org>; Tue, 30 Mar 2010 10:22:56 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.91.8 with HTTP; Tue, 30 Mar 2010 10:22:54 -0700 (PDT)
In-Reply-To: <b325928b1003291313h6204c04bs5bf55a03447e9844@mail.gmail.com>
References: <b325928b1003281033p28c92367x2be877cc348268da@mail.gmail.com> <62BFE5680C037E4DA0B0A08946C0933DCB5FB69D@rrsmsx506.amr.corp.intel.com> <OF525A1644.1F7FE877-ON852576F5.00641451-852576F5.00641932@us.ibm.com> <b325928b1003291124i47c4ca3bpa55724f57d4ad7d8@mail.gmail.com> <62BFE5680C037E4DA0B0A08946C0933DCB5FB75C@rrsmsx506.amr.corp.intel.com> <b325928b1003291313h6204c04bs5bf55a03447e9844@mail.gmail.com>
Date: Tue, 30 Mar 2010 10:22:54 -0700
Received: by 10.216.177.82 with SMTP id c60mr227045wem.25.1269969774964; Tue, 30 Mar 2010 10:22:54 -0700 (PDT)
Message-ID: <f72742de1003301022u971914fl75d8c0a56c7b1b3f@mail.gmail.com>
From: Joshua Bell <josh@lindenlab.com>
To: ogpx <ogpx@ietf.org>
Content-Type: multipart/alternative; boundary="001636833a444ff01b048307e110"
Subject: Re: [ogpx] type-system : binary elements in JSON serializations
X-BeenThere: ogpx@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual World Region Agent Protocol - IETF working group <ogpx.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ogpx>
List-Post: <mailto:ogpx@ietf.org>
List-Help: <mailto:ogpx-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Mar 2010 17:22:41 -0000

in 4.2. (JSON Serialization) draft-hamrick-vwrap-type-system-00 calls out:

Binary  LLSD 'Binary' values are represented as a JSON 'JSONArray'.
       That is, they follow the ECMA-262 [ECMA262r5] 'JSONArray' non-
       terminal whose members are integer numbers representing each
       octet of the binary array.

This thread seems predicated on conversion between Binary and String as a
convenience for both JSON and XML serialization. However, the current JSON
serialization of Binary is an array of octets, and there are no conversions
defined for arrays.

I believe an unstated implication of this thread (and F2F discussion) is
that we should change the JSON serialization of Binary from octet array to
base64 string. Otherwise, after a memory->JSON->memory round-trip, the
base64->string conversion isn't very useful.

(My apologies if it was stated but I missed it.)

On Mon, Mar 29, 2010 at 1:13 PM, Meadhbh Hamrick <ohmeadhbh@gmail.com>wrote:

> okay. so we could say that a valid BASE64 encoding would be converted
> into a string of octets, but an invalid BASE64 encoding would return
> the default binary.
>
>
> --
> meadhbh hamrick * it's pronounced "maeve"
> @OhMeadhbh * http://meadhbh.org/ * OhMeadhbh@gmail.com
>
>
>
> On Mon, Mar 29, 2010 at 12:19 PM, Hurliman, John
> <john.hurliman@intel.com> wrote:
> > I think the conversion should go both ways assuming the string is base64.
> A string of "hello world" would produce zero binary octets, but
> "aGVsbG8gd29ybGQ=" would produce 11 binary octets.
> >
> > John
> >
> >> -----Original Message-----
> >> From: Meadhbh Hamrick [mailto:ohmeadhbh@gmail.com]
> >> Sent: Monday, March 29, 2010 11:24 AM
> >> To: David W Levine
> >> Cc: Hurliman, John; ogpx; ogpx-bounces@ietf.org
> >> Subject: Re: [ogpx] type-system : binary elements in JSON
> >> serializations
> >>
> >> coolies. i'll implement it and open a trac ticket for it.
> >>
> >> also... do we want to have a string to binary conversion?
> >> --
> >> meadhbh hamrick * it's pronounced "maeve"
> >> @OhMeadhbh * http://meadhbh.org/ * OhMeadhbh@gmail.com
> >>
> >>
> >>
> >> On Mon, Mar 29, 2010 at 11:13 AM, David W Levine <dwl@us.ibm.com>
> >> wrote:
> >> >
> >> >
> >> > ogpx-bounces@ietf.org wrote on 03/29/2010 02:05:48 PM:
> >> >
> >> >> [image removed]
> >> >>
> >> >> Re: [ogpx] type-system : binary elements in JSON serializations
> >> >>
> >> >> Hurliman, John
> >> >>
> >> >> to:
> >> >>
> >> >> Meadhbh Hamrick, ogpx
> >> >>
> >> >> 03/29/2010 02:06 PM
> >> >>
> >> >> Sent by:
> >> >>
> >> >> ogpx-bounces@ietf.org
> >> >>
> >> >> I think supporting conversion to and from string and binary at the
> >> >> LLSD level is a good idea, and I don't see any downsides to this
> >> approach.
> >> >>
> >> >> John
> >> >>
> >> > +1
> >> >
> >
> _______________________________________________
> ogpx mailing list (VWRAP working group)
> ogpx@ietf.org
> https://www.ietf.org/mailman/listinfo/ogpx
>