Skip to content

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

Merged
webern merged 1 commit intoawslabs:developfrom
webern:pr/expired
May 18, 2020
Merged

tough: support the loading of an expired repo in unsafe mode#121
webern merged 1 commit intoawslabs:developfrom
webern:pr/expired

Conversation

@webern
Copy link
Copy Markdown
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
Copy Markdown
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. :)

Comment thread tough/src/lib.rs Outdated
@webern
Copy link
Copy Markdown
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
Copy Markdown
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. :)

Comment thread tough/src/lib.rs Outdated
@webern webern requested a review from zmrow May 15, 2020 22:26
Copy link
Copy Markdown
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