SetAttestationSyntaxCheck sets the passed and result.message fields of the AttestationSyntaxCheck to the given values.
(err error)
| 165 | |
| 166 | // SetAttestationSyntaxCheck sets the passed and result.message fields of the AttestationSyntaxCheck to the given values. |
| 167 | func (o *Output) SetAttestationSyntaxCheckFromError(err error) { |
| 168 | metadata := map[string]interface{}{ |
| 169 | "code": "builtin.attestation.syntax_check", |
| 170 | "title": "Attestation syntax check passed", |
| 171 | "description": "The attestation has correct syntax.", |
| 172 | } |
| 173 | var message string |
| 174 | |
| 175 | if err == nil { |
| 176 | o.AttestationSyntaxCheck.Passed = true |
| 177 | message = "Pass" |
| 178 | log.Debug("Attestation syntax check passed") |
| 179 | } else { |
| 180 | o.AttestationSyntaxCheck.Passed = false |
| 181 | message = fmt.Sprintf("Attestation syntax check failed: %s", err) |
| 182 | log.Debug(message) |
| 183 | } |
| 184 | result := &evaluator.Result{Message: message, Metadata: metadata} |
| 185 | if !o.Detailed { |
| 186 | keepSomeMetadataSingle(*result) |
| 187 | } |
| 188 | o.AttestationSyntaxCheck.Result = result |
| 189 | } |
| 190 | |
| 191 | // SetPolicyCheck sets the PolicyCheck and ExitCode to the results and exit code of the Results |
| 192 | func (o *Output) SetPolicyCheck(results []evaluator.Outcome) { |