Re: [core] Links, hosts, and resource directories

Klaus Hartke <hartke@projectcool.de> Mon, 05 November 2018 14:03 UTC

Return-Path: <hartke@projectcool.de>
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 D6D83128CFD for <core@ietfa.amsl.com>; Mon, 5 Nov 2018 06:03:47 -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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_FAIL=0.001] autolearn=no 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 dhlMzpaP8EKm for <core@ietfa.amsl.com>; Mon, 5 Nov 2018 06:03:45 -0800 (PST)
Received: from wp382.webpack.hosteurope.de (wp382.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8597::]) (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 5173212426A for <core@ietf.org>; Mon, 5 Nov 2018 06:03:45 -0800 (PST)
Received: from mail-qk1-f172.google.com ([209.85.222.172]); authenticated by wp382.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1gJfTh-00054V-VC; Mon, 05 Nov 2018 15:03:42 +0100
Received: by mail-qk1-f172.google.com with SMTP id q1so14708515qkf.13 for <core@ietf.org>; Mon, 05 Nov 2018 06:03:41 -0800 (PST)
X-Gm-Message-State: AGRZ1gJYqNV70NF08yML1x0gcOqM/0Grs7UDLXkRHMX6Ref0y5Ca+zl/ jlrMHqCp8rff7KBYUq4T9oDda2gRdP6PMvy73xo=
X-Google-Smtp-Source: AJdET5fvsqxysF5DWuHlZttQ/3l0cdf/MOuob9ld/+a5YYjcLRvujwEEamO50TvFcwMOuTFFjkWU8xL3E4QRYedulcM=
X-Received: by 2002:a0c:8003:: with SMTP id 3mr21917257qva.129.1541426620994; Mon, 05 Nov 2018 06:03:40 -0800 (PST)
MIME-Version: 1.0
References: <CAAzbHvZP-XfjFSn0p++9ECY8LAFaVaBrYhmnyNKW1SQOnR6cOw@mail.gmail.com> <20181031065938.GA6605@hephaistos.amsuess.com>
In-Reply-To: <20181031065938.GA6605@hephaistos.amsuess.com>
From: Klaus Hartke <hartke@projectcool.de>
Date: Mon, 05 Nov 2018 15:03:09 +0100
X-Gmail-Original-Message-ID: <CAAzbHvZW0UPE+=DKkgvg-w1C=WkBwgDT-CFa3-TmyfKu9arhwA@mail.gmail.com>
Message-ID: <CAAzbHvZW0UPE+=DKkgvg-w1C=WkBwgDT-CFa3-TmyfKu9arhwA@mail.gmail.com>
To: "Christian M. Amsüss" <christian@amsuess.com>
Cc: "core@ietf.org WG" <core@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-bounce-key: webpack.hosteurope.de; hartke@projectcool.de; 1541426625; fade1371;
X-HE-SMSGID: 1gJfTh-00054V-VC
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/6h5lUEta0lX1H2Ryfl6qxkE5hD8>
Subject: Re: [core] Links, hosts, and resource directories
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 05 Nov 2018 14:03:48 -0000

Christian Amsüss wrote:
> >     <coap://example.com/foo>;rt=a,<coap://example.com/bar>;rt=b,<coap://example.com/baz>;rt=a
> >
> > This means, there are three links [6]:
> >
> >    <coap://example.com/.well-known/core>  hosts
> >           <coap://example.com/foo>  which has type "a" .
>
> Actually it is `<coap://example.com> hosts ...` due to the wording of
> RFC6690 Section 2.1 b).

Good point! For some reason, I was convinced that only the "hosts"
relation type would do weird things to the link context. I missed that
RFC 6690 defines the anchor for *all* links without an anchor
attribute to be the root resource of the origin.

So, for example, the links in this Link Format representation of
<coap://example.org/.well-known/core>...

    <foo>;rel=hosts,<bar>;rel=icon

...are resolved to...

    <coap://example.org/> hosts <coap://example.org/foo> .
    <coap://example.org/> icon <coap://example.org/bar> .

...which, to me, have the following meaning:

    (coap, example.org, 5683) has a resource <coap://example.org/foo> .
    The shortcut icon for <coap://example.org/> - but not immediately
        any other resource hosted by (coap, example.org, 5683) - is
        <coap://example.org/bar> .

RFC 6690 is really interesting.

> I'm not sure that this interpretation of 'hosts' necessarily follows
> from the definition ("hosted by the server indicated by the link
> context").

Isn't that exactly what "hosted by the server indicated by the link
context" means? See also the text in
<https://tools.ietf.org/html/rfc6690#section-5>:

    Thus,
    the links in this example tell that the Origin server from which
    /.well-known/core was requested (the context) hosts the resources
    /sensors/temp and /sensors/light (each a target).

It's probably not worth discussing the exact semantics, though, as
those have little relevance in practice.

Klaus