rust-tuf icon indicating copy to clipboard operation
rust-tuf copied to clipboard

Parameterize Tuf object to deserialize `custom` metadata field

Open heartsucker opened this issue 8 years ago • 2 comments
trafficstars

This would allow us to pass back a real structure and not be pinned to JSON.

heartsucker avatar Jun 22 '17 04:06 heartsucker

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.

heartsucker avatar Jun 25 '17 21:06 heartsucker

This is mostly implemented. TargetDescriptions now capture the target custom field. We just need to make Client::fetch_target_description public.

erickt avatar Nov 21 '19 03:11 erickt