Skip to content

Conversation

tommyd450
Copy link

Summary

My attempt to address #4140 . I have added a fallback for certificate output in cosign sign blob, similar to sign it outputs the public key used if no certificate is present.

Release Note

  • When using sign-blob with cert output will now output encoded public key if no cert can be extracted.

Documentation

@tommyd450 tommyd450 requested a review from a team as a code owner June 6, 2025 13:09
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 35.06%. Comparing base (2ef6022) to head (3c2ea03).
⚠️ Report is 492 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cosign/cli/sign/sign.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4224      +/-   ##
==========================================
- Coverage   40.10%   35.06%   -5.04%     
==========================================
  Files         155      214      +59     
  Lines       10044    14576    +4532     
==========================================
+ Hits         4028     5111    +1083     
- Misses       5530     8811    +3281     
- Partials      486      654     +168     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

Thanks for looking into fixing this!

I wasn't clear in the issue, the fix is actually the inverse of this - we should not print a public key with --output-certificate in cosign sign. The behavior of cosign sign-blob is working as intended.

In cosign sign here, I'd suggest checking if the signer is a certificate before writing it to disk, otherwise do nothing.

@tommyd450 tommyd450 force-pushed the sign-blob-certificate-output branch from 8267e29 to 33a1ce7 Compare July 24, 2025 09:07
@tommyd450 tommyd450 force-pushed the sign-blob-certificate-output branch from 33a1ce7 to 3c2ea03 Compare July 24, 2025 09:09
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