Re: [netconf] AD review of draft-ietf-netconf-sztp-csr

Kent Watsen <kent+ietf@watsen.net> Fri, 02 July 2021 13:10 UTC

Return-Path: <0100017a67571569-f34e8df5-f018-4f08-ba46-5bd919b6d127-000000@amazonses.watsen.net>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EF3793A1E20; Fri, 2 Jul 2021 06:10:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.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 N6Rh0FmpsdKz; Fri, 2 Jul 2021 06:10:00 -0700 (PDT)
Received: from a48-95.smtp-out.amazonses.com (a48-95.smtp-out.amazonses.com [54.240.48.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B71303A1E22; Fri, 2 Jul 2021 06:09:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1625231398; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=hhtTiEcXHhEnUty7TKBCHuT3Gz1ffhpf4NHT53XPCeI=; b=DyUA2Y0SBtry71KzeLPEU405LwzpWVg3qbg5V1D33SoN2dahs//7knYT1uFeCaV/ kMcsYlS4BfeV1jh9jy7IDGhz4ruuienxHhEyWKsOF3aF3XvmCbF36Icyci9m6yddEtp u1ol3hhoIE+JbkTGJXxPWHgpjrNynZaYwBCy6Dkg=
From: Kent Watsen <kent+ietf@watsen.net>
Message-ID: <0100017a67571569-f34e8df5-f018-4f08-ba46-5bd919b6d127-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_7BBBE38E-F73C-4140-80A6-FCF1C972416E"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\))
Date: Fri, 2 Jul 2021 13:09:58 +0000
In-Reply-To: <c318ff6892614640b89a0eb775e9bf42@huawei.com>
Cc: "netconf@ietf.org" <netconf@ietf.org>, "draft-ietf-netconf-sztp-csr@ietf.org" <draft-ietf-netconf-sztp-csr@ietf.org>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, Qin Wu <bill.wu@huawei.com>, "Charles Eckel (eckelcu)" <eckelcu=40cisco.com@dmarc.ietf.org>
References: <c318ff6892614640b89a0eb775e9bf42@huawei.com>
X-Mailer: Apple Mail (2.3654.100.0.2.22)
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
X-SES-Outgoing: 2021.07.02-54.240.48.95
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/aSS-m2GGbl1EtMjKWtPFdPXGaW0>
Subject: Re: [netconf] AD review of draft-ietf-netconf-sztp-csr
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Jul 2021 13:10:06 -0000

Hi Qin, Charles, and Rob, thank you for your responses!

Rob, special thanks for checking with Francesca.   I did also notice that moving to 300 produced a disconnect with regards to RESTCONF’s “errors" RPC-reply message.  As you say, the draft currently returns error-tag as ""missing-attribute”, which aligns with 400 Bad Request.  

Looking at the "409 Conflict / data-missing” combination, I cannot say that it’s better.  FWIW, my understanding is that HTTP status codes ending with “00” (100, 200, 300, etc.) are the generic catch-all value for the class of codes, which have up to the next 99 values.   Thusly, I believe 400 is a more generic value than “409”, which suggests it’s the safest 4XX choice.

I fully agree there is no great choice here.  Specifically, given that the client sent a perfectly valid request, it seems wrong to say that the request was “bad”.   This is why I was thinking to define a custom code.  I understand the push-back but, to Qin’s point, why not?  Surely within the world of HTTP there is a pattern of a server prompting a client to provide more data.  That said, this is not something that I’m interested spending time on, unless Francesca offers immediate support for the proposal...

In sum, unless Francesca says otherwise, I think we should move back to the original "400 Bad Request”.  

Kent // contributor



> On Jul 1, 2021, at 10:01 PM, Qin Wu <bill.wu@huawei.com> wrote:
> 
> Hi, Rob and Charles, Kent:
> I can understand we should be cautious to introduce new HTTP status code, mapping between error code and HTTP status code seems a right direction.
> Such mapping helps refine HTTP status code semantics. Using 300 multi choice response seems confusing, since we didn’t see location head field is added.
> I also think status codes such as 421 should be considered.
>  
> -Qin
> 发件人: netconf [mailto:netconf-bounces@ietf.org <mailto:netconf-bounces@ietf.org>] 代表 Charles Eckel (eckelcu)
> 发送时间: 2021年7月2日 0:36
> 收件人: Rob Wilton (rwilton) <rwilton@cisco.com <mailto:rwilton@cisco.com>>
> 抄送: draft-ietf-netconf-sztp-csr@ietf.org <mailto:draft-ietf-netconf-sztp-csr@ietf.org>; netconf@ietf.org <mailto:netconf@ietf.org>
> 主题: Re: [netconf] AD review of draft-ietf-netconf-sztp-csr
>  
> I agree that defining a new status code is likely not a good way to go.
> A 4xx response seems better to me than a 3xx response. 
>  
> Cheers,
> Charles
>  
> 
> 
> On Jul 1, 2021, at 9:27 AM, Rob Wilton (rwilton) <rwilton@cisco.com <mailto:rwilton@cisco.com>> wrote:
>  
> Hi Charles, Kent,
>  
> Thanks for the suggestion.  The problem with that 401 requires the server to return a WWW-Authenticate header field (as per section 15.5.2, of draft-ietf-httpbis-semantics-16 <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-semantics-16#page-161>).
>  
> I’ve also asked Francesca (ART AD responsible for HTTP) if she has a view.  She has taken a quick look and suggested that defining a new code is probably not the right way to go, but said that she would take a proper look after today’s telechat, but if we want to get other opinions then we could also ask on the httpbis mailing list.
>  
> However, I also noticed that RFC 8040 maps from NETCONF error-codes to status-codes, and defines:
> +-------------------------+------------------+
> | error-tag               | status code      |
> +-------------------------+------------------+
> | missing-attribute       | 400    (which is what you had originally).
>  
> An alternative could be:
> | data-missing            | 409              |
>  
> Which NETCONF defines as:
>  
>    error-tag:      data-missing
>    error-type:     application
>    error-severity: error
>    error-info:     none
>    Description:    Request could not be completed because the relevant
>                    data model content does not exist.  For example,
>                    a "delete" operation was attempted on
>                    data that does not exist.
>  
> Which would go hand-in-hand with 409:
>  
> 15.5.10 <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-semantics-16#section-15.5.10>.  409 Conflict
>  
>    The _409 (Conflict)_ status code indicates that the request could not
>    be completed due to a conflict with the current state of the target
>    resource.  This code is used in situations where the user might be
>    able to resolve the conflict and resubmit the request.  The server
>    SHOULD generate content that includes enough information for a user
>    to recognize the source of the conflict.
>  
>    Conflicts are most likely to occur in response to a PUT request.  For
>    example, if versioning were being used and the representation being
>    PUT included changes to a resource that conflict with those made by
>    an earlier (third-party) request, the origin server might use a 409
>    response to indicate that it can't complete the request.  In this
>    case, the response representation would likely contain information
>    useful for merging the differences based on the revision history.
>  
> I don’t see any great choice here.  I now think that aligning with RESTCONF seems to be right thing to do (so not using 300).  Perhaps choose “data-missing” & 409 if you think that is slightly better, or otherwise go back to “missing-attribute” & 400.
>  
> Regards,
> Rob
>  
>  
> From: Charles Eckel (eckelcu) <eckelcu@cisco.com <mailto:eckelcu@cisco.com>> 
> Sent: 01 July 2021 15:21
> To: Kent Watsen <kent+ietf@watsen.net <mailto:kent+ietf@watsen.net>>
> Cc: Rob Wilton (rwilton) <rwilton@cisco.com <mailto:rwilton@cisco.com>>; draft-ietf-netconf-sztp-csr@ietf.org <mailto:draft-ietf-netconf-sztp-csr@ietf.org>; netconf@ietf.org <mailto:netconf@ietf.org>
> Subject: Re: [netconf] AD review of draft-ietf-netconf-sztp-csr
>  
> Hi Kent,
>  
> I have not been following this draft closely but had a thought on this thread that I thought might be helpful.
>  
> It seems to me a 401 would be more appropriate in this scenario. 
> If the server does not require a CSR, it returns a 2xx response. 
> If it does require one, it returns a 401 indicating which one it requires.
>  
> Cheers,
> Charles
> 
> 
> 
> On Jun 29, 2021, at 1:54 PM, Kent Watsen <kent+ietf@watsen.net <mailto:kent+ietf@watsen.net>> wrote:
>  
>  s/Since been/I’ve been/
>  
> K.
>  
> 
> 
> 
> On Jun 29, 2021, at 4:49 PM, Kent Watsen <kent+ietf@watsen.net <mailto:kent+ietf@watsen.net>> wrote:
>  
> Hi Rob,
>  
> Since been spinning on the below thread since we had it and am wondering if if would be best to ask for an HTTP expert review?   Please advise.
>  
> The reason being is that a close reading of "300 Multiple Choices" suggests that it’s used by an HTTP-server to indicate when there are multiple choices for a resource, whereas in this exchange, the “csr-support” node in the client’s POST effectively indicates that *it* has multiple choices for the server to choose from…
>  
> I’m beginning to wonder to the document might need to define a custom HTTP status code to properly indicate the semantics of the response…
>  
> Kent // contributor
>  
>  
> 
> 
> 
> 2. Section 2.2:
>  Assuming the SZTP-server wishes to prompt the SZTP-client to provide
>  a CSR, then it would respond with an HTTP 400 (Bad Request) error
>  code:
> 
> I wonder whether returning a 400 "Bad Request" error is really the best
> return code, i.e.,
> 
> 
> it wasn't clear to me whether this requesting the capabiltiies is really an
> error.
> 
> 
> Did you consider potentially using other return codes?  Possibly:
> 300 Multiple Choices,
> 403 Fobidden,
> 406 Not Acceptable
> 
> I did before look at all the 4xx codes.  I was initially drawn to 412
> Precondition Failed, but noted that it is specific to HTTP request header
> fields.   As for the others you mention, the semantics of 403 Forbidden is that
> the request should not be repeated, which isn’t out case, and 406 Not
> Acceptable regards the use of the HTTP “Accept” headers, which aren't in
> play here either.  That said, 300 Multiple Choices does appear to be a better
> if not perfect option, so I made that change in my local copy.
> 
> Ack.
>  
>  
> _______________________________________________
> netconf mailing list
> netconf@ietf.org <mailto:netconf@ietf.org>
> https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>
>  
> _______________________________________________
> netconf mailing list
> netconf@ietf.org <mailto:netconf@ietf.org>
> https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>