Skip to content

Support dynamic Sigstore trusted root TUF refresh on pub get/upgrade with anti-downgrade - #4887

Draft
mosuem wants to merge 2 commits into
verify-sigstore-attestationfrom
refresh-sigstore-trusted-root
Draft

mosuem wants to merge 2 commits into
verify-sigstore-attestationfrom
refresh-sigstore-trusted-root

Conversation

@mosuem

@mosuem mosuem commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Note

This PR was generated by an AI coding agent (Jetski) on behalf of @mosuem.

Replaces PR #4877 which GitHub automatically closed as merged when the branch temporarily aligned with base during rebasing.

  • Adds sigstoreTufCacheDir getter to SystemCache pointing to $PUB_CACHE/sigstore/tuf/.
  • In GetCommand (dart pub get), triggers a lazy TUF refresh (refreshTrustedRootIfNeeded) whenever $PUB_CACHE/sigstore/tuf/ or $PUB_CACHE/sigstore/trusted_root.json is missing or expired (signed.expires).
  • In UpgradeCommand (dart pub upgrade), refreshes the trusted root from Sigstore's TUF CDN before dependency resolution when online (force: true).
  • Enforces anti-downgrade protection (readMaxTufRootVersion): refuses to downgrade below the highest TUF root version already cached on disk in $PUB_CACHE/sigstore/tuf/ and never silently falls back to the older bundled trusted_root.json once TUF root state exists on disk.

@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from 013c4f3 to cb4256a Compare August 25, 2026 08:45
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from cb4256a to a9377a0 Compare August 25, 2026 09:53
@mosuem
mosuem marked this pull request as draft August 25, 2026 10:49
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from a9377a0 to 563ea5c Compare August 25, 2026 15:41
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 563ea5c to a09615a Compare August 25, 2026 16:11
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from a09615a to 272841a Compare August 26, 2026 11:06
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 272841a to d293adb Compare August 27, 2026 08:08
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from d293adb to f5e7af3 Compare August 27, 2026 08:17
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from f5e7af3 to 30070e0 Compare August 27, 2026 09:15
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 30070e0 to c536061 Compare August 27, 2026 12:07
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from c536061 to 303e5eb Compare August 27, 2026 12:22
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 303e5eb to 6fcf5fe Compare August 27, 2026 12:37
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from 840696e to e7ba6ef Compare August 28, 2026 11:14
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from e7ba6ef to 5aa9ebd Compare August 28, 2026 12:13
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from a37cda3 to 17376b0 Compare August 31, 2026 13:58
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from 5dad0d9 to 9097a02 Compare August 31, 2026 14:16
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 9097a02 to 11c946d Compare August 31, 2026 15:07
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 11c946d to f0b58c7 Compare October 7, 2026 13:29
@mosuem mosuem changed the title Support dynamic Sigstore trusted root update and caching during pub upgrade Support dynamic Sigstore trusted root TUF refresh on pub get/upgrade with anti-downgrade Oct 7, 2026
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from b975114 to b5a892a Compare October 12, 2026 10:08
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from 14ac953 to 20517ed Compare October 12, 2026 12:06
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch from 20517ed to 3a06c2b Compare October 12, 2026 12:18
@sigurdm
sigurdm force-pushed the refresh-sigstore-trusted-root branch from 3a06c2b to 478d1cd Compare October 12, 2026 14:02
@sigurdm
sigurdm removed this pull request from stack #4904 October 12, 2026 14:16
@sigurdm
sigurdm added this pull request to stack #4944 October 12, 2026 14:16
@mosuem
mosuem force-pushed the refresh-sigstore-trusted-root branch 2 times, most recently from 56cfc6b to d627b7c Compare October 12, 2026 14:50
…pgrade

- Adds `sigstoreTufCacheDir` getter to `SystemCache`.
- In `UpgradeCommand`, attempts to refresh the trusted root from Sigstore's TUF CDN before dependency resolution when online.
- Caches verified `trusted_root.json` in `$PUB_CACHE/sigstore/` using TUF verification.
- Falls back to package:sigstore embedded production root if cache is absent or offline.
@sigurdm
sigurdm force-pushed the refresh-sigstore-trusted-root branch from d627b7c to 67e8924 Compare October 20, 2026 09:39
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.

1 participant