Re: [vwrap] Parsing of invalid LLSD elements in XML

David W Levine <dwl@us.ibm.com> Wed, 31 March 2010 22:14 UTC

Return-Path: <dwl@us.ibm.com>
X-Original-To: vwrap@core3.amsl.com
Delivered-To: vwrap@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 302533A6A2B; Wed, 31 Mar 2010 15:14:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.185
X-Spam-Level:
X-Spam-Status: No, score=-1.185 tagged_above=-999 required=5 tests=[AWL=-2.317, BAYES_50=0.001, DNS_FROM_OPENWHOIS=1.13, 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 zjWk4wLaccbP; Wed, 31 Mar 2010 15:14:38 -0700 (PDT)
Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) by core3.amsl.com (Postfix) with ESMTP id 5C6903A6877; Wed, 31 Mar 2010 15:14:33 -0700 (PDT)
Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e7.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o2VM651p026178; Wed, 31 Mar 2010 18:06:05 -0400
Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2VMEvcS133942; Wed, 31 Mar 2010 18:14:57 -0400
Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2VMEvbm001785; Wed, 31 Mar 2010 19:14:57 -0300
Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [9.56.227.91]) by d01av03.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o2VMEvGI001782; Wed, 31 Mar 2010 19:14:57 -0300
In-Reply-To: <q2uf72742de1003311453y212ff98ay13d6f70d77565536@mail.gmail.com>
References: <q2uf72742de1003311453y212ff98ay13d6f70d77565536@mail.gmail.com>
To: Joshua Bell <josh@lindenlab.com>
MIME-Version: 1.0
X-KeepSent: 85384387:09AA3E02-852576F7:00797FBF; type=4; name=$KeepSent
X-Mailer: Lotus Notes Release 8.0.2 HF623 January 16, 2009
Message-ID: <OF85384387.09AA3E02-ON852576F7.00797FBF-852576F7.007A36F4@us.ibm.com>
From: David W Levine <dwl@us.ibm.com>
Date: Wed, 31 Mar 2010 18:14:56 -0400
X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 8.5.1HF41 | October 22, 2009) at 03/31/2010 18:14:56, Serialize complete at 03/31/2010 18:14:56
Content-Type: multipart/alternative; boundary="=_alternative 007A36F3852576F7_="
Cc: vwrap@ietf.org, vwrap-bounces@ietf.org
Subject: Re: [vwrap] Parsing of invalid LLSD elements in XML
X-BeenThere: vwrap@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual World Region Agent Protocol - IETF working group <vwrap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/vwrap>, <mailto:vwrap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/vwrap>
List-Post: <mailto:vwrap@ietf.org>
List-Help: <mailto:vwrap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/vwrap>, <mailto:vwrap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 31 Mar 2010 22:14:42 -0000

vwrap-bounces@ietf.org wrote on 03/31/2010 05:53:25 PM:

> [image removed] 
> 
> [vwrap] Parsing of invalid LLSD elements in XML
> 
> Joshua Bell 
> 
> to:
> 
> vwrap
> 
> 03/31/2010 05:53 PM
> 
> Sent by:
> 
> vwrap-bounces@ietf.org
> 
> Mark Lentczner and I were discussing this issue earlier today 
> offline, and I wanted to recap it to the list.
> 
> draft-hamrick-vwrap-type-system-00 does not define what should 
> happen when trying to parse this LLSD XML fragment (pretend it has 
> the right prologue and hence is well-formed XML):
> 
> <llsd>
>     <map>
>         <key>test</key>
>         <uuid>this is not a uuid</uuid>
>     </map>
> </llsd>
> 
> There are at least three reasonable outcomes:
> (1) Reject the payload entirely - the entire message should be rejected
> (2) Produces a map; value associated with key "test" is a UUID of 
> 00000000-0000-0000-0000-000000000000 - which would be the result of 
> converting the string "this is not a uuid" to a UUID
> (3) Produces a map; value associated with key "test" is the Undefined 
value
> 
> (The map is, strictly speaking unnecessary, to the example, but it 
> clarifies the context in which #3 occurs)
> 
> This is not confined to UUIDs; similar issues occur with Date and 
> Binary types in the XML serialization. The JSON serialization 
> appears  "immune" to this spec ambiguity because primitive types 
> always end up as Boolean/String/Real/Undefined (in LLSD parlance); 
> conversion to Integer/UUID/Date/URI/Binary can only occur at the 
> application level. The Binary serialization appears "immune" to the 
> spec ambiguity as well (possibly edge cases if a NaN or Infinity was
> used for a Date?)
> 
> Thoughts?
> 


My fairly strong preference is for choice (3). Choice (2) allows an error 
to propagate
in ways which strikes me as highly undesirable. Choice (1) stops the error 
from propagating
but likely at the expense of generating the error detection some distance 
from a good place 
to actually handle the error. The element is invalid, the elements framing 
it (in this example,
the map) is valid, and allows the error to be stated quite explicitly. 


- David
~ Zha