Skip to content

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

Closed

Description

@jku

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)

Activity

  1. added
    backlog
    on Jul 6, 2021
  2. joshuagl commented on Jul 7, 2021

    @joshuagl
    Member

    @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)

  3. added this to the Sprint 4 milestone on Jul 7, 2021
  4. removed
    backlog
    on Jul 7, 2021
  5. MVrachev commented on Jul 14, 2021

    @MVrachev
    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?

  6. jku commented on Jul 15, 2021

    @jku
    MemberAuthor
    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)

  7. modified the milestones: Sprint 4, Sprint 5 on Jul 28, 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