Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

support consistent targets #12

Closed
jku opened this issue Sep 8, 2021 · 3 comments
Closed

support consistent targets #12

jku opened this issue Sep 8, 2021 · 3 comments

Comments

@jku
Copy link
Collaborator

jku commented Sep 8, 2021

Nothing creates the hash prefixed target files currently, but ngclient now expects them (theupdateframework/python-tuf#1501) if repository has enabled consistent_snapshot.

tufrepo currently does not handle target files in any way (they could be on another server) and I think that makes sense... but being able to create these hash prefixed symlinks would be nice. That could even be the default.

  • Maybe target-modifying commands (currently add-target) should create the symlinks for the files (in the same directory that the files are in)?
  • do symlinks work in git/github? Maybe there are other ways of implementing this?
@jku
Copy link
Collaborator Author

jku commented Sep 8, 2021

@MVrachev any interest in contributing this since you did the client side recently?

@jku
Copy link
Collaborator Author

jku commented Sep 8, 2021

  • do symlinks work in git/github? Maybe there are other ways of implementing this?

they do work:

  • git handles symlinks as one would hope (as a link, not as another file)
  • accessing the link via e.g. github raw access, the link is just a copy of the file: so it works like I'd expect

@jku
Copy link
Collaborator Author

jku commented Oct 29, 2021

I've avoided adding this feature because everytime I try it seems like a clear abstraction violation: the repository class should not deal with actual target files (apart from figuring out what they hash into).

Yet, to work in the simple demo case, add-target command needs to be able to

  • insert the target data into Metadata (this works already)
  • optionally add the target into git (if targets are managed in this repo)
  • optionally create the hash prefixed files, and add them to git

so I'm thinking of possibly moving all of git related functionality up to CLI, out of the Repo class: maybe Repo does not need to know about git and it can just give enough info about what's happening in the repository to CLI for the CLI to handle both git and the prefixed targets. This should make the abstraction cleaner (the next step after this would be removing file access from Repo as well), and move more of the ugly subprocess code to CLI

@jku jku closed this as completed Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant