Skip to content

Commit

Permalink
add errors to jsonv2 security report
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski committed Oct 31, 2024
1 parent 380afa1 commit fd8b4c6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/report/output/security/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/bearer/bearer/pkg/commands/process/settings"
"github.com/bearer/bearer/pkg/engine"
"github.com/bearer/bearer/pkg/flag"
dataflowtypes "github.com/bearer/bearer/pkg/report/output/dataflow/types"
"github.com/bearer/bearer/pkg/report/output/gitlab"
"github.com/bearer/bearer/pkg/report/output/html"
"github.com/bearer/bearer/pkg/report/output/reviewdog"
Expand All @@ -28,10 +29,11 @@ type Formatter struct {
}

type JsonV2Output struct {
Source string `json:"source" yaml:"source"`
Version string `json:"version" yaml:"version"`
Findings RawFindings `json:"findings" yaml:"findings"`
Expected ExpectedDetections `json:"expected_findings,omitempty" yaml:"expected_findings,omitempty"`
Source string `json:"source" yaml:"source"`
Version string `json:"version" yaml:"version"`
Findings RawFindings `json:"findings" yaml:"findings"`
Expected ExpectedDetections `json:"expected_findings,omitempty" yaml:"expected_findings,omitempty"`
Errors []dataflowtypes.Error `json:"errors" yaml:"errors"`
}

func NewFormatter(
Expand Down Expand Up @@ -82,6 +84,7 @@ func (f Formatter) Format(format string) (output string, err error) {
Version: build.Version,
Findings: f.ReportData.RawFindings,
Expected: f.ReportData.ExpectedDetections,
Errors: f.ReportData.Dataflow.Errors,
})
case flag.FormatYAML:
return outputhandler.ReportYAML(f.ReportData.FindingsBySeverity)
Expand Down

0 comments on commit fd8b4c6

Please sign in to comment.