You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metadata API: Timestamp should provide easy access to snapshot MetaFile #1443
I don't think we should be indexing things by filenames. There is only one meaningful entry in timestamp, and that's snapshot. Can be hardcoded and doesn't need indexing.
that's in context of accessing the snapshot metafile object in timestamp with snapshot_meta = timestamp.signed.meta["snapshot.json"]. I agree and think we should have at least a helper property that allows accessing without string lookups: snapshot_meta = timestamp.signed.snapshot_meta.
In fact I might suggest going further and removing the meta dictionary from the Timestamp object and just having snapshot_meta attribute instead: yes, it moves API further from file format but it's safe and easy to understand.
I agree it makes sense to add a snapshot_meta property.
I don't think we win a ton if we remove the meta dictionary and we will further diverge from the file format.
With each smaller change between the metadata API and the specification, it will require more and more effort
from a new contributor to see the connection between the two.
After a discussion with the python-tuf maintainers, we decide that:
Snapshot meta-information will not be represented by a "meta" dictionary,
but by a MetaFile instance, and with this, it diverges from the specification.
This decision is coherent with ADR9 and the rationale behind it is to provide easier, safer,
and direct access to the snapshot meta information.
Activity
MVrachev commentedon Jun 14, 2021
I agree it makes sense to add a
snapshot_metaproperty.I don't think we win a ton if we remove the
metadictionary and we will further diverge from the file format.With each smaller change between the metadata API and the specification, it will require more and more effort
from a new contributor to see the connection between the two.
I will propose a pr for that.
MVrachev commentedon Sep 1, 2021
After a discussion with the python-tuf maintainers, we decide that: