Skip to content
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

Enable fetching signatures without remote get. #4047

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

janisz
Copy link
Contributor

@janisz janisz commented Feb 5, 2025

Summary
When using cosign as a dependency and attempting to fetch signatures for a specific signed entity, the signed entity is always fetched from the registry.

In case the signed entity has been fetched previously, it'd be nice to introduce a function similar to the FetchAttestations that allows to fetch signatures from the signed entity directly, without reaching out to the registry to fetch the signed entity beforehand.

With the current changes in the PR, the error will now not include the reference anymore. However, the changes were also made to FetchAttestations in the same way.
If we want to include this information, we may wrap the returned error from FetchAttestations/FetchSignatures with the reference, so the content of the error will stay the same.

Release Note
NONE

Refs:

@janisz janisz requested a review from a team as a code owner February 5, 2025 16:21
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 36.51%. Comparing base (8714480) to head (4580e7b).
Report is 707 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cosign/fetch.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4047      +/-   ##
==========================================
+ Coverage   30.33%   36.51%   +6.18%     
==========================================
  Files         151      209      +58     
  Lines        9439    13357    +3918     
==========================================
+ Hits         2863     4877    +2014     
- Misses       6134     7859    +1725     
- Partials      442      621     +179     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Daniel Haus <[email protected]>
Signed-off-by: Tomasz Janiszewski <[email protected]>
@janisz janisz force-pushed the fetch-signatures-refactor branch from aa1a890 to 4580e7b Compare February 5, 2025 17:17
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.

2 participants