cbor-ruby icon indicating copy to clipboard operation
cbor-ruby copied to clipboard

RFC8949 obsoletes RFC7049

Open hellekin opened this issue 5 years ago • 1 comments

Hi,

https://datatracker.ietf.org/doc/rfc8949/ was released this month, updating RFC7049.

Is there a summary of the work required to update this code to match the new RFC?

hellekin avatar Dec 19 '20 18:12 hellekin

I don't think there is any such work "required", cbor-ruby should work out of the box for RFC 8949. Please have a look at Appendix G of RFC 8949 for some details on what changed in the 2020 Edition of this spec. There are a few things that probably should be addressed:

  • cbor-ruby does not itself provide RFC 7049 canonical encoding, which has been supplemented by "deterministic encoding" in RFC 8949. I plan to make a variant of the cbor-canonical gem available to cover this base.
  • The API for cbor-ruby has been inherited from msgpack, so it makes some modern CBOR things harder than they'd have to be (e.g., RFC 8742 sequences). We should think about adding appropriate API, or possibly document how to use the msgpack-style API for this.
  • RFC 8949 has some documentation requirements that we probably should address.

One underlying problem of Ruby Hashes is that there is no simple operation to add a key unless the key already existed. That makes it hard (really: expensive) to implement the now preferred variant of map key validity checking.

cabo avatar Dec 19 '20 23:12 cabo