openconfig / public

Repository for publishing OpenConfig models, documentation, and other material for the community.
Apache License 2.0
894 stars 654 forks source link

openconfig-keychain : keychains/keychain/config/tolerance type can be a signed int32 instead of union. #652

Closed m26singhvi closed 2 years ago

m26singhvi commented 2 years ago

Currently, in openconfig-keychain, tolerance leaf at path keychains/keychain/config/tolerance is of type union as follows :

 type union {
        type enumeration {
          enum FOREVER {
            description
              "Receive key does not expire (equivalent to infinite tolerance).";
          }
        }
        type uint32;
      }

This enum is to signify infinite tolerance. How about if we make this type as int32 or may be int64 and use negative values to signify the the infinite lifetime. This will make the type handling simpler.

robshakir commented 2 years ago

We have had poor experiences with such "magic" ways of representing special cases. I believe that this modelling is significantly clearer to the reader as to what is being achieved with FOREVER (having a negative means we have to wonder whether -1 means something different to -2 for example).

r.

m26singhvi commented 2 years ago

Thank you for the clarification.

robshakir commented 2 years ago

No problem! Closing this issue, please re-open it if there are further questions.