Help us shape the future of Go! Take the 2026 Go Developer Survey

sarif

package
v1.31.9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 0 Imported by: 6

Documentation

Index

Constants

View Source
const (
	WontFix         Category         = "wont-fix"
	NotVulnerable   Category         = "not-vulnerable"
	TemporaryIgnore Category         = "temporary-ignore"
	UnderReview     SuppresionStatus = "underReview"
	Accepted        SuppresionStatus = "accepted"
	Rejected        SuppresionStatus = "rejected"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactLocation

type ArtifactLocation struct {
	URI       string `json:"uri"`
	URIBaseID string `json:"uriBaseId"`
}

type Category

type Category string

type CodeFlow

type CodeFlow struct {
	ThreadFlows []ThreadFlow `json:"threadFlows"`
}

type DefaultConfiguration

type DefaultConfiguration struct {
	Level string `json:"level"`
}

type Driver

type Driver struct {
	Name            string `json:"name"`
	SemanticVersion string `json:"semanticVersion"`
	Version         string `json:"version"`
	Rules           []Rule `json:"rules"`
}

type ExampleCommitFix

type ExampleCommitFix struct {
	CommitURL string `json:"commitURL"`
	Lines     []struct {
		Line       string `json:"line"`
		LineNumber int    `json:"lineNumber"`
		LineChange string `json:"lineChange"`
	} `json:"lines"`
}

type Fingerprints

type Fingerprints struct {
	Num0                    string `json:"0"`
	Num1                    string `json:"1"`
	Identity                string `json:"identity"`
	SnykOrgProjectFindingV1 string `json:"snyk/org/project/finding/v1"`
	SnykAssetFindingV1      string `json:"snyk/asset/finding/v1"`
}

type Help

type Help struct {
	Markdown string `json:"markdown"`
	Text     string `json:"text"`
}

type IgnoredBy

type IgnoredBy struct {
	Name  string  `json:"name"`
	Email *string `json:"email"`
}

type Location

type Location struct {
	ID               int              `json:"id"`
	PhysicalLocation PhysicalLocation `json:"physicalLocation"`
}

type PhysicalLocation

type PhysicalLocation struct {
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	Region           Region           `json:"region"`
}

type Region added in v1.10.0

type Region struct {
	StartLine   int `json:"startLine"`
	EndLine     int `json:"endLine"`
	StartColumn int `json:"startColumn"`
	EndColumn   int `json:"endColumn"`
}

type Result

type Result struct {
	RuleID       string           `json:"ruleId"`
	RuleIndex    int              `json:"ruleIndex"`
	Level        string           `json:"level"`
	Message      ResultMessage    `json:"message"`
	Locations    []Location       `json:"locations"`
	Fingerprints Fingerprints     `json:"fingerprints"`
	CodeFlows    []CodeFlow       `json:"codeFlows"`
	Properties   ResultProperties `json:"properties"`
	Suppressions []Suppression    `json:"suppressions"`
}

type ResultMessage

type ResultMessage struct {
	Text      string   `json:"text"`
	Markdown  string   `json:"markdown"`
	Arguments []string `json:"arguments"`
}

type ResultProperties

type ResultProperties struct {
	PriorityScore        int `json:"priorityScore"`
	PriorityScoreFactors []struct {
		Label bool   `json:"label"`
		Type  string `json:"type"`
	} `json:"priorityScoreFactors"`
	IsAutofixable bool          `json:"isAutofixable"`
	Policy        *SnykPolicyV1 `json:"snykPolicy/v1,omitempty"`
}

type Reviewer added in v1.29.0

type Reviewer struct {
	Name  string  `json:"name"`
	Email *string `json:"email"`
}

type Rule

type Rule struct {
	ID                   string               `json:"id"`
	Name                 string               `json:"name"`
	ShortDescription     ShortDescription     `json:"shortDescription"`
	DefaultConfiguration DefaultConfiguration `json:"defaultConfiguration"`
	Help                 Help                 `json:"help"`
	Properties           RuleProperties       `json:"properties"`
}

type RuleProperties

type RuleProperties struct {
	Tags                      []string           `json:"tags"`
	Categories                []string           `json:"categories"`
	ExampleCommitFixes        []ExampleCommitFix `json:"exampleCommitFixes"`
	ExampleCommitDescriptions []string           `json:"exampleCommitDescriptions"`
	Precision                 string             `json:"precision"`
	RepoDatasetSize           int                `json:"repoDatasetSize"`
	Cwe                       []string           `json:"cwe"`
}

type Run

type Run struct {
	Tool       Tool          `json:"tool"`
	Results    []Result      `json:"results"`
	Properties RunProperties `json:"properties"`
}

type RunProperties

type RunProperties struct {
	Coverage []struct {
		Files       int    `json:"files"`
		IsSupported bool   `json:"isSupported"`
		Lang        string `json:"lang"`
		Type        string `json:"type"`
	} `json:"coverage"`
	UploadResult struct {
		ProjectId  string `json:"projectId"`
		SnapshotId string `json:"snapshotId"`
		ReportUrl  string `json:"reportUrl"`
	} `json:"uploadResult,omitempty"`
}

type SarifCoverage added in v1.6.1

type SarifCoverage struct {
	Files       int    `json:"files"`
	IsSupported bool   `json:"isSupported"`
	Lang        string `json:"lang"`
}

type SarifDocument added in v1.4.1

type SarifDocument struct {
	Schema  string `json:"$schema"`
	Version string `json:"version"`
	Runs    []Run  `json:"runs"`
}

SarifDocument matches the spec in https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json

type SarifResponse

type SarifResponse struct {
	Type     string  `json:"type"`
	Progress float64 `json:"progress"`
	Status   string  `json:"status"`
	Timing   struct {
		FetchingCode int `json:"fetchingCode"`
		Queue        int `json:"queue"`
		Analysis     int `json:"analysis"`
	} `json:"timing"`
	Coverage []SarifCoverage `json:"coverage"`
	Sarif    SarifDocument   `json:"sarif"`
}

type ShortDescription

type ShortDescription struct {
	Text string `json:"text"`
}

type SnykPolicyV1 added in v1.11.1

type SnykPolicyV1 struct {
	OriginalLevel    string `json:"originalLevel"`
	OriginalSeverity string `json:"originalSeverity"`
	Severity         string `json:"severity"`
}

type SuppresionStatus added in v1.19.0

type SuppresionStatus string

type Suppression

type Suppression struct {
	Guid          string                `json:"guid"`
	Justification string                `json:"justification"`
	Properties    SuppressionProperties `json:"properties"`
	Status        SuppresionStatus      `json:"status"`
}

type SuppressionProperties

type SuppressionProperties struct {
	Category   Category  `json:"category"`
	Expiration *string   `json:"expiration"`
	IgnoredOn  string    `json:"ignoredOn"` // https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790703
	IgnoredBy  IgnoredBy `json:"ignoredBy"`
	ReviewedOn *string   `json:"reviewedOn,omitempty"`
	ReviewedBy *Reviewer `json:"reviewedBy,omitempty"`
}

type ThreadFlow

type ThreadFlow struct {
	Locations []ThreadFlowLocation `json:"locations"`
}

type ThreadFlowLocation

type ThreadFlowLocation struct {
	Location Location `json:"location"`
}

type Tool

type Tool struct {
	Driver Driver `json:"driver"`
}

Jump to

Keyboard shortcuts

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