Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngclient: support HASH.FILENAME.EXT for downloading targets #1479

Closed
jku opened this issue Jul 5, 2021 · 3 comments · Fixed by #1501
Closed

ngclient: support HASH.FILENAME.EXT for downloading targets #1479

jku opened this issue Jul 5, 2021 · 3 comments · Fixed by #1501

Comments

@jku
Copy link
Member

jku commented Jul 5, 2021

Specification:

If consistent snapshots are not used (see § 6.2 Consistent snapshots), then the filename used to download the target file is of the fixed form FILENAME.EXT (e.g., foobar.tar.gz). Otherwise, the filename is of the form HASH.FILENAME.EXT (e.g., c14aeb4ac9f4a8fc0d83d12482b9197452f6adf3eb710e3b1e2b79e8d14cb681.foobar.tar.gz), where HASH is one of the hashes of the targets file listed in the targets metadata file found earlier in step § 5.6 Update the targets role. In either case, the client MUST write the file to non-volatile storage as FILENAME.EXT.

ngclient currently does not insert the hash when consistent_snapshot is true, but it should.

Additionally we should offer a way to not do hash prefixing (the use case is warehouse where urls are already unique and include a hash)

@joshuagl joshuagl added ngclient specification-conformance backlog Issues to address with priority for current development goals labels Jul 6, 2021
@joshuagl
Copy link
Member

joshuagl commented Jul 7, 2021

@jku suggested that whether or not to hash prefix could be a ngclient.config option for the whole updater (rather than passing a boolean to each method call, as is done in the current client)

@joshuagl joshuagl added this to the Sprint 4 milestone Jul 7, 2021
@joshuagl joshuagl removed the backlog Issues to address with priority for current development goals label Jul 7, 2021
@MVrachev
Copy link
Collaborator

From my understanding, in order to implement this feature, we would want to:

  1. enable writing files with filenames HASH.FILENAME.EXT to the repository
  2. enable downloading filenames with names HASH.FILENAME.EXT
  3. add an option in the ngclient.config with True by default

Am I right about the steps or there is something else?

@jku
Copy link
Member Author

jku commented Jul 15, 2021

  1. enable writing files with filenames HASH.FILENAME.EXT to the repository

This bug is about ngclient so that won't be necessary.

  1. enable downloading filenames with names HASH.FILENAME.EXT

If consistent_snapshot is true and if the new config option says so, yes.

  1. add an option in the ngclient.config with True by default

Default should be to hash prefix target filenames (if consistent_snapshot==True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants