MCPcopy Create free account
hub / github.com/conforma/cli / SetAttestationSignatureCheckFromError

Method SetAttestationSignatureCheckFromError

internal/output/output.go:142–164  ·  view source on GitHub ↗

SetAttestationSignatureCheck sets the passed and result.message fields of the AttestationSignatureCheck to the given values.

(err error)

Source from the content-addressed store, hash-verified

140
141// SetAttestationSignatureCheck sets the passed and result.message fields of the AttestationSignatureCheck to the given values.
142func (o *Output) SetAttestationSignatureCheckFromError(err error) {
143 metadata := map[string]interface{}{
144 "code": "builtin.attestation.signature_check",
145 "title": "Attestation signature check passed",
146 "description": "The attestation signature matches available signing materials.",
147 }
148 var message string
149
150 if err == nil {
151 o.AttestationSignatureCheck.Passed = true
152 message = "Pass"
153 log.Debug("Attestation signature check passed")
154 } else {
155 o.AttestationSignatureCheck.Passed = false
156 message = wrapCosignErrorMessage(err, "attestation", o.Policy)
157 log.Debug(message)
158 }
159 result := &evaluator.Result{Message: message, Metadata: metadata}
160 if !o.Detailed {
161 keepSomeMetadataSingle(*result)
162 }
163 o.AttestationSignatureCheck.Result = result
164}
165
166// SetAttestationSyntaxCheck sets the passed and result.message fields of the AttestationSyntaxCheck to the given values.
167func (o *Output) SetAttestationSyntaxCheckFromError(err error) {

Callers 2

ValidateImageFunction · 0.95

Calls 2

wrapCosignErrorMessageFunction · 0.85
keepSomeMetadataSingleFunction · 0.85