factor out keyless verification certificate loading function #3762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 methodVerifyCommand.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 fromverify_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