Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repository: maybe provide a Repository.get_delegating_role() #2552

Open
jku opened this issue Feb 4, 2024 · 2 comments
Open

repository: maybe provide a Repository.get_delegating_role() #2552

jku opened this issue Feb 4, 2024 · 2 comments

Comments

@jku
Copy link
Member

jku commented Feb 4, 2024

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 Repository implementations 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
@jku jku changed the title repository: maybe provide a Repository.get_delegate_role() repository: maybe provide a Repository.get_delegating_role() Feb 9, 2024
@jku
Copy link
Member Author

jku commented Feb 9, 2024

Oh this is going to be a nightmare if we allow "diamond" delegation structure (mutliple roles in different delegating metadata delegating to same name)

@lukpueh
Copy link
Member

lukpueh commented Feb 12, 2024

cc #660

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

No branches or pull requests

2 participants