Documentation ¶
Index ¶
Constants ¶
View Source
const ( JSON = "json" YAML = "yaml" Text = "text" AppStudio = "appstudio" Summary = "summary" SummaryMarkdown = "summary-markdown" JUnit = "junit" Data = "data" Attestation = "attestation" PolicyInput = "policy-input" VSA = "vsa" // Deprecated old version of appstudio. Remove some day. HACBS = "hacbs" )
Possible formats the report can be written as.
View Source
const ( // Make it visible elsewhere PredicateVSAProvenance = "https://enterprisecontract.dev/verification_summary/v1" StatmentVSA = "https://in-toto.io/Statement/v1" )
Variables ¶
View Source
var OutputFormats = []string{ JSON, YAML, Text, AppStudio, Summary, SummaryMarkdown, JUnit, Data, Attestation, PolicyInput, VSA, }
Functions ¶
func DetermineInputSpec ¶
func OutputAppstudioReport ¶
func OutputAppstudioReport(t TestReport)
Types ¶
type Component ¶
type Component struct { app.SnapshotComponent Violations []evaluator.Result `json:"violations,omitempty"` Warnings []evaluator.Result `json:"warnings,omitempty"` Successes []evaluator.Result `json:"successes,omitempty"` Success bool `json:"success"` SuccessCount int `json:"-"` Signatures []signature.EntitySignature `json:"signatures,omitempty"` Attestations []attestation.Attestation `json:"attestations,omitempty"` }
type ProvenanceStatementVSA ¶
type ProvenanceStatementVSA struct { in_toto.StatementHeader Predicate Report `json:"predicate"` }
func NewVSA ¶
func NewVSA(report Report) (ProvenanceStatementVSA, error)
type Report ¶
type Report struct { Success bool `json:"success"` Snapshot string `json:"snapshot,omitempty"` Components []Component `json:"components"` Key string `json:"key"` Policy ecc.EnterpriseContractPolicySpec `json:"policy"` EcVersion string `json:"ec-version"` Data any `json:"-"` EffectiveTime time.Time `json:"effective-time"` PolicyInput [][]byte `json:"-"` ShowSuccesses bool `json:"-"` // contains filtered or unexported fields }
type TestReport ¶
type TestReport struct { Timestamp string `json:"timestamp"` Namespace string `json:"namespace"` Successes int `json:"successes"` Failures int `json:"failures"` Warnings int `json:"warnings"` Result string `json:"result"` Note string `json:"note,omitempty"` }
TestReport represents the standardized TEST_OUTPUT format. The `Namespace` attribute is required for the appstudio results API. However, it is always an empty string from the ec-cli as a way to indicate all namespaces were used.
func AppstudioReportForError ¶
func AppstudioReportForError(prefix string, err error) TestReport
func (*TestReport) DeriveNote ¶
func (r *TestReport) DeriveNote()
It's redundant and perhaps not very useful, but let's produce some kind of a human readable note. We could perhaps make this more sophisticated in future, e.g. by including an abbreviated list of failure or warning messages.
func (*TestReport) DeriveResult ¶
func (r *TestReport) DeriveResult(hasFailures bool)
Click to show internal directories.
Click to hide internal directories.