[core] links-json: target resolution in presence of anchors / RFC8288

Christian Amsüss <c.amsuess@energyharvesting.at> Thu, 14 December 2017 11:42 UTC

Return-Path: <c.amsuess@energyharvesting.at>
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 8026B128BB6; Thu, 14 Dec 2017 03:42:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 yMoqYfjTcWHl; Thu, 14 Dec 2017 03:42:14 -0800 (PST)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [5.9.147.112]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 35B02128B90; Thu, 14 Dec 2017 03:42:13 -0800 (PST)
Received: from poseidon-mailhub.amsuess.com (095129206250.cust.akis.net [95.129.206.250]) by prometheus.amsuess.com (Postfix) with ESMTPS id 6C0A44779F; Thu, 14 Dec 2017 12:42:10 +0100 (CET)
Received: from poseidon-mailbox.amsuess.com (poseidon-mailbox.amsuess.com [10.13.13.231]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 3050139; Thu, 14 Dec 2017 12:42:08 +0100 (CET)
Received: from hephaistos.amsuess.com (hermes.amsuess.com [10.13.13.254]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id D26F539; Thu, 14 Dec 2017 12:42:07 +0100 (CET)
Received: (nullmailer pid 17482 invoked by uid 1000); Thu, 14 Dec 2017 11:42:06 -0000
Date: Thu, 14 Dec 2017 12:42:06 +0100
From: Christian Amsüss <c.amsuess@energyharvesting.at>
To: draft-ietf-core-links-json@ietf.org, core@ietf.org
Message-ID: <20171214114204.GA31455@hephaistos>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE"
Content-Disposition: inline
User-Agent: Mutt/1.9.1 (2017-09-22)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/Au9mXdPmjXtPCxp96cvnv-D1FI0>
Subject: [core] links-json: target resolution in presence of anchors / RFC8288
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: Thu, 14 Dec 2017 11:42:16 -0000

Hello links-json authors,

there is a discrepancy between the Link Format described in RFC6690 and
the Link header described in RFC8288 (formerly 5988bis). Take the
example this line obtained from a resource <http://internal-host/>:

    </b>;rel="x";anchor="http://external-host/"

If this is sent in an RFC6690 document, it means

    <http://external-host/b>;rel="x";anchor="http://external-host/"

but if it is sent in an RFC8288 header, it means

    <http://internal-host/b>;rel="x";anchor="http://external-host/"


On the formal side, this means that some statements can not be
expressed in RFC6690 link format without knowledge of where the resource
is served from. This is detrimental when describing links in an (esp.
statically configured) collection to describe members using outside
anchors.

On the practical side, this leads to implementations doing the
resolution wrong because none of the documents points out that there is
a difference.

On the social side, this results in many questions about link
resolutions, and us CoRE people teaching ways that are not applicable to
the rest of the web linking world. This point is especially relevant to
links-json given it aims to be usable in the regular web world too.


Please include a statement as to which of the interpretations is applied
to JSON and CBOR link format documents.

I strongly recommend to take up the interpretation of RFC8288. This
*does* have effects on roundtrip-ability (the meaning of
`[{href:"/b",anchor:"http://external-host"}]` is inexpressable in
RFC6690 documents, and `</b>;anchor="http://external-host/"` needs to be
converted to `[{href:"http://external-host/b",...}]` but retains the
same semantics), but I still think that it is better to have that
complexity in the converters than to carry on the mistakes[1] of the
past into the next generation of content formats.


Having a decision is also relevant to the Resource Directory draft
(where this discussion comes from) because we need to either stay that
we have to impose the same restrictions on JSON/CBOR documents as we do
on RFC6690 ones ("no relative hrefs when anchor is present"), or we can
recommend using JSON/CBOR link format because it can be used without
worries.


Best regards
Christian

[2]: My personal opinion of the origin of the discrepancy is that it was
  an honest mistake in reading 5988 back when 6690 was written
  (otherwise it would have been pointed out as a deliberate decision to
  deviate here) -- I made the same mistake myself[2] revisiting 5988.
  The newer 8288 does not allow for that interpretation any more.
[1]: https://mailarchive.ietf.org/arch/msg/core/6r-Dcl6l4ieqzI4K4p5KkQZ7HcI

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom