Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Resolves sigstore/sigstore#483
Preliminary attempt to solve the issue of the offline flag still requiring network access. This fork of sigstore-python in combination with a modified python-tuf repository allows sigstore to operate in offline mode if valid local metadata is available.
Example of modified tuf: https://github.com/emboman13/python-tuf-lazy-refresh
Reviewers can test this PR by creating a python virtual environment where both of these forks are installed as well as the rest of sigstore dependencies. Create an artifact and sign it with sigstore. Verify the bundle of files with --offline passed in to the cli and WiFi fully turned off. Verification is expected to return success as long as signing material was valid at one point.
(pip install git+https://github.com/emboman13/python-tuf-lazy-refresh/#egg=tuf)
Currently looking into signing and verifying an artifact using a faketime library. Needs unit tests and possibly a better way to grab the offline flag from arguments.
Release Note
--offline allows sigstore to operate with network access fully turned off.
TrustUpdater within tuf.py has an updated config with the offline flag if found from system arguments.
Catches a new exception from tuf (NetworkUnavailableError).
Documentation
TUF updater skips the checking the expiry of data in the case that local metadata is loaded.