[core] Web Link Attribute parsing problems

Jim Schaad <ietf@augustcellars.com> Sat, 08 July 2017 02:08 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C1C3131559 for <core@ietfa.amsl.com>; Fri, 7 Jul 2017 19:08:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.002
X-Spam-Level:
X-Spam-Status: No, score=-2.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-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=augustcellars.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 ivd6vV1kC4RO for <core@ietfa.amsl.com>; Fri, 7 Jul 2017 19:08:30 -0700 (PDT)
Received: from mail4.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 807EE13154E for <core@ietf.org>; Fri, 7 Jul 2017 19:08:30 -0700 (PDT)
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Language: en-us
DKIM-Signature: v=1; a=rsa-sha256; d=augustcellars.com; s=winery; c=simple/simple; t=1499479695; h=from:subject:to:date:message-id; bh=qdDxqYZjCd31sK/2G5mXamgS9buIFT/uKNTViiKsE3U=; b=SBFTL4lBkYKWtFp+MUCvTPLqIIPc6U3AZvCBHlnXIOXV1xKW82Rbx+Sm0HhQiER8Z13ZbVK/qUP VBhQKUCTAJf72uDvKssK/amXYyX09ASMrwxg3nTW2r+dNZvEWOlbsyH/sOQNPxeDkBcoHZU8CRxxU oZAp/kqtZFVNDxT3JgpsLQC6r0Qd7xt1y4WxU/QztlFQ6wFPYhl33yiJcp2H5hHSuDuRNN7Erruym xSNjF/BabKPzcLb0ehYO04nCWI8bkAwvM3l/8CtxJllrLgN432WJJ0hjTK74JR6YpJy4gGAqIfX+Q HuX5SCIXwOUHYAT98H7ZOFmUW+A5guuyifWQ==
Received: from mail2.augustcellars.com (192.168.1.201) by mail4.augustcellars.com (192.168.1.153) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 7 Jul 2017 19:08:15 -0700
Received: from Hebrews (24.21.96.37) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 7 Jul 2017 19:08:15 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: core@ietf.org
Date: Fri, 07 Jul 2017 19:08:21 -0700
Message-ID: <02b301d2f78f$14aad650$3e0082f0$@augustcellars.com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdL3fat3MQkflgWmTNOu0xyqxwm5jA==
X-Originating-IP: [24.21.96.37]
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/G5tPlQIBoKSDSel3EJR1JY_1koA>
Subject: [core] Web Link Attribute parsing problems
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Jul 2017 02:08:32 -0000

I have been going through my code base looking to get
draft-ietf-core-links-json implemented as well as making sure that my
implementation of RFC 6690 (CoRE Link Format).  At this point in time, I
cannot see anyway to future proof my implementation of this code because of
how RFC 6690 decided to address a compression optimization.

My code currently does not do a good job of deciding which attributes are to
be split when they are space separated (i.e. 'rt') and which should be kept
as a single string (i.e. 'title').  I can easily get a list of the things
that should be treated in which direction right now, however going forward
into the future that will not be the case.  When the code sees a new link,
it will not know what the correct processing is in the event that a space
occurs in the value field.  

As an example of what I am looking at.  I get a new WebLink with the
attribute of 

<googoo>ct=0;bletch="foo bar"

I then get a discovery query

get  /.well-known/core?bletch="foo" 

is "googoo" supposed to be a match or not?  If it is a single string, ala
'title', then it is not a match.  If it is space separated attibutes, ala
'rt', then it is a match.

Is there a recommended way to proceed?

Jim