From d0794d1da754c0c02cf430c670c31f863716b8c5 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Mon, 17 Feb 2025 11:51:15 -0800 Subject: [PATCH 1/2] Point to tuf-conformance release Signed-off-by: Samuel Giddins --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c00a8a4..de0860e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: run: bin/rake bin/tuf-conformance-entrypoint.xfails - name: Run the TUF conformance tests - uses: theupdateframework/tuf-conformance@dee4e23533d7a12a6394d96b59b3ea0aa940f9bf + uses: theupdateframework/tuf-conformance@9bfc222a371e30ad5511eb17449f68f855fb9d8f # v2.3.0 with: entrypoint: ${{ github.workspace }}/bin/tuf-conformance-entrypoint artifact-name: "test repositories ${{ matrix.ruby }} ${{ matrix.os }}" From dae68c04b14c94bcd6aad573422f7482d42f0d90 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Mon, 17 Feb 2025 12:39:38 -0800 Subject: [PATCH 2/2] Compatibility with latest tuf-conformance Signed-off-by: Samuel Giddins --- .ruby-version | 2 +- bin/tuf-conformance-entrypoint | 9 +++++++++ lib/sigstore/tuf/updater.rb | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index bea438e..4d9d11c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.4.2 diff --git a/bin/tuf-conformance-entrypoint b/bin/tuf-conformance-entrypoint index 2d71036..45a0d2d 100755 --- a/bin/tuf-conformance-entrypoint +++ b/bin/tuf-conformance-entrypoint @@ -44,5 +44,14 @@ end ARGV.prepend("tuf") ARGV[2, 0] = args +if ENV.fetch("FAKETIME", nil) && + !ENV["DYLD_INSERT_LIBRARIES"].to_s.include?("libfaketime") && !ENV["LD_PRELOAD"].to_s.include?("libfaketime") + Time.singleton_class.prepend(Module.new do + def now + super + ENV["FAKETIME"].to_f + end + end) +end + require "sigstore/cli" Sigstore::CLI.start(ARGV) diff --git a/lib/sigstore/tuf/updater.rb b/lib/sigstore/tuf/updater.rb index e11ee7a..19a6b43 100644 --- a/lib/sigstore/tuf/updater.rb +++ b/lib/sigstore/tuf/updater.rb @@ -72,6 +72,10 @@ def download_target(target_info, filepath = nil, target_base_url = nil) target_base_url ||= @target_base_url raise ArgumentError, "No target_base_url set" unless target_base_url + if (cached_target = find_cached_target(target_info, filepath)) + return cached_target + end + filepath ||= generate_target_file_path(target_info) target_filepath = target_info.path