Skip to content

Metadata API: Timestamp should provide easy access to snapshot MetaFile #1443

Closed

Description

@jku

Quoth @trishankatdatadog

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.

Activity

  1. MVrachev commented on Jun 14, 2021

    @MVrachev
    Collaborator

    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.

    I will propose a pr for that.

  2. added
    backlog
    on Jun 14, 2021
  3. added this to the Sprint 4 milestone on Jul 7, 2021
  4. removed
    backlog
    on Jul 7, 2021
  5. modified the milestones: Sprint 4, Sprint 5 on Jul 28, 2021
  6. modified the milestones: Sprint 5, Sprint 7 on Sep 1, 2021
  7. MVrachev commented on Sep 1, 2021

    @MVrachev
    Collaborator

    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.
    
  8. modified the milestones: Sprint 7, Sprint 8 on Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions