python-tuf icon indicating copy to clipboard operation
python-tuf copied to clipboard

Delegated path pattern does not match the target path in basic_repo.py

Open rdimitrov opened this issue 2 years ago • 2 comments

Please fill in the fields below to submit an issue or feature request. The more information that is provided, the better.

Description of issue or feature request: In the basic_repo.py example when the metadata is created the target ("basic_repo.py) is used as a Targetfile with a target path set of “manual_repo/basic_repo.py”.

But then when the delegated role is created its path pattern is “*.py” which given the spec should not match to be a delegated role for that target path.

When the generated metadata files are tested with a client, one cannot fetch the target since there's no match.

References:

  • https://theupdateframework.github.io/specification/latest/#pathpattern
  • https://github.com/theupdateframework/python-tuf/blob/e7cc34a6a5ed6d5d7e3a81cec328888686f59feb/examples/manual_repo/basic_repo.py#L106
  • https://github.com/theupdateframework/python-tuf/blob/e7cc34a6a5ed6d5d7e3a81cec328888686f59feb/examples/manual_repo/basic_repo.py#L283

Current behavior:

A client cannot fetch the desired target file since there's no match.

Expected behavior:

A client should be able to fetch the desired target file.

rdimitrov avatar Feb 16 '23 11:02 rdimitrov

For myself, I fixed it by removing the folder prefix in the target path, but let me know what would work for you and I can add a fix for it 👍

rdimitrov avatar Feb 16 '23 11:02 rdimitrov

Oh there was a sort of question there in the end, sorry for missing that. Either way works for me

jku avatar Mar 20 '23 11:03 jku

Hi @jku, If this issue is available. Can i work on it?

h4l0gen avatar May 25 '24 18:05 h4l0gen

thanks, I will create PR.

h4l0gen avatar May 28 '24 18:05 h4l0gen