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

tough: support the loading of an expired repo in unsafe mode #121

Merged
merged 1 commit into from
May 18, 2020

Conversation

webern
Copy link
Contributor

@webern webern commented May 14, 2020

Issue #, if available:

Closes #112
Supports bottlerocket-os/bottlerocket#905
Supports bottlerocket-os/bottlerocket#91

Description of changes:

Add a setting to the Settings object such that we can choose to load a repository with expired metadata if we want to. This supports a use case in Bottlerocket when we need to load a cached, local repository without access to networking, and where failing due to an expiration cannot be tolerated.

I used an enum for this setting, Unsafe vs Safe to make it clearer what this setting does, and thus harder to accidentally choose incorrectly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@webern webern force-pushed the pr/expired branch 2 times, most recently from 1785e90 to 8d192c4 Compare May 14, 2020 20:00
@webern webern requested review from iliana and zmrow May 14, 2020 20:00
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Two things:

  • This is a API-breaking change so we'll want to make sure that we bump the minor version of the entire library and update the changelog.
  • We'll probably want to add an argument to tuftool so a user can download an expired repo. This is also an API breaking change and deserves a version bump.

Let's get @iliana 's eyes on this too. :)

tough/src/lib.rs Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented May 15, 2020

  • we'll want to make sure that we bump the minor version of the entire library and update the changelog.

Agreed. The versions are already bumped to 0.5.0 and I plan to write the changelog in a separate release PR.

  • We'll probably want to add an argument to tuftool so a user can download an expired repo. This is also an API breaking change and deserves a version bump.

Yes, that could be added separately if we want the functionality exposed.

Copy link
Contributor

@iliana iliana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move my feedback into an issue. :)

tough/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

🏎️

@webern webern merged commit cd14882 into awslabs:develop May 18, 2020
@webern webern deleted the pr/expired branch December 24, 2020 00:54
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.

Add ability to load a tuf repo while ignoring expiration dates
3 participants