trustoverip / tswg-tsp-specification

Trust Spanning Protocol Specification
https://trustoverip.github.io/tswg-tsp-specification/
Other
3 stars 1 forks source link

`NULL` used in spec messages but never defined. #31

Open daidoji opened 5 months ago

daidoji commented 5 months ago

This occurred to me while reviewing section 7 but it seems to be problematic across the spec. The value NULL is used in many places throughout the text without definition as to its wire format specification.

Its probably clear that there many ways to serialize a NULL value (for example CESR has a single code) to anyone reviewing this issue but I think its probably also a trap for the unwary implementer.

There are two ways null seems to be used (9 times by my count) in the spec at present:

For the first case, I think it entirely reasonable to come up with a reserved placeholder (say the string VID_ANY) or change the usage to require a LIST or whatever the context requires (say a reply message should contain the VID the sender is replying to) rather than relying on some NULL placeholder to signify that the message isn't routed.

For the second case, we should explicitly require some serialization that's equivalent to NULL across all wire transports (in CESR this would be specifying the particular null that can exist in the supported JSON/MGPK/CBOR/CESR formats). Either in a list of null representations in these formats or just using say empty string/byte array where a true null is indicated.