Skip to content

Add API and CLI option for offline (no TUF refresh) verification #104

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

Merged
merged 5 commits into from
Mar 13, 2025

Conversation

facutuesca
Copy link
Collaborator

@facutuesca facutuesca commented Mar 12, 2025

Changes

  • The Attestation.verify(...) API has been changed to accept an offline parameter that, when True, disables TUF refreshes.
  • The CLI verify commands now also accept an --offline flag that disables TUF refreshes. Additionally, when used with the verify pypi subcommand, the --offline flag enforces that the distribution and provenance file arguments must be local file paths.

Testing

Tests now set offline=True when possible. In order to make sure that offline tests (those not marked with the online pytest marker) work offline, a new GitHub CI job was added that runs the tests under an environment with no network access (using firejail).

Also, a new test-nocoverage make target was added to use in the CI job above, since when running the offline tests we don't want to fail when coverage < 100%.

cc @woodruffw @mgorny

(should be merged after #103)

Fixes #102

@facutuesca facutuesca force-pushed the ft/offline-verification branch 3 times, most recently from 2c4bd15 to 96885e5 Compare March 12, 2025 22:58
@facutuesca facutuesca force-pushed the ft/offline-verification branch from 96885e5 to 85754c2 Compare March 12, 2025 23:02
@facutuesca facutuesca force-pushed the ft/offline-verification branch from 85754c2 to d1a8415 Compare March 12, 2025 23:05
@facutuesca facutuesca requested a review from woodruffw March 12, 2025 23:15
@facutuesca facutuesca marked this pull request as ready for review March 12, 2025 23:15
Base automatically changed from ft/test-assets to main March 13, 2025 14:28
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

@facutuesca facutuesca merged commit 2058510 into main Mar 13, 2025
8 checks passed
@facutuesca facutuesca deleted the ft/offline-verification branch March 13, 2025 15:57
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.

Please support offline verification
2 participants