Re: [core] date-and-time and "created-on" field in constrained-voucher

Andy Bierman <andy@yumaworks.com> Mon, 27 June 2022 22:34 UTC

Return-Path: <andy@yumaworks.com>
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 DB0C9C15AE38 for <core@ietfa.amsl.com>; Mon, 27 Jun 2022 15:34:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EsDngS-dihoi for <core@ietfa.amsl.com>; Mon, 27 Jun 2022 15:34:47 -0700 (PDT)
Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CE0DEC13CD97 for <core@ietf.org>; Mon, 27 Jun 2022 15:34:47 -0700 (PDT)
Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-31bf327d4b5so10127127b3.13 for <core@ietf.org>; Mon, 27 Jun 2022 15:34:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TFgxB0FiyUzVCDt+EeuIvpTEFQ72OT4R5+HZYMeyRNs=; b=bnWeMNZjwstRAvuXRtTnhSlFwBFdKu0ekloEjCM3rT9iBe2bb/2AmUE1GZLs8ivX6z t2gjObLIxiatxTzvO1JtYStlPlcqjQfDjxk6cihpJQKsrouk+E1GFn5jrJCOo93+Qcoj ZAyGqsJGdyAr8hWin6dCyZ/SkTzU/8FDreRnE5qpovI04jHSb1XlQ9pvFQ/ATsSALe2O TQ+vvzsk9UsNoj96ltwgoOG85wTUhPNsaqzfm6LWPqCXkcqiwegXSGLw1iaTjK5ksjVT R6vezuXzwi3KHXUVRgvr9SuO7G0Clk7hEiDbOl+v3tWW/UU5JGgBlmmXrUUOHra/27Jk msHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TFgxB0FiyUzVCDt+EeuIvpTEFQ72OT4R5+HZYMeyRNs=; b=Tp50Ia8KeFcmKxUN8BPKmJaR3w0tRGn23fNoLeaD3VWKkDvCnq6e24/tLWSBUdOWBh C96CFRPJoocMjbhOxzg+D24Z6eA9qvjDyJwxKHC9UI3JFQDi5b2t9rP3K7bS0yNXCmpH l5MT7He6dAx30Hs6+kewcIidQnBlC6bOWEmQQQ8pLkf/sfA4KAgwBvb7xGVgHX52u/HM xUyGpv9sblvsmEcmdF/Hbqrbl+06R93BpYH6UkkcG1+fsB+iGsSbfpHp04hC1OXqJOnT xmXSUKBqAOEN8FMY9VLH/nRVjBGeI3XvXAqOdq0f8QALpzXFM5TZckhpmVUx30xJHcvO ocyQ==
X-Gm-Message-State: AJIora/7wGviSQVR+Nqh352vfesrXaSTzRG64dY8nTV0AUb5piH0wbQL KzaQ2GWazDP3oigR5gWQfS9x6GkFCsUcY/Ku8FczpQ==
X-Google-Smtp-Source: AGRyM1u8gcIk87CDJ+f040qzGAwXp2CTvhy6WDt1+Ss/MSpYsjF55GmPtzUwYwAeOx+rmGkBfptQ1a997IEt24+CE8c=
X-Received: by 2002:a0d:f045:0:b0:317:e6b2:2c64 with SMTP id z66-20020a0df045000000b00317e6b22c64mr17492859ywe.350.1656369286320; Mon, 27 Jun 2022 15:34:46 -0700 (PDT)
MIME-Version: 1.0
References: <DU0P190MB1978F90B0893D32291F6EE7DFDB99@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <24048.1656352364@localhost> <25937.1656365067@localhost>
In-Reply-To: <25937.1656365067@localhost>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 27 Jun 2022 15:34:35 -0700
Message-ID: <CABCOCHS6=F0tfESkVmOk1AFKvsu4tRfKu9A_Sgz5swVXv-eXCQ@mail.gmail.com>
To: Michael Richardson <mcr@sandelman.ca>
Cc: Core <core@ietf.org>, anima@ietf.org
Content-Type: multipart/alternative; boundary="000000000000edb0e005e27586e2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/Jnjfd0tD0d7QL_xqL40wbAAXYkk>
Subject: Re: [core] date-and-time and "created-on" field in constrained-voucher
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.39
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, 27 Jun 2022 22:34:51 -0000

On Mon, Jun 27, 2022 at 2:25 PM Michael Richardson <mcr@sandelman.ca> wrote:

>
> Michael Richardson <mcr+ietf@sandelman.ca> wrote:
>     > 2.  The other thing we ran into was that the CBOR implementation I'm
> using, when given a
>     > DateTime object naturally produces a RFC 8949 Section 3.4.2
> compliant "tag 1" marked Epoch-Based
>     > Date/Time.  And demarshalls this.  So I don't really notice.
>
>     > But, draft-ietf-core-yang-cbor doesn't say much about
> "yang:date-and-time".
>     > The only reference seems to be at:
>     >
> https://www.ietf.org/archive/id/draft-ietf-core-yang-cbor-20.html#name-the-container-and-other-nod
>
>     > where date-and-time is shown as part of a container object.
>     > The Content is defined to be string date pattern.
>
>     > Section 6, where I might expect to see info about encoding dates:
>     >
> https://www.ietf.org/archive/id/draft-ietf-core-yang-cbor-20.html#name-representing-yang-data-type
>
>     > is silent about date and time formats.
>     > https://github.com/core-wg/yang-cbor/issues/144
>
> lemikev wrote in the issue:
>
> l> I'm just not sure this issue is in scope for this draft.
>
> l> "draft-ietf-core-yang-cbor" define the encoding of the built-In types
> l> listed in
> l> [https://datatracker.ietf.org/doc/html/rfc7950#section-4.2.4](url), not
> l> every typedef.
>
> l> [RFC 6021] defines date-and-time as a string with a specific pattern,
> this
> l> is the way these data nodes should be encoded.
>
> l> A clean way to support Epoch-Based Date/Time is to update the
> l> ietf-yang-types YANG module to add this option.
>
> l>  typedef date-and-time {
> l>    union {
> l>      type string {
> l>        pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
> l>              + '(Z|[\+\-]\d{2}:\d{2})';
> l>      }
> l>      type unit64;
> l> }
> l>
>


This change is not backward-compatible and not allowed per RFC 7950, sec 11.
A new typedef with a different name is needed to allow the uint64 encoding.


Andy



> l> An alternate option is to use a different typedef in new IoT specific
> YANG modules.
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core
>