python-tuf
python-tuf copied to clipboard
repository: maybe provide a Repository.get_delegating_role()
I wonder if Repository.get_delegating_role(role: str) -> str would be useful
- In my implementations I end up looking up the delegating role of a role quite a lot.
- if this existed, Repository could also offer QOL things like
Repository.get_verification_result(role, md)
The reason this does not exist is that we can't really provide a fully generic implementation: Repository does not maintain a delegation tree. So we could
- Require all
Repositoryimplementations to provide the method OR - Provide a default implementation that assumes max one level of targets delegations (and require more complex implementations to provide their own) OR
- Provide a default implementation that adds a delegation tree into
Repository
Oh this is going to be a nightmare if we allow "diamond" delegation structure (mutliple roles in different delegating metadata delegating to same name)
cc #660