Re: [netmod] leafref and identityref

Ladislav Lhotka <lhotka@nic.cz> Mon, 21 October 2019 11:58 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F3F2A12013B for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 04:58:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.998
X-Spam-Level:
X-Spam-Status: No, score=-6.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 Nbz_wFDqg2_C for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 04:58:03 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A9CE9120073 for <netmod@ietf.org>; Mon, 21 Oct 2019 04:58:03 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by mail.nic.cz (Postfix) with ESMTPSA id 72243140E40; Mon, 21 Oct 2019 13:58:01 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1571659081; bh=LFQHRLqwO7Dl8EJ5+EmQ6Zoucv5ggEUvj8mNkfn8FxE=; h=From:To:Date; b=MiiS1mPW+Fs5DAu3+YtGrN/BTx8KfVhalhHBsgyoN+AS4xkA+MJU9e+l80zA8Idvo XP05uwqhc61HBVjA5Q6d4Ttiu+YZ3I31dALZEZh0hgNYYAuj+AM7EtNoPMFc6q3SZr RA+qUGD4sV6sX53QuhLlfBfePZVGdpJZW0am0r9I=
Message-ID: <6af41ca9659453dfe9f573c6827877e70cd27a7e.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: netmod@ietf.org
Date: Mon, 21 Oct 2019 13:58:01 +0200
In-Reply-To: <20191021.134014.40553165389352172.mbj@tail-f.com>
References: <8736fmtk3d.fsf@nic.cz> <20191021.134014.40553165389352172.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/D7ASSAQdpGmGXjIdRo_PCnQmVP8>
Subject: Re: [netmod] leafref and identityref
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Oct 2019 11:58:06 -0000

On Mon, 2019-10-21 at 13:40 +0200, Martin Bjorklund wrote:
> Hi,
> 
> Ladislav Lhotka <lhotka@nic.cz>; wrote:
> > Hi,
> > 
> > consider the following situation:
> > 
> > module A {
> >   ...
> >   prefix a
> >   identity X;
> >   leaf foo {
> >     type identityref {
> >       base X;
> >     }
> >   }
> > }
> > 
> > module B {
> >   ...
> >   import A {
> >     prefix a;
> >   }
> >   leaf fooref {
> >     type leafref {
> >       path "/a:foo";
> >     }
> >   }
> > }
> > 
> > What is now a correct lexical form of fooref's value? Could it be just
> > 'X', or is the prefix required, i.e. 'a:X'?
> > 
> > This is not very clear from RFC 7950 (sections 9.9.4 and 9.10.3). I am
> > inclined to require the prefix.
> 
> 9.10.3 says:
> 
>    If the prefix is not
>    present, the namespace of the identityref is the default namespace
>    in effect on the element that contains the identityref value.
> 
> 
> so the interpretation of a missing prefix in "fooref" is that the
> identity is defined in module B.
> 
> (a missing prefix in "foo" means that the identity is defined in
> module A)

To be more specific, here is an example instance:

<foo xmlns="...namespace of A...">X</foo>
<fooref xmlns="...namespace of B...">X</fooref>

It can be argued that this is correct because (sec. 9.9.4):

   A leafref value is lexically represented the same way as the leaf it
   references represents its value.

That is, the same lexical representation is assumed, which is exactly what we
have in the example.

It seems that we agree that it is incorrect, but then sec. 9.9.4 should be
clarified.

Lada
 

-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67