Skip to content

Add TargetFile.get_prefixed_paths()#2338

Merged
lukpueh merged 4 commits intotheupdateframework:developfrom
jku:hash-prefix
Mar 29, 2023
Merged

Add TargetFile.get_prefixed_paths()#2338
lukpueh merged 4 commits intotheupdateframework:developfrom
jku:hash-prefix

Conversation

@jku
Copy link
Copy Markdown
Member

@jku jku commented Mar 20, 2023

Fixes #2166.

This is the branch from #2180, with my improvements on top. It's a simple method but the edge cases are not obvious so it makes sense for python-tuf to handle this -- if applications do, then we end up with a many slightly different implementations.

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

kamui-fin and others added 4 commits March 20, 2023 15:48
Signed-off-by: Kamui <fin-kamui@pm.me>
Signed-off-by: Kamui <fin-kamui@pm.me>
Signed-off-by: Kamui <fin-kamui@pm.me>
* Use the same solution for producing the paths as we already do in ngclient
* Fix linting issues
* Modify the test results according to new code (I believe these are
  correct, although some cases are so edge cases that disagreement may
  exist. Most importantly I think the method should always return as
  many paths as there are hashes listed

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 4469986911

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 97.692%

Totals Coverage Status
Change from base Build 4466240500: 0.01%
Covered Lines: 1320
Relevant Lines: 1343

💛 - Coveralls

Copy link
Copy Markdown
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was surprised to see that we don't put any restrictions on target paths. Other than that, LGTM!

@lukpueh lukpueh merged commit 8ae0a38 into theupdateframework:develop Mar 29, 2023
@jku jku deleted the hash-prefix branch December 30, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow generation of hash-prefixed versions of TargetFiles

4 participants