rust-tuf
rust-tuf copied to clipboard
Parameterize Tuf object to deserialize `custom` metadata field
This would allow us to pass back a real structure and not be pinned to JSON.
This can't be parameterized in a nice way that doesn't wreak havoc with serde (or so it seems). The TargetDescription struct can just store it as raw bytes because the DataInterchange trait allows it to be serde'd to/from a) DataInterchange::RawData and b) bytes. This is good enough and someone external using the crate would be able to extract the bytes and do what they need with them.
Eventually someone might come up with something more clever than the couple of things I tried, but this is good enough for now.
This is mostly implemented. TargetDescriptions now capture the target custom field. We just need to make Client::fetch_target_description public.