You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ngclient: support HASH.FILENAME.EXT for downloading targets #1479
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)
@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)
Activity
joshuagl commentedon Jul 7, 2021
@jku suggested that whether or not to hash prefix could be a
ngclient.configoption for the whole updater (rather than passing a boolean to each method call, as is done in the current client)MVrachev commentedon Jul 14, 2021
From my understanding, in order to implement this feature, we would want to:
HASH.FILENAME.EXTto the repositoryHASH.FILENAME.EXTngclient.configwith True by defaultAm I right about the steps or there is something else?
jku commentedon Jul 15, 2021
This bug is about ngclient so that won't be necessary.
If consistent_snapshot is true and if the new config option says so, yes.
Default should be to hash prefix target filenames (if consistent_snapshot==True)