Skip to content

Commit 7d3e1d4

Browse files
Mikhail Swiftmikhailswift
authored andcommitted
bug: ensure sarif and scorecard packages are imported
The two newly added attestors were not imported so their init functions would not have run. Also the scorecard attestor had references to sarif incorrectly. Signed-off-by: Mikhail Swift <mikhail@testifysec.com>
1 parent 97adc5f commit 7d3e1d4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/attestation/scorecard/scorecard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (a *Attestor) getCanidate(ctx *attestation.AttestationContext) error {
108108
return fmt.Errorf("error reading file: %s", path)
109109
}
110110

111-
//check to see if we can unmarshal into sarif type
111+
//check to see if we can unmarshal into scorecard type
112112
if err := json.Unmarshal(reportBytes, &a.Scorecard); err != nil {
113113
fmt.Printf("error unmarshaling report: %s\n", err)
114114
continue
@@ -119,7 +119,7 @@ func (a *Attestor) getCanidate(ctx *attestation.AttestationContext) error {
119119

120120
return nil
121121
}
122-
return fmt.Errorf("no sarif file found")
122+
return fmt.Errorf("no scorecard file found")
123123
}
124124

125125
func (a *Attestor) Subjects() map[string]cryptoutil.DigestSet {

pkg/attestors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ import (
2525
_ "github.com/testifysec/witness/pkg/attestation/jwt"
2626
_ "github.com/testifysec/witness/pkg/attestation/maven"
2727
_ "github.com/testifysec/witness/pkg/attestation/oci"
28+
_ "github.com/testifysec/witness/pkg/attestation/sarif"
29+
_ "github.com/testifysec/witness/pkg/attestation/scorecard"
2830
)

0 commit comments

Comments
 (0)