issue

package
v0.0.0-...-bc69434 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FunctionsMap helper functions
	FunctionsMap = template.FuncMap{
		"Hide": HideSecret,
	}
)

Functions

func HideSecret

func HideSecret(secret string, reveal int) string

HideSecret hide leaks in text

Types

type Data

type Data struct {
	Branch    string
	Commit    *object.Commit
	Condition hook.Condition
	Object    string
	Operator  string
	Operand   string
	Tag       string
	Value     string
}

Data data to be used for message rendering

type Issue

type Issue struct {
	Author    string             `json:"author"`
	Commit    string             `json:"commit"`
	Condition hook.ConditionType `json:"condition"`
	Email     string             `json:"email"`
	Handler   hook.HandlerType   `json:"handler"`
	Leaks     []security.Leak    `json:"leaks,omitempty"`
	Message   string             `json:"message"`
	Severity  Score              `json:"severity"`
}

Issue analysis issue

func NewIssue

func NewIssue(handlerType hook.HandlerType, conditionType hook.ConditionType, data Data, severity Score, messageTemplate string) Issue

NewIssue create new issue

func (*Issue) WithLeak

func (issue *Issue) WithLeak(leak security.Leak)

WithLeak attach leaks to issue

func (*Issue) WithLeaks

func (issue *Issue) WithLeaks(leaks []security.Leak)

WithLeaks attach leaks to issue

type Score

type Score int

Score type used by severity and confidence values

const (
	// SeverityLow severity or confidence
	SeverityLow Score = iota
	// SeverityMedium severity or confidence
	SeverityMedium
	// SeverityHigh severity or confidence
	SeverityHigh
)

func ParseScore

func ParseScore(score string) Score

ParseScore parse score from string input

func (Score) MarshalJSON

func (score Score) MarshalJSON() ([]byte, error)

MarshalJSON marshal score to json

func (Score) String

func (score Score) String() string

func (*Score) UnmarshalJSON

func (score *Score) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json to score

Jump to

Keyboard shortcuts

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