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

Improve API for setting metadata version of delegated roles #406

Closed
joshuagl opened this issue Sep 30, 2022 · 5 comments
Closed

Improve API for setting metadata version of delegated roles #406

joshuagl opened this issue Sep 30, 2022 · 5 comments

Comments

@joshuagl
Copy link
Member

The repo API includes functions for setting the version () of top-level metadata through:

func (r *Repo) SetTimestampVersion(v int64) error {}
func (r *Repo) SetRootVersion(v int64) error {}
func (r *Repo) SetTargetsVersion(v int64) error {}
func (r *Repo) SetSnapshotVersion(v int64) error {}
func (r *Repo) SetTimestampVersion(v int64) error {}

However, we do not yet provide any API for modifying the version of delegated targets roles. This absence of API results in go-tuf users having to implement functions which modify the version number in a file IFF that file isn't a top-level role, for example: sigstore/root-signing#417

We should provide a function to set the version number in a delegated targets role metadata, something like:

func (r *Repo) SetDelegatedTargetsVersion(metaName string, v int64) error {}
@znewman01
Copy link
Contributor

Related: #330

@asraa
Copy link
Contributor

asraa commented Sep 30, 2022

How related do you think this is to a sign command that updates the expiration and therefore the version?

That's the main use-case for this command: a metadata refresh near expiration.

@znewman01
Copy link
Contributor

I'm mostly referring to:

I think we should have separate UpdateDelegatedRole... functions for modification.

Originally posted by @ethan-lowman-dd in #330 (comment)

I think it's worth considering any proposed changes to the interface for interacting with delegations together.

@asraa
Copy link
Contributor

asraa commented Sep 30, 2022

I think we should have separate UpdateDelegatedRole... functions for modification.

I think versions & expiration are separate from properties of delegated roles: I think I wouldn't use UpdateDelegatedRole to a new version, but I might change the role prpoerties itself. Versions and expirations are properties of refreshing or updating all types of metadata, which is why I see them as different

:/ Ahhhhh how I wish there were repository API models!

@rdimitrov
Copy link
Contributor

Closing since the code base changed and this is no longer valid.

Thanks for raising this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants