assessments

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeverityNames = util.NewStringSetWithValues([]string{
	"info", "low", "medium", "high", "critical",
})

Functions

func ParseFailThresholds

func ParseFailThresholds(thresholds []string) (map[string]int, error)

func RegisterPRIntegration added in v0.4.34

func RegisterPRIntegration(integ func(ctx context.Context, config *jnode.Node) PRIntegration)

Types

type Assessment

type Assessment struct {
	ID       string   `json:"assessmentId"`
	URL      string   `json:"appUrl"`
	Title    string   `json:"title"`
	Module   string   `json:"module"`
	Category string   `json:"category"`
	Markdown string   `json:"markdown,omitempty"`
	Findings Findings `json:"findings"`

	Failed         bool   `json:"failed"`
	FailedCount    int    `json:"failedCount"`
	FailedSeverity string `json:"failedSeverity"`
}

func (*Assessment) EvaluateFailures added in v0.4.34

func (a *Assessment) EvaluateFailures(thresholds map[string]int)

func (*Assessment) UpdatePR added in v0.4.34

func (a *Assessment) UpdatePR(client *api.Client) error

NB - not used

type Assessments

type Assessments []*Assessment

func FindCIEnvAssessments

func FindCIEnvAssessments(client *api.Client) (Assessments, error)

func (Assessments) UpdatePR added in v0.4.34

func (a Assessments) UpdatePR(client *api.Client) error

type Finding

type Finding struct {
	SID           string `json:"sid,omitempty"`
	Severity      string `json:"severity,omitempty"`
	Title         string `json:"title,omitempty"`
	Description   string `json:"description,omitempty"`
	Markdown      string `json:"markdown,omitempty"`
	FilePath      string `json:"filePath,omitempty"`
	Resource      string `json:"resource,omitempty"`
	Line          int    `json:"line,omitempty"`
	Pass          bool   `json:"pass,omitempty"`
	GeneratedFile bool   `json:"generated_filed,omitempty"`

	// These fields are filled in by the CLI and sent to the api-server
	RepoPath           string            `json:"repoPath,omitempty"`
	PartialFingerprint string            `json:"partialFingerprint,omitempty"`
	Tool               map[string]string `json:"tool,omitempty"`
}

func (*Finding) GetTitle

func (f *Finding) GetTitle() string

func (*Finding) SetAttribute added in v0.4.36

func (f *Finding) SetAttribute(name, value string) *Finding

type Findings added in v0.4.36

type Findings []*Finding

func (Findings) ComputePartialFingerprints added in v0.4.36

func (findings Findings) ComputePartialFingerprints(dir string)

type PRIntegration added in v0.4.34

type PRIntegration interface {
	Update(ctx context.Context, assessments Assessments)
}

type PRIntegrations added in v0.4.34

type PRIntegrations []func(context.Context, *jnode.Node) PRIntegration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL