Skip to content

Commit

Permalink
bug: ensure sarif and scorecard packages are imported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mikhailswift committed Feb 25, 2022
1 parent 97adc5f commit 7d3e1d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/attestation/scorecard/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (a *Attestor) getCanidate(ctx *attestation.AttestationContext) error {
return fmt.Errorf("error reading file: %s", path)
}

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

return nil
}
return fmt.Errorf("no sarif file found")
return fmt.Errorf("no scorecard file found")
}

func (a *Attestor) Subjects() map[string]cryptoutil.DigestSet {
Expand Down
2 changes: 2 additions & 0 deletions pkg/attestors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ import (
_ "github.com/testifysec/witness/pkg/attestation/jwt"
_ "github.com/testifysec/witness/pkg/attestation/maven"
_ "github.com/testifysec/witness/pkg/attestation/oci"
_ "github.com/testifysec/witness/pkg/attestation/sarif"
_ "github.com/testifysec/witness/pkg/attestation/scorecard"
)

0 comments on commit 7d3e1d4

Please sign in to comment.