Skip to content

refactor RepositorySimulator to sign explicitly #155

@jku

Description

@jku

copying from in #130 (comment)

We probably should modify RepositorySimulator so that it signs metadata explicitly (and not magically at request time as it now does)

Potential design:

  • keep mds dictionary for storing the "current metadata working set"
  • remove signed_roots, add signed_mds: dict[str, list[bytes]] where key is rolename
  • remove publish_root() and bump_root_by_one(), add something like publish(role: str, bump_version: bool = True) that bumps version if requested, makes a copy of roles current metadata from mds, signs it, adds bytes to signed_mds
  • fetch_metadata() now looks up data only from signed_mds (and can return old versions)
  • There's plenty of potential test changes, every test needs to be reviewed:
    • any test that modifies any targets role likely needs to publish(role) at least once
    • same for any tests that modify timestamp or snapshot without calling update_*() afterwards
    • old metadata versions are now available from repository (this is more realistic so sounds good)
    • anything else?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions