Description of issue or feature request:
https://github.com/theupdateframework/specification/pull/40 updates the specification to remove the "root.json" entry form the "meta" dictionary in "snapshot.json".
The reference implementation needs to be adopted accordingly and comprehensively, i.e. in code, test data, docs, etc.
Current behavior:
Code, test data, docs (etc.) list root.json in snapshot.json.
Expected behavior:
Update where necessary to reflect the spec's definition of snapshot.json.
Hints:
Thanks for noting this @lukpueh
Hi!! I am new to TUF and want to contribute. For this issue, I started looking at the code base and I think, changes are required in SNAPSHOT_SCHEMA.
I was thinking of just filtering the root.json from snapshot.meta the same way as timestamp.json would have been in the existing code. So I started looking for code that generates the metadata files.
I found that snapshot metadata is constructed here and this function returns the complete metadata json(dictionary) corresponding to the given schema using the function build_dict_conforming_to_schema() (here).
But I am stuck here as I am not able to find where the function build_dict_conforming_to_schema() filters the timestamp.json for snapshot.meta
Can anyone please help me with this? Also, if my approach is incorrect, please let me know. Thanks!!
Thanks for picking up the issue, @ChamanAgrawal! :)
But I am stuck here as I am not able to find where the function build_dict_conforming_to_schema() filters the timestamp.json for snapshot.meta
Not sure I understand the question.
You have already found generate_snapshot_metadata (to me this seems like the harder part). Now you need to find the lines in that function that assemble the dictionary that will go into "meta" and remove the one line that adds the "root.json" entry.
Also, good thinking to change SNAPSHOT_SCHEMA, but if you look at it closer, it is flexible enough to accept a "meta" dictionary with or without "root.json" entry.
Root was removed from snapshot in #988