Re: [netmod] ?==?utf-8?q? NMDA RPC/action validation

Michal Vaško <mvasko@cesnet.cz> Wed, 06 May 2020 10:00 UTC

Return-Path: <mvasko@cesnet.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 4E19C3A0890 for <netmod@ietfa.amsl.com>; Wed, 6 May 2020 03:00:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cesnet.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 eZ-xkG2sksng for <netmod@ietfa.amsl.com>; Wed, 6 May 2020 03:00:21 -0700 (PDT)
Received: from kalendar.cesnet.cz (kalendar.cesnet.cz [78.128.211.34]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E875B3A0888 for <netmod@ietf.org>; Wed, 6 May 2020 03:00:20 -0700 (PDT)
Received: by kalendar.cesnet.cz (Postfix, from userid 999) id AEFB660195; Wed, 6 May 2020 12:00:16 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=kalendar; t=1588759216; bh=SNFgBlw7PYSNiYPU+1NMU4ZZIPJ0HbrdrAPf9bPp/kA=; h=In-Reply-To:From:Date:Cc:To:Subject; b=Butnsa0N/c8YFresevQjR5c3kZW8NNdvdZycJ0f3IUfyAlYAZ8hztcIkIHyP5bGiB Lce0l+1kkBfp/e139yvvv7VkRHT7KuJG8l1m9Kr7BewUDLbP2dVWsZnjak3U5ZGImW ujxMuZBSd0kURtRykHSjjMl/eaEnd6HMneUeVHQo=
Content-Type: text/plain; charset="utf-8"
In-Reply-To: <20200506.111221.1123263348329483465.id@4668.se>
From: Michal Vaško <mvasko@cesnet.cz>
X-Forward: 84.42.161.20
Date: Wed, 06 May 2020 12:00:16 +0200
Cc: netmod@ietf.org
To: Martin Björklund <mbj+ietf@4668.se>
MIME-Version: 1.0
Message-ID: <6e4f-5eb28a80-15-e41fc90@148871447>
User-Agent: SOGoMail 2.3.23
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/D8bzIvziuGZolky6N24Vh42GE7g>
Subject: Re: [netmod] ?==?utf-8?q? NMDA RPC/action validation
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: Wed, 06 May 2020 10:00:23 -0000

Hi Martin,

right, I did not realize XPath context is also used for evaluating leafrefs or instance-identifiers and not just must or when. Okay, so my understanding is correct, thanks.

Regards,
Michal

On Wednesday, May 6, 2020 11:12 CEST, Martin Björklund <mbj+ietf@4668.se> wrote: 
 
> Michal Vaško <mvasko@cesnet.cz> wrote:
> > Hi,
> > when we were implementing support for NMDA, we came across the section
> > about actions and RPCs [1]. What I understood from it is that,
> > effectively, all RPCs and actions are validated against the data in
> > the operational datastore. So, for example, instance-identifiers and
> > leafref targets in the RPC/action are searched for in the operational> datastore.
> 
> This is correct, but it is specified in section 6.1.
> 
> (Note that it applies to instance-identifiers and leafrefs defined as
> rpc or action input parameters; not the contents of e.g. edit-config).
> 
> 
> > But I realized just now that I may have interpreted this
> > short section in a wrong way and read between the lines.
> > > Because while the section is named "Invocation of Actions and RPCs",
> > no changes for RPCs are explicitly mentioned, I just assumed it does
> > not really make sense for them to behave differently. Also, I
> > basically interpreted "invocation" as validation because I am not sure
> > how else to understand it. It would be best if these terms could be
> > clarified but I am not sure it is possible since new errata is
> > probably not the right way.
> 
> Note that 6.2 says that it updates 7.15 of RFC 7950, which talks about
> action invocation.  And also note that _validation_ is handled in 6.1.
> 
> The text in 6.2 says that if a server gets this action (from 7.15.3 in
> RFC 7950):
> 
>      <rpc message-id="101"
>           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>        <action xmlns="urn:ietf:params:xml:ns:yang:1">
>          <server xmlns="urn:example:server-farm">
>            <name>apache-1</name>
>            <reset>
>              <reset-at>2014-07-29T13:42:00Z</reset-at>
>            </reset>
>          </server>
>        </action>
>      </rpc>
> 
> then the "server" with "name" "apache-1" must exist in the operational
> state datastore.
> 
> 
> 
> /martin
> 
> 
> 
> > > Thanks for clarifying this.
> > > Regards,
> > Michal
> > > [1] https://tools.ietf.org/html/rfc8342#section-6.2
> > > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod