Documentation
¶
Index ¶
- Constants
- func DecodeMetadata[T any](value interface{}) (T, error)
- func GetDirectPackagePinTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)
- func GetDirectPackageUpgradeTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)
- func GetFixAttributes(issue testapi.Issue) *testapi.FixAttributes
- type Coverage
- type FindingExtra
- type PinGroup
- type PriorityScoreFactor
- type RemediationSummary
- type SuppressionExtra
- type UpgradeGroup
Constants ¶
const ( MetadataKeyFindingExtras = "finding-extras" MetadataKeyCoverage = "coverage" )
Test result metadata keys under which the SARIF transformation stores the details UFM has no field for, so the SARIF presenter can render them again.
Variables ¶
This section is empty.
Functions ¶
func DecodeMetadata ¶ added in v0.27.0
DecodeMetadata converts a metadata value into T. The value is either T itself (in memory) or its generic JSON form (after a TestResult JSON round trip).
func GetDirectPackagePinTarget ¶
func GetDirectPackagePinTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)
GetPinTarget returns the package to pin from fix attributes. Returns the package name and version to pin to, or empty strings if not applicable.
func GetDirectPackageUpgradeTarget ¶
func GetDirectPackageUpgradeTarget(attrs *testapi.FixAttributes) (packageName, packageVersion string)
GetUpgradeTarget returns the direct dependency to upgrade from fix attributes. Returns the package name and version to upgrade to, or empty strings if not applicable.
func GetFixAttributes ¶
func GetFixAttributes(issue testapi.Issue) *testapi.FixAttributes
GetFixAttributes extracts fix attributes from an issue's findings.
Types ¶
type Coverage ¶ added in v0.27.0
type Coverage struct {
Files int `json:"files"`
IsSupported bool `json:"isSupported"`
Lang string `json:"lang"`
Type string `json:"type"`
}
Coverage is one entry of the SARIF run coverage stored under MetadataKeyCoverage.
type FindingExtra ¶ added in v0.27.0
type FindingExtra struct {
Fingerprints map[string]string `json:"fingerprints,omitempty"`
IsAutofixable bool `json:"isAutofixable,omitempty"`
Arguments []string `json:"arguments,omitempty"`
Suppression *SuppressionExtra `json:"suppression,omitempty"`
MessageText string `json:"messageText,omitempty"`
MessageMarkdown string `json:"messageMarkdown,omitempty"`
PriorityScoreFactors []PriorityScoreFactor `json:"priorityScoreFactors,omitempty"`
PolicyOriginalLevel string `json:"policyOriginalLevel,omitempty"`
PolicySeverity string `json:"policySeverity,omitempty"`
PolicyOriginalSeverity string `json:"policyOriginalSeverity,omitempty"`
}
FindingExtra holds the SARIF result details of one finding, keyed by finding ID under MetadataKeyFindingExtras.
type PriorityScoreFactor ¶ added in v0.27.0
type RemediationSummary ¶
type RemediationSummary struct {
Upgrades []*UpgradeGroup
Pins []*PinGroup
Unresolved []testapi.Issue
}
func GetRemediationSummary ¶
func GetRemediationSummary(issues []testapi.Issue) *RemediationSummary
GetRemediationSummary returns a summary of the remediation actions needed for the issues. It groups issues by the package they are related to and the action needed to fix them.
func (*RemediationSummary) HasPins ¶
func (s *RemediationSummary) HasPins() bool
func (*RemediationSummary) HasUnresolved ¶
func (s *RemediationSummary) HasUnresolved() bool
func (*RemediationSummary) HasUpgrades ¶
func (s *RemediationSummary) HasUpgrades() bool