python-tuf
python-tuf copied to clipboard
Delegated path pattern does not match the target path in basic_repo.py
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.
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 👍
Oh there was a sort of question there in the end, sorry for missing that. Either way works for me
Hi @jku, If this issue is available. Can i work on it?
thanks, I will create PR.