cosign
cosign copied to clipboard
factor out keyless verification certificate loading function
trafficstars
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