rust-tuf
rust-tuf copied to clipboard
Add handling of additional fields
From the TUF spec:
All of the formats described below include the ability to add more attribute-value fields to objects for backwards-compatible format changes. Implementers who encounter undefined attribute-value pairs in the format must include the data when calculating hashes or verifying signatures and must preserve the data when re-serializing.
This adjust the primary metadata structs to include an additional_fields member that collects any unknown top-level keys. Those fields are then available to users of the library as well as present when the struct is re-serialized to JSON.