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

factor out keyless verification certificate loading function #3762

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

dmitris
Copy link
Contributor

@dmitris dmitris commented Jul 3, 2024

Summary

Factor out the code loading certificates for keyless verification (from a certificate chain, provided roots / intermediate or from Fulcio) into a helper function loadCertsKeylessVerification. This reduces the size of the long method VerifyCommand.Exec (from the current 252 to 206 lines), helps with unit testing, and will later allow the same logic and helper function to be shared and called from verify_attestation.go, verify_blob.go etc. (related to #3759).

The helper function has a corresponding unit test, the est coverage in the cmd/cosign/cli/verify is increased from 38.2% of statements in the trunk version to 42.6%.

Release Note

NONE

Documentation

n/a - no updates needed

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 89.79592% with 5 lines in your changes missing coverage. Please review.

Project coverage is 37.08%. Comparing base (2ef6022) to head (a8a7341).
Report is 151 commits behind head on main.

Files Patch % Lines
cmd/cosign/cli/verify/verify.go 89.79% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3762      +/-   ##
==========================================
- Coverage   40.10%   37.08%   -3.03%     
==========================================
  Files         155      200      +45     
  Lines       10044    12289    +2245     
==========================================
+ Hits         4028     4557     +529     
- Misses       5530     7182    +1652     
- Partials      486      550      +64     

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

@dmitris dmitris force-pushed the keyless-verify-helperfunc branch 7 times, most recently from 04e6465 to 09f8ece Compare July 3, 2024 12:23
@dmitris dmitris changed the title factor out keyless verification helper function factor out keyless verification certificate loading function Jul 3, 2024
@dmitris dmitris force-pushed the keyless-verify-helperfunc branch 2 times, most recently from 9857e15 to 14a166d Compare July 8, 2024 09:05
haydentherapper
haydentherapper previously approved these changes Jul 9, 2024
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! Can you rebase, that'll fix the failing CI

@dmitris dmitris force-pushed the keyless-verify-helperfunc branch from 14a166d to 32949de Compare July 9, 2024 08:43
cpanato
cpanato previously approved these changes Jul 9, 2024
Signed-off-by: Dmitry Savintsev <[email protected]>
@dmitris dmitris dismissed stale reviews from cpanato and haydentherapper via a8a7341 July 9, 2024 09:24
@dmitris
Copy link
Contributor Author

dmitris commented Jul 9, 2024

Thanks! Can you rebase, that'll fix the failing CI

done, CI 🟢

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thanks

@cpanato cpanato merged commit 811dba8 into sigstore:main Jul 9, 2024
22 checks passed
@dmitris dmitris deleted the keyless-verify-helperfunc branch July 9, 2024 10:31
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.

3 participants