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

Add functions: add/update/delete Targets in TrustedRoot #385

Closed
wants to merge 1 commit into from

Conversation

fghanmi
Copy link

@fghanmi fghanmi commented Aug 20, 2024

Summary

The purpose of this PR is to add the required changes to add and update targets in the TrustedRoot. This will involve implementing two new functions:
add_target(&mut self, new_target: TargetType, target_name: Target) -> Result<()>
update_target(&mut self, target: TargetType, target_name: Target) -> Result<()>

These new functions improve the flexibility and usability of the TrustedRoot, making it easier to manage targets effectively.

Related issue: #384

Release Note

Feature: Add and Update Targets in TrustedRoot

Documentation

@fghanmi
Copy link
Author

fghanmi commented Aug 26, 2024

Hello @flavio, @danbev,
Could you please have a look ?
Thank you in advance!

@flavio
Copy link
Member

flavio commented Aug 30, 2024

Hi @fghanmi,
sorry for the delay, I was on vacation.

Can you provide some examples about why we would need to offer the ability to alter the contents of the TUF repository?

Currently the code cares only about downloading the official TUF repository or consuming a local checkout, then rely on that to perform different checks.

@fghanmi
Copy link
Author

fghanmi commented Aug 30, 2024

Hi @fghanmi, sorry for the delay, I was on vacation.

Can you provide some examples about why we would need to offer the ability to alter the contents of the TUF repository?

Currently the code cares only about downloading the official TUF repository or consuming a local checkout, then rely on that to perform different checks.

Hello @flavio
actually, on our side we need to be able to manipulate trust_root.json in another Rust tool: tuftool (https://github.com/awslabs/tough/tree/develop), since as of now, only sigstore-rs manages the new-style targets trust_root.json. So, it's the library where this code would fit and would be reusable by other people who have a similar usecase.
In this case, we would be able to use this crate in tough/tuftool to manipulate trust_root.json.
(a similar change was done on sigstore-go sigstore/sigstore-go#247)

@fghanmi fghanmi changed the title Add functions: Add/update Targets in TrustedRoot Add functions: add/update/delete Targets in TrustedRoot Sep 3, 2024
Signed-off-by: Firas Ghanmi <fghanmi@redhat.com>
@flavio
Copy link
Member

flavio commented Sep 17, 2024

I think changing the contents of the TUF repository is out of the scope of this library. Hence closing.

I can help with getting these changes into the tough crate upstream if you want

@flavio flavio closed this Sep 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants