sarif

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 9 Imported by: 0

README

sarif

Go library for reading, writing, and validating SARIF (Static Analysis Results Interchange Format) 2.1.0 logs.

Ported from github.com/andrew/sarif.

Installation

go get github.com/git-pkgs/sarif

Usage

import (
    "log"
    "os"

    "github.com/git-pkgs/sarif"
)

artifactLocation := sarif.NewArtifactLocation()
artifactLocation.URI = "src/main.go"

region := sarif.NewRegion()
region.StartLine = 10
region.StartColumn = 5

location := sarif.NewLocation()
location.PhysicalLocation = sarif.PhysicalLocation{
    ArtifactLocation: artifactLocation,
    Region:           region,
}

result := sarif.NewResult()
result.RuleID = "no-unused-vars"
result.Level = "warning"
result.Message = sarif.Message{Text: "Variable 'x' is unused"}
result.Locations = []sarif.Location{location}

report := &sarif.Log{
    Version: "2.1.0",
    Runs: []sarif.Run{
        {
            Tool: sarif.Tool{
                Driver: sarif.ToolComponent{
                    Name:    "my-linter",
                    Version: "1.0.0",
                },
            },
            Results: []sarif.Result{result},
        },
    },
}

if err := sarif.Validate(report); err != nil {
    log.Fatal(err)
}

sarif.Dump(report, os.Stdout, true)

Use the generated New<Type> constructors for types that define schema defaults. They initialize sentinel values such as -1, preventing unset indexes and offsets from being serialized as meaningful zeroes. Constructors are listed in the generated API documentation for each applicable type.

Parsing

data, _ := os.ReadFile("results.sarif")
log, err := sarif.Parse(data)
if err != nil {
    log.Fatal(err)
}

for _, run := range log.Runs {
    fmt.Println(run.Tool.Driver.Name)
    for _, result := range run.Results {
        fmt.Println(result.RuleID, result.Message.Text)
    }
}

Validation

Validate checks a *sarif.Log against the bundled SARIF 2.1.0 JSON schema using github.com/santhosh-tekuri/jsonschema/v6.

if sarif.Valid(log) {
    // log is valid SARIF 2.1.0
}

Regenerating Types

Types are generated from the bundled SARIF JSON schema:

go generate ./...

The generator lives in cmd/sarifgen and writes types_gen.go.

License

MIT

Documentation

Overview

Package sarif provides a generated Go object model for SARIF 2.1.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(log *Log, w io.Writer, pretty bool) error

Dump writes a SARIF log to w.

func Marshal

func Marshal(log *Log, pretty bool) ([]byte, error)

Marshal encodes a SARIF log to JSON.

func Schema

func Schema() (*jsonschema.Schema, error)

Schema returns the compiled bundled SARIF 2.1.0 JSON schema.

func Valid

func Valid(log *Log) bool

Valid reports whether log validates against the bundled SARIF 2.1.0 schema.

func Validate

func Validate(log *Log) error

Validate validates a SARIF log against the bundled SARIF 2.1.0 schema.

Types

type Address

type Address struct {
	// AbsoluteAddress The address expressed as a byte offset from the start of the addressable region.
	AbsoluteAddress int `json:"absoluteAddress,omitempty,omitzero"`
	// FullyQualifiedName A human-readable fully qualified name that is associated with the address.
	FullyQualifiedName string `json:"fullyQualifiedName,omitempty,omitzero"`
	// Index The index within run.addresses of the cached object for this address.
	Index int `json:"index,omitempty,omitzero"`
	// Kind An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.
	Kind string `json:"kind,omitempty,omitzero"`
	// Length The number of bytes in this range of addresses.
	Length int `json:"length,omitempty,omitzero"`
	// Name A name that is associated with the address, e.g., '.text'.
	Name string `json:"name,omitempty,omitzero"`
	// OffsetFromParent The byte offset of this address from the absolute or relative address of the parent object.
	OffsetFromParent int `json:"offsetFromParent,omitempty,omitzero"`
	// ParentIndex The index within run.addresses of the parent object.
	ParentIndex int `json:"parentIndex,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the address.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// RelativeAddress The address expressed as a byte offset from the absolute address of the top-most parent object.
	RelativeAddress int `json:"relativeAddress,omitempty,omitzero"`
}

Address A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). Use NewAddress when constructing a value so schema defaults are initialized.

func NewAddress added in v0.1.1

func NewAddress() Address

NewAddress returns an initialized Address with the defaults defined by SARIF 2.1.0.

func (Address) MarshalJSON

func (v Address) MarshalJSON() ([]byte, error)

func (*Address) UnmarshalJSON

func (v *Address) UnmarshalJSON(data []byte) error

type Artifact

type Artifact struct {
	// Contents The contents of the artifact.
	Contents ArtifactContent `json:"contents,omitempty,omitzero"`
	// Description A short description of the artifact.
	Description Message `json:"description,omitempty,omitzero"`
	// Encoding Specifies the encoding for an artifact object that refers to a text file.
	Encoding string `json:"encoding,omitempty,omitzero"`
	// Hashes A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.
	Hashes map[string]string `json:"hashes,omitempty,omitzero"`
	// LastModifiedTimeUtc The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the SARIF spec for the required format.
	LastModifiedTimeUtc string `json:"lastModifiedTimeUtc,omitempty,omitzero"`
	// Length The length of the artifact in bytes.
	Length int `json:"length,omitempty,omitzero"`
	// Location The location of the artifact.
	Location ArtifactLocation `json:"location,omitempty,omitzero"`
	// MimeType The MIME type (RFC 2045) of the artifact.
	MimeType string `json:"mimeType,omitempty,omitzero"`
	// Offset The offset in bytes of the artifact within its containing artifact.
	Offset int `json:"offset,omitempty,omitzero"`
	// ParentIndex Identifies the index of the immediate parent of the artifact, if this artifact is nested.
	ParentIndex int `json:"parentIndex,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the artifact.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Roles The role or roles played by the artifact in the analysis.
	Roles []string `json:"roles,omitempty,omitzero"`
	// SourceLanguage Specifies the source language for any artifact object that refers to a text file that contains source code.
	SourceLanguage string `json:"sourceLanguage,omitempty,omitzero"`
}

Artifact A single artifact. In some cases, this artifact might be nested within another artifact. Use NewArtifact when constructing a value so schema defaults are initialized.

func NewArtifact added in v0.1.1

func NewArtifact() Artifact

NewArtifact returns an initialized Artifact with the defaults defined by SARIF 2.1.0.

func (Artifact) MarshalJSON

func (v Artifact) MarshalJSON() ([]byte, error)

func (*Artifact) UnmarshalJSON

func (v *Artifact) UnmarshalJSON(data []byte) error

type ArtifactChange

type ArtifactChange struct {
	// ArtifactLocation The location of the artifact to change.
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	// Properties Key/value pairs that provide additional information about the change.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Replacements An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.
	Replacements []Replacement `json:"replacements"`
}

ArtifactChange A change to a single artifact.

func (ArtifactChange) MarshalJSON

func (v ArtifactChange) MarshalJSON() ([]byte, error)

type ArtifactContent

type ArtifactContent struct {
	// Binary MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.
	Binary string `json:"binary,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the artifact content.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Rendered An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).
	Rendered MultiformatMessageString `json:"rendered,omitempty,omitzero"`
	// Text UTF-8-encoded content from a text artifact.
	Text string `json:"text,omitempty,omitzero"`
}

ArtifactContent Represents the contents of an artifact.

func (ArtifactContent) MarshalJSON

func (v ArtifactContent) MarshalJSON() ([]byte, error)

type ArtifactLocation

type ArtifactLocation struct {
	// Description A short description of the artifact location.
	Description Message `json:"description,omitempty,omitzero"`
	// Index The index within the run artifacts array of the artifact object associated with the artifact location.
	Index int `json:"index,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the artifact location.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// URI A string containing a valid relative or absolute URI.
	URI string `json:"uri,omitempty,omitzero"`
	// URIBaseID A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted.
	URIBaseID string `json:"uriBaseId,omitempty,omitzero"`
}

ArtifactLocation Specifies the location of an artifact. Use NewArtifactLocation when constructing a value so schema defaults are initialized.

func NewArtifactLocation added in v0.1.1

func NewArtifactLocation() ArtifactLocation

NewArtifactLocation returns an initialized ArtifactLocation with the defaults defined by SARIF 2.1.0.

func (ArtifactLocation) MarshalJSON

func (v ArtifactLocation) MarshalJSON() ([]byte, error)

func (*ArtifactLocation) UnmarshalJSON

func (v *ArtifactLocation) UnmarshalJSON(data []byte) error

type Attachment

type Attachment struct {
	// ArtifactLocation The location of the attachment.
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	// Description A message describing the role played by the attachment.
	Description Message `json:"description,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the attachment.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Rectangles An array of rectangles specifying areas of interest within the image.
	Rectangles []Rectangle `json:"rectangles,omitempty,omitzero"`
	// Regions An array of regions of interest within the attachment.
	Regions []Region `json:"regions,omitempty,omitzero"`
}

Attachment An artifact relevant to a result. Use NewAttachment when constructing a value so schema defaults are initialized.

func NewAttachment added in v0.1.1

func NewAttachment() Attachment

NewAttachment returns an initialized Attachment with the defaults defined by SARIF 2.1.0.

func (Attachment) MarshalJSON

func (v Attachment) MarshalJSON() ([]byte, error)

func (*Attachment) UnmarshalJSON

func (v *Attachment) UnmarshalJSON(data []byte) error

type CodeFlow

type CodeFlow struct {
	// Message A message relevant to the code flow.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the code flow.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ThreadFlows An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.
	ThreadFlows []ThreadFlow `json:"threadFlows"`
}

CodeFlow A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.

func (CodeFlow) MarshalJSON

func (v CodeFlow) MarshalJSON() ([]byte, error)

type ConfigurationOverride

type ConfigurationOverride struct {
	// Configuration Specifies how the rule or notification was configured during the scan.
	Configuration ReportingConfiguration `json:"configuration"`
	// Descriptor A reference used to locate the descriptor whose configuration was overridden.
	Descriptor ReportingDescriptorReference `json:"descriptor"`
	// Properties Key/value pairs that provide additional information about the configuration override.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

ConfigurationOverride Information about how a specific rule or notification was reconfigured at runtime.

func (ConfigurationOverride) MarshalJSON

func (v ConfigurationOverride) MarshalJSON() ([]byte, error)

type Conversion

type Conversion struct {
	// AnalysisToolLogFiles The locations of the analysis tool's per-run log files.
	AnalysisToolLogFiles []ArtifactLocation `json:"analysisToolLogFiles,omitempty,omitzero"`
	// Invocation An invocation object that describes the invocation of the converter.
	Invocation Invocation `json:"invocation,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the conversion.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Tool A tool object that describes the converter.
	Tool Tool `json:"tool"`
}

Conversion Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. Use NewConversion when constructing a value so schema defaults are initialized.

func NewConversion added in v0.1.1

func NewConversion() Conversion

NewConversion returns an initialized Conversion with the defaults defined by SARIF 2.1.0.

func (Conversion) MarshalJSON

func (v Conversion) MarshalJSON() ([]byte, error)

func (*Conversion) UnmarshalJSON

func (v *Conversion) UnmarshalJSON(data []byte) error

type Edge

type Edge struct {
	// ID A string that uniquely identifies the edge within its graph.
	ID string `json:"id"`
	// Label A short description of the edge.
	Label Message `json:"label,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the edge.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// SourceNodeID Identifies the source node (the node at which the edge starts).
	SourceNodeID string `json:"sourceNodeId"`
	// TargetNodeID Identifies the target node (the node at which the edge ends).
	TargetNodeID string `json:"targetNodeId"`
}

Edge Represents a directed edge in a graph.

func (Edge) MarshalJSON

func (v Edge) MarshalJSON() ([]byte, error)

type EdgeTraversal

type EdgeTraversal struct {
	// EdgeID Identifies the edge being traversed.
	EdgeID string `json:"edgeId"`
	// FinalState The values of relevant expressions after the edge has been traversed.
	FinalState map[string]MultiformatMessageString `json:"finalState,omitempty,omitzero"`
	// Message A message to display to the user as the edge is traversed.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the edge traversal.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// StepOverEdgeCount The number of edge traversals necessary to return from a nested graph.
	StepOverEdgeCount int `json:"stepOverEdgeCount,omitempty,omitzero"`
}

EdgeTraversal Represents the traversal of a single edge during a graph traversal.

func (EdgeTraversal) MarshalJSON

func (v EdgeTraversal) MarshalJSON() ([]byte, error)

type Exception

type Exception struct {
	// InnerExceptions An array of exception objects each of which is considered a cause of this exception.
	InnerExceptions []Exception `json:"innerExceptions,omitempty,omitzero"`
	// Kind A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal.
	Kind string `json:"kind,omitempty,omitzero"`
	// Message A message that describes the exception.
	Message string `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the exception.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Stack The sequence of function calls leading to the exception.
	Stack Stack `json:"stack,omitempty,omitzero"`
}

Exception Describes a runtime exception encountered during the execution of an analysis tool. Use NewException when constructing a value so schema defaults are initialized.

func NewException added in v0.1.1

func NewException() Exception

NewException returns an initialized Exception with the defaults defined by SARIF 2.1.0.

func (Exception) MarshalJSON

func (v Exception) MarshalJSON() ([]byte, error)

func (*Exception) UnmarshalJSON

func (v *Exception) UnmarshalJSON(data []byte) error

type ExternalProperties

type ExternalProperties struct {
	// Addresses Addresses that will be merged with a separate run.
	Addresses []Address `json:"addresses,omitempty,omitzero"`
	// Artifacts An array of artifact objects that will be merged with a separate run.
	Artifacts []Artifact `json:"artifacts,omitempty,omitzero"`
	// Conversion A conversion object that will be merged with a separate run.
	Conversion Conversion `json:"conversion,omitempty,omitzero"`
	// Driver The analysis tool object that will be merged with a separate run.
	Driver ToolComponent `json:"driver,omitempty,omitzero"`
	// Extensions Tool extensions that will be merged with a separate run.
	Extensions []ToolComponent `json:"extensions,omitempty,omitzero"`
	// ExternalizedProperties Key/value pairs that provide additional information that will be merged with a separate run.
	ExternalizedProperties PropertyBag `json:"externalizedProperties,omitempty,omitzero"`
	// Graphs An array of graph objects that will be merged with a separate run.
	Graphs []Graph `json:"graphs,omitempty,omitzero"`
	// GUID A stable, unique identifer for this external properties object, in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// Invocations Describes the invocation of the analysis tool that will be merged with a separate run.
	Invocations []Invocation `json:"invocations,omitempty,omitzero"`
	// LogicalLocations An array of logical locations such as namespaces, types or functions that will be merged with a separate run.
	LogicalLocations []LogicalLocation `json:"logicalLocations,omitempty,omitzero"`
	// Policies Tool policies that will be merged with a separate run.
	Policies []ToolComponent `json:"policies,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the external properties.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Results An array of result objects that will be merged with a separate run.
	Results []Result `json:"results,omitempty,omitzero"`
	// RunGUID A stable, unique identifer for the run associated with this external properties object, in the form of a GUID.
	RunGUID string `json:"runGuid,omitempty,omitzero"`
	// Schema The URI of the JSON schema corresponding to the version of the external property file format.
	Schema string `json:"schema,omitempty,omitzero"`
	// Taxonomies Tool taxonomies that will be merged with a separate run.
	Taxonomies []ToolComponent `json:"taxonomies,omitempty,omitzero"`
	// ThreadFlowLocations An array of threadFlowLocation objects that will be merged with a separate run.
	ThreadFlowLocations []ThreadFlowLocation `json:"threadFlowLocations,omitempty,omitzero"`
	// Translations Tool translations that will be merged with a separate run.
	Translations []ToolComponent `json:"translations,omitempty,omitzero"`
	// Version The SARIF format version of this external properties object.
	Version string `json:"version,omitempty,omitzero"`
	// WebRequests Requests that will be merged with a separate run.
	WebRequests []WebRequest `json:"webRequests,omitempty,omitzero"`
	// WebResponses Responses that will be merged with a separate run.
	WebResponses []WebResponse `json:"webResponses,omitempty,omitzero"`
}

ExternalProperties The top-level element of an external property file. Use NewExternalProperties when constructing a value so schema defaults are initialized.

func NewExternalProperties added in v0.1.1

func NewExternalProperties() ExternalProperties

NewExternalProperties returns an initialized ExternalProperties with the defaults defined by SARIF 2.1.0.

func (ExternalProperties) MarshalJSON

func (v ExternalProperties) MarshalJSON() ([]byte, error)

func (*ExternalProperties) UnmarshalJSON

func (v *ExternalProperties) UnmarshalJSON(data []byte) error

type ExternalPropertyFileReference

type ExternalPropertyFileReference struct {
	// GUID A stable, unique identifer for the external property file in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// ItemCount A non-negative integer specifying the number of items contained in the external property file.
	ItemCount int `json:"itemCount,omitempty,omitzero"`
	// Location The location of the external property file.
	Location ArtifactLocation `json:"location,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the external property file.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

ExternalPropertyFileReference Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. Use NewExternalPropertyFileReference when constructing a value so schema defaults are initialized.

func NewExternalPropertyFileReference added in v0.1.1

func NewExternalPropertyFileReference() ExternalPropertyFileReference

NewExternalPropertyFileReference returns an initialized ExternalPropertyFileReference with the defaults defined by SARIF 2.1.0.

func (ExternalPropertyFileReference) MarshalJSON

func (v ExternalPropertyFileReference) MarshalJSON() ([]byte, error)

func (*ExternalPropertyFileReference) UnmarshalJSON

func (v *ExternalPropertyFileReference) UnmarshalJSON(data []byte) error

type ExternalPropertyFileReferences

type ExternalPropertyFileReferences struct {
	// Addresses An array of external property files containing run.addresses arrays to be merged with the root log file.
	Addresses []ExternalPropertyFileReference `json:"addresses,omitempty,omitzero"`
	// Artifacts An array of external property files containing run.artifacts arrays to be merged with the root log file.
	Artifacts []ExternalPropertyFileReference `json:"artifacts,omitempty,omitzero"`
	// Conversion An external property file containing a run.conversion object to be merged with the root log file.
	Conversion ExternalPropertyFileReference `json:"conversion,omitempty,omitzero"`
	// Driver An external property file containing a run.driver object to be merged with the root log file.
	Driver ExternalPropertyFileReference `json:"driver,omitempty,omitzero"`
	// Extensions An array of external property files containing run.extensions arrays to be merged with the root log file.
	Extensions []ExternalPropertyFileReference `json:"extensions,omitempty,omitzero"`
	// ExternalizedProperties An external property file containing a run.properties object to be merged with the root log file.
	ExternalizedProperties ExternalPropertyFileReference `json:"externalizedProperties,omitempty,omitzero"`
	// Graphs An array of external property files containing a run.graphs object to be merged with the root log file.
	Graphs []ExternalPropertyFileReference `json:"graphs,omitempty,omitzero"`
	// Invocations An array of external property files containing run.invocations arrays to be merged with the root log file.
	Invocations []ExternalPropertyFileReference `json:"invocations,omitempty,omitzero"`
	// LogicalLocations An array of external property files containing run.logicalLocations arrays to be merged with the root log file.
	LogicalLocations []ExternalPropertyFileReference `json:"logicalLocations,omitempty,omitzero"`
	// Policies An array of external property files containing run.policies arrays to be merged with the root log file.
	Policies []ExternalPropertyFileReference `json:"policies,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the external property files.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Results An array of external property files containing run.results arrays to be merged with the root log file.
	Results []ExternalPropertyFileReference `json:"results,omitempty,omitzero"`
	// Taxonomies An array of external property files containing run.taxonomies arrays to be merged with the root log file.
	Taxonomies []ExternalPropertyFileReference `json:"taxonomies,omitempty,omitzero"`
	// ThreadFlowLocations An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.
	ThreadFlowLocations []ExternalPropertyFileReference `json:"threadFlowLocations,omitempty,omitzero"`
	// Translations An array of external property files containing run.translations arrays to be merged with the root log file.
	Translations []ExternalPropertyFileReference `json:"translations,omitempty,omitzero"`
	// WebRequests An array of external property files containing run.requests arrays to be merged with the root log file.
	WebRequests []ExternalPropertyFileReference `json:"webRequests,omitempty,omitzero"`
	// WebResponses An array of external property files containing run.responses arrays to be merged with the root log file.
	WebResponses []ExternalPropertyFileReference `json:"webResponses,omitempty,omitzero"`
}

ExternalPropertyFileReferences References to external property files that should be inlined with the content of a root log file. Use NewExternalPropertyFileReferences when constructing a value so schema defaults are initialized.

func NewExternalPropertyFileReferences added in v0.1.1

func NewExternalPropertyFileReferences() ExternalPropertyFileReferences

NewExternalPropertyFileReferences returns an initialized ExternalPropertyFileReferences with the defaults defined by SARIF 2.1.0.

func (ExternalPropertyFileReferences) MarshalJSON

func (v ExternalPropertyFileReferences) MarshalJSON() ([]byte, error)

func (*ExternalPropertyFileReferences) UnmarshalJSON

func (v *ExternalPropertyFileReferences) UnmarshalJSON(data []byte) error

type Fix

type Fix struct {
	// ArtifactChanges One or more artifact changes that comprise a fix for a result.
	ArtifactChanges []ArtifactChange `json:"artifactChanges"`
	// Description A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.
	Description Message `json:"description,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the fix.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Fix A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.

func (Fix) MarshalJSON

func (v Fix) MarshalJSON() ([]byte, error)

type Graph

type Graph struct {
	// Description A description of the graph.
	Description Message `json:"description,omitempty,omitzero"`
	// Edges An array of edge objects representing the edges of the graph.
	Edges []Edge `json:"edges,omitempty,omitzero"`
	// Nodes An array of node objects representing the nodes of the graph.
	Nodes []Node `json:"nodes,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the graph.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Graph A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph). Use NewGraph when constructing a value so schema defaults are initialized.

func NewGraph added in v0.1.1

func NewGraph() Graph

NewGraph returns an initialized Graph with the defaults defined by SARIF 2.1.0.

func (Graph) MarshalJSON

func (v Graph) MarshalJSON() ([]byte, error)

func (*Graph) UnmarshalJSON

func (v *Graph) UnmarshalJSON(data []byte) error

type GraphTraversal

type GraphTraversal struct {
	// Description A description of this graph traversal.
	Description Message `json:"description,omitempty,omitzero"`
	// EdgeTraversals The sequences of edges traversed by this graph traversal.
	EdgeTraversals []EdgeTraversal `json:"edgeTraversals,omitempty,omitzero"`
	// ImmutableState Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
	ImmutableState map[string]MultiformatMessageString `json:"immutableState,omitempty,omitzero"`
	// InitialState Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
	InitialState map[string]MultiformatMessageString `json:"initialState,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the graph traversal.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ResultGraphIndex The index within the result.graphs to be associated with the result.
	ResultGraphIndex int `json:"resultGraphIndex,omitempty,omitzero"`
	// RunGraphIndex The index within the run.graphs to be associated with the result.
	RunGraphIndex int `json:"runGraphIndex,omitempty,omitzero"`
}

GraphTraversal Represents a path through a graph. Use NewGraphTraversal when constructing a value so schema defaults are initialized.

func NewGraphTraversal added in v0.1.1

func NewGraphTraversal() GraphTraversal

NewGraphTraversal returns an initialized GraphTraversal with the defaults defined by SARIF 2.1.0.

func (GraphTraversal) MarshalJSON

func (v GraphTraversal) MarshalJSON() ([]byte, error)

func (*GraphTraversal) UnmarshalJSON

func (v *GraphTraversal) UnmarshalJSON(data []byte) error

type Invocation

type Invocation struct {
	// Account The account that ran the analysis tool.
	Account string `json:"account,omitempty,omitzero"`
	// Arguments An array of strings, containing in order the command line arguments passed to the tool from the operating system.
	Arguments []string `json:"arguments,omitempty,omitzero"`
	// CommandLine The command line used to invoke the tool.
	CommandLine string `json:"commandLine,omitempty,omitzero"`
	// EndTimeUtc The Coordinated Universal Time (UTC) date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format.
	EndTimeUtc string `json:"endTimeUtc,omitempty,omitzero"`
	// EnvironmentVariables The environment variables associated with the analysis tool process, expressed as key/value pairs.
	EnvironmentVariables map[string]string `json:"environmentVariables,omitempty,omitzero"`
	// ExecutableLocation An absolute URI specifying the location of the analysis tool's executable.
	ExecutableLocation ArtifactLocation `json:"executableLocation,omitempty,omitzero"`
	// ExecutionSuccessful Specifies whether the tool's execution completed successfully.
	ExecutionSuccessful bool `json:"executionSuccessful"`
	// ExitCode The process exit code.
	ExitCode int `json:"exitCode,omitempty,omitzero"`
	// ExitCodeDescription The reason for the process exit.
	ExitCodeDescription string `json:"exitCodeDescription,omitempty,omitzero"`
	// ExitSignalName The name of the signal that caused the process to exit.
	ExitSignalName string `json:"exitSignalName,omitempty,omitzero"`
	// ExitSignalNumber The numeric value of the signal that caused the process to exit.
	ExitSignalNumber int `json:"exitSignalNumber,omitempty,omitzero"`
	// Machine The machine that hosted the analysis tool run.
	Machine string `json:"machine,omitempty,omitzero"`
	// NotificationConfigurationOverrides An array of configurationOverride objects that describe notifications related runtime overrides.
	NotificationConfigurationOverrides []ConfigurationOverride `json:"notificationConfigurationOverrides,omitempty,omitzero"`
	// ProcessID The process id for the analysis tool run.
	ProcessID int `json:"processId,omitempty,omitzero"`
	// ProcessStartFailureMessage The reason given by the operating system that the process failed to start.
	ProcessStartFailureMessage string `json:"processStartFailureMessage,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the invocation.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ResponseFiles The locations of any response files specified on the tool's command line.
	ResponseFiles []ArtifactLocation `json:"responseFiles,omitempty,omitzero"`
	// RuleConfigurationOverrides An array of configurationOverride objects that describe rules related runtime overrides.
	RuleConfigurationOverrides []ConfigurationOverride `json:"ruleConfigurationOverrides,omitempty,omitzero"`
	// StartTimeUtc The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format.
	StartTimeUtc string `json:"startTimeUtc,omitempty,omitzero"`
	// Stderr A file containing the standard error stream from the process that was invoked.
	Stderr ArtifactLocation `json:"stderr,omitempty,omitzero"`
	// Stdin A file containing the standard input stream to the process that was invoked.
	Stdin ArtifactLocation `json:"stdin,omitempty,omitzero"`
	// Stdout A file containing the standard output stream from the process that was invoked.
	Stdout ArtifactLocation `json:"stdout,omitempty,omitzero"`
	// StdoutStderr A file containing the interleaved standard output and standard error stream from the process that was invoked.
	StdoutStderr ArtifactLocation `json:"stdoutStderr,omitempty,omitzero"`
	// ToolConfigurationNotifications A list of conditions detected by the tool that are relevant to the tool's configuration.
	ToolConfigurationNotifications []Notification `json:"toolConfigurationNotifications,omitempty,omitzero"`
	// ToolExecutionNotifications A list of runtime conditions detected by the tool during the analysis.
	ToolExecutionNotifications []Notification `json:"toolExecutionNotifications,omitempty,omitzero"`
	// WorkingDirectory The working directory for the analysis tool run.
	WorkingDirectory ArtifactLocation `json:"workingDirectory,omitempty,omitzero"`
}

Invocation The runtime environment of the analysis tool run. Use NewInvocation when constructing a value so schema defaults are initialized.

func NewInvocation added in v0.1.1

func NewInvocation() Invocation

NewInvocation returns an initialized Invocation with the defaults defined by SARIF 2.1.0.

func (Invocation) MarshalJSON

func (v Invocation) MarshalJSON() ([]byte, error)

func (*Invocation) UnmarshalJSON

func (v *Invocation) UnmarshalJSON(data []byte) error

type Location

type Location struct {
	// Annotations A set of regions relevant to the location.
	Annotations []Region `json:"annotations,omitempty,omitzero"`
	// ID Value that distinguishes this location from all other locations within a single result object.
	ID int `json:"id,omitempty,omitzero"`
	// LogicalLocations The logical locations associated with the result.
	LogicalLocations []LogicalLocation `json:"logicalLocations,omitempty,omitzero"`
	// Message A message relevant to the location.
	Message Message `json:"message,omitempty,omitzero"`
	// PhysicalLocation Identifies the artifact and region.
	PhysicalLocation PhysicalLocation `json:"physicalLocation,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the location.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Relationships An array of objects that describe relationships between this location and others.
	Relationships []LocationRelationship `json:"relationships,omitempty,omitzero"`
}

Location A location within a programming artifact. Use NewLocation when constructing a value so schema defaults are initialized.

func NewLocation added in v0.1.1

func NewLocation() Location

NewLocation returns an initialized Location with the defaults defined by SARIF 2.1.0.

func (Location) MarshalJSON

func (v Location) MarshalJSON() ([]byte, error)

func (*Location) UnmarshalJSON

func (v *Location) UnmarshalJSON(data []byte) error

type LocationRelationship

type LocationRelationship struct {
	// Description A description of the location relationship.
	Description Message `json:"description,omitempty,omitzero"`
	// Kinds A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.
	Kinds []string `json:"kinds,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the location relationship.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Target A reference to the related location.
	Target int `json:"target"`
}

LocationRelationship Information about the relation of one location to another. Use NewLocationRelationship when constructing a value so schema defaults are initialized.

func NewLocationRelationship added in v0.1.1

func NewLocationRelationship() LocationRelationship

NewLocationRelationship returns an initialized LocationRelationship with the defaults defined by SARIF 2.1.0.

func (LocationRelationship) MarshalJSON

func (v LocationRelationship) MarshalJSON() ([]byte, error)

func (*LocationRelationship) UnmarshalJSON

func (v *LocationRelationship) UnmarshalJSON(data []byte) error

type Log

type Log struct {
	// SchemaURI The URI of the JSON schema corresponding to the version.
	SchemaURI string `json:"$schema,omitempty,omitzero"`
	// InlineExternalProperties References to external property files that share data between runs.
	InlineExternalProperties []ExternalProperties `json:"inlineExternalProperties,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the log file.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Runs The set of runs contained in this log file.
	Runs []Run `json:"runs"`
	// Version The SARIF format version of this log file.
	Version string `json:"version"`
}

Log Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.

func Load

func Load(path string) (*Log, error)

Load reads a SARIF log from path.

func Parse

func Parse(data []byte) (*Log, error)

Parse decodes a SARIF log from JSON.

func (Log) MarshalJSON

func (v Log) MarshalJSON() ([]byte, error)

type LogicalLocation

type LogicalLocation struct {
	// DecoratedName The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.
	DecoratedName string `json:"decoratedName,omitempty,omitzero"`
	// FullyQualifiedName The human-readable fully qualified name of the logical location.
	FullyQualifiedName string `json:"fullyQualifiedName,omitempty,omitzero"`
	// Index The index within the logical locations array.
	Index int `json:"index,omitempty,omitzero"`
	// Kind The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.
	Kind string `json:"kind,omitempty,omitzero"`
	// Name Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.
	Name string `json:"name,omitempty,omitzero"`
	// ParentIndex Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.
	ParentIndex int `json:"parentIndex,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the logical location.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

LogicalLocation A logical location of a construct that produced a result. Use NewLogicalLocation when constructing a value so schema defaults are initialized.

func NewLogicalLocation added in v0.1.1

func NewLogicalLocation() LogicalLocation

NewLogicalLocation returns an initialized LogicalLocation with the defaults defined by SARIF 2.1.0.

func (LogicalLocation) MarshalJSON

func (v LogicalLocation) MarshalJSON() ([]byte, error)

func (*LogicalLocation) UnmarshalJSON

func (v *LogicalLocation) UnmarshalJSON(data []byte) error

type Message

type Message struct {
	// Arguments An array of strings to substitute into the message string.
	Arguments []string `json:"arguments,omitempty,omitzero"`
	// ID The identifier for this message.
	ID string `json:"id,omitempty,omitzero"`
	// Markdown A Markdown message string.
	Markdown string `json:"markdown,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the message.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Text A plain text message string.
	Text string `json:"text,omitempty,omitzero"`
}

Message Encapsulates a message intended to be read by the end user. Use NewMessage when constructing a value so schema defaults are initialized.

func NewMessage added in v0.1.1

func NewMessage() Message

NewMessage returns an initialized Message with the defaults defined by SARIF 2.1.0.

func (Message) MarshalJSON

func (v Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (v *Message) UnmarshalJSON(data []byte) error

type MultiformatMessageString

type MultiformatMessageString struct {
	// Markdown A Markdown message string or format string.
	Markdown string `json:"markdown,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the message.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Text A plain text message string or format string.
	Text string `json:"text"`
}

MultiformatMessageString A message string or message format string rendered in multiple formats.

func (MultiformatMessageString) MarshalJSON

func (v MultiformatMessageString) MarshalJSON() ([]byte, error)

type Node

type Node struct {
	// Children Array of child nodes.
	Children []Node `json:"children,omitempty,omitzero"`
	// ID A string that uniquely identifies the node within its graph.
	ID string `json:"id"`
	// Label A short description of the node.
	Label Message `json:"label,omitempty,omitzero"`
	// Location A code location associated with the node.
	Location Location `json:"location,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the node.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Node Represents a node in a graph. Use NewNode when constructing a value so schema defaults are initialized.

func NewNode added in v0.1.1

func NewNode() Node

NewNode returns an initialized Node with the defaults defined by SARIF 2.1.0.

func (Node) MarshalJSON

func (v Node) MarshalJSON() ([]byte, error)

func (*Node) UnmarshalJSON

func (v *Node) UnmarshalJSON(data []byte) error

type Notification

type Notification struct {
	// AssociatedRule A reference used to locate the rule descriptor associated with this notification.
	AssociatedRule ReportingDescriptorReference `json:"associatedRule,omitempty,omitzero"`
	// Descriptor A reference used to locate the descriptor relevant to this notification.
	Descriptor ReportingDescriptorReference `json:"descriptor,omitempty,omitzero"`
	// Exception The runtime exception, if any, relevant to this notification.
	Exception Exception `json:"exception,omitempty,omitzero"`
	// Level A value specifying the severity level of the notification.
	Level string `json:"level,omitempty,omitzero"`
	// Locations The locations relevant to this notification.
	Locations []Location `json:"locations,omitempty,omitzero"`
	// Message A message that describes the condition that was encountered.
	Message Message `json:"message"`
	// Properties Key/value pairs that provide additional information about the notification.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ThreadID The thread identifier of the code that generated the notification.
	ThreadID int `json:"threadId,omitempty,omitzero"`
	// TimeUtc The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.
	TimeUtc string `json:"timeUtc,omitempty,omitzero"`
}

Notification Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool. Use NewNotification when constructing a value so schema defaults are initialized.

func NewNotification added in v0.1.1

func NewNotification() Notification

NewNotification returns an initialized Notification with the defaults defined by SARIF 2.1.0.

func (Notification) MarshalJSON

func (v Notification) MarshalJSON() ([]byte, error)

func (*Notification) UnmarshalJSON

func (v *Notification) UnmarshalJSON(data []byte) error

type PhysicalLocation

type PhysicalLocation struct {
	// Address The address of the location.
	Address Address `json:"address,omitempty,omitzero"`
	// ArtifactLocation The location of the artifact.
	ArtifactLocation ArtifactLocation `json:"artifactLocation,omitempty,omitzero"`
	// ContextRegion Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.
	ContextRegion Region `json:"contextRegion,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the physical location.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Region Specifies a portion of the artifact.
	Region Region `json:"region,omitempty,omitzero"`
}

PhysicalLocation A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.

func (PhysicalLocation) MarshalJSON

func (v PhysicalLocation) MarshalJSON() ([]byte, error)

type PropertyBag

type PropertyBag map[string]any

PropertyBag contains arbitrary extension properties.

type Rectangle

type Rectangle struct {
	// Bottom The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.
	Bottom float64 `json:"bottom,omitempty,omitzero"`
	// Left The X coordinate of the left edge of the rectangle, measured in the image's natural units.
	Left float64 `json:"left,omitempty,omitzero"`
	// Message A message relevant to the rectangle.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the rectangle.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Right The X coordinate of the right edge of the rectangle, measured in the image's natural units.
	Right float64 `json:"right,omitempty,omitzero"`
	// Top The Y coordinate of the top edge of the rectangle, measured in the image's natural units.
	Top float64 `json:"top,omitempty,omitzero"`
}

Rectangle An area within an image.

func (Rectangle) MarshalJSON

func (v Rectangle) MarshalJSON() ([]byte, error)

type Region

type Region struct {
	// ByteLength The length of the region in bytes.
	ByteLength int `json:"byteLength,omitempty,omitzero"`
	// ByteOffset The zero-based offset from the beginning of the artifact of the first byte in the region.
	ByteOffset int `json:"byteOffset,omitempty,omitzero"`
	// CharLength The length of the region in characters.
	CharLength int `json:"charLength,omitempty,omitzero"`
	// CharOffset The zero-based offset from the beginning of the artifact of the first character in the region.
	CharOffset int `json:"charOffset,omitempty,omitzero"`
	// EndColumn The column number of the character following the end of the region.
	EndColumn int `json:"endColumn,omitempty,omitzero"`
	// EndLine The line number of the last character in the region.
	EndLine int `json:"endLine,omitempty,omitzero"`
	// Message A message relevant to the region.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the region.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Snippet The portion of the artifact contents within the specified region.
	Snippet ArtifactContent `json:"snippet,omitempty,omitzero"`
	// SourceLanguage Specifies the source language, if any, of the portion of the artifact specified by the region object.
	SourceLanguage string `json:"sourceLanguage,omitempty,omitzero"`
	// StartColumn The column number of the first character in the region.
	StartColumn int `json:"startColumn,omitempty,omitzero"`
	// StartLine The line number of the first character in the region.
	StartLine int `json:"startLine,omitempty,omitzero"`
}

Region A region within an artifact where a result was detected. Use NewRegion when constructing a value so schema defaults are initialized.

func NewRegion added in v0.1.1

func NewRegion() Region

NewRegion returns an initialized Region with the defaults defined by SARIF 2.1.0.

func (Region) MarshalJSON

func (v Region) MarshalJSON() ([]byte, error)

func (*Region) UnmarshalJSON

func (v *Region) UnmarshalJSON(data []byte) error

type Replacement

type Replacement struct {
	// DeletedRegion The region of the artifact to delete.
	DeletedRegion Region `json:"deletedRegion"`
	// InsertedContent The content to insert at the location specified by the 'deletedRegion' property.
	InsertedContent ArtifactContent `json:"insertedContent,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the replacement.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Replacement The replacement of a single region of an artifact.

func (Replacement) MarshalJSON

func (v Replacement) MarshalJSON() ([]byte, error)

type ReportingConfiguration

type ReportingConfiguration struct {
	// Enabled Specifies whether the report may be produced during the scan.
	Enabled bool `json:"enabled,omitempty,omitzero"`
	// Level Specifies the failure level for the report.
	Level string `json:"level,omitempty,omitzero"`
	// Parameters Contains configuration information specific to a report.
	Parameters PropertyBag `json:"parameters,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the reporting configuration.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Rank Specifies the relative priority of the report. Used for analysis output only.
	Rank float64 `json:"rank,omitempty,omitzero"`
}

ReportingConfiguration Information about a rule or notification that can be configured at runtime. Use NewReportingConfiguration when constructing a value so schema defaults are initialized.

func NewReportingConfiguration added in v0.1.1

func NewReportingConfiguration() ReportingConfiguration

NewReportingConfiguration returns an initialized ReportingConfiguration with the defaults defined by SARIF 2.1.0.

func (ReportingConfiguration) MarshalJSON

func (v ReportingConfiguration) MarshalJSON() ([]byte, error)

func (*ReportingConfiguration) UnmarshalJSON

func (v *ReportingConfiguration) UnmarshalJSON(data []byte) error

type ReportingDescriptor

type ReportingDescriptor struct {
	// DefaultConfiguration Default reporting configuration information.
	DefaultConfiguration ReportingConfiguration `json:"defaultConfiguration,omitempty,omitzero"`
	// DeprecatedGuids An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.
	DeprecatedGuids []string `json:"deprecatedGuids,omitempty,omitzero"`
	// DeprecatedIDs An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.
	DeprecatedIDs []string `json:"deprecatedIds,omitempty,omitzero"`
	// DeprecatedNames An array of readable identifiers by which this report was known in some previous version of the analysis tool.
	DeprecatedNames []string `json:"deprecatedNames,omitempty,omitzero"`
	// FullDescription A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.
	FullDescription MultiformatMessageString `json:"fullDescription,omitempty,omitzero"`
	// GUID A unique identifer for the reporting descriptor in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// Help Provides the primary documentation for the report, useful when there is no online documentation.
	Help MultiformatMessageString `json:"help,omitempty,omitzero"`
	// HelpURI A URI where the primary documentation for the report can be found.
	HelpURI string `json:"helpUri,omitempty,omitzero"`
	// ID A stable, opaque identifier for the report.
	ID string `json:"id"`
	// MessageStrings A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.
	MessageStrings map[string]MultiformatMessageString `json:"messageStrings,omitempty,omitzero"`
	// Name A report identifier that is understandable to an end user.
	Name string `json:"name,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the report.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Relationships An array of objects that describe relationships between this reporting descriptor and others.
	Relationships []ReportingDescriptorRelationship `json:"relationships,omitempty,omitzero"`
	// ShortDescription A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.
	ShortDescription MultiformatMessageString `json:"shortDescription,omitempty,omitzero"`
}

ReportingDescriptor Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting. Use NewReportingDescriptor when constructing a value so schema defaults are initialized.

func NewReportingDescriptor added in v0.1.1

func NewReportingDescriptor() ReportingDescriptor

NewReportingDescriptor returns an initialized ReportingDescriptor with the defaults defined by SARIF 2.1.0.

func (ReportingDescriptor) MarshalJSON

func (v ReportingDescriptor) MarshalJSON() ([]byte, error)

func (*ReportingDescriptor) UnmarshalJSON

func (v *ReportingDescriptor) UnmarshalJSON(data []byte) error

type ReportingDescriptorReference

type ReportingDescriptorReference struct {
	// GUID A guid that uniquely identifies the descriptor.
	GUID string `json:"guid,omitempty,omitzero"`
	// ID The id of the descriptor.
	ID string `json:"id,omitempty,omitzero"`
	// Index The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.
	Index int `json:"index,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the reporting descriptor reference.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ToolComponent A reference used to locate the toolComponent associated with the descriptor.
	ToolComponent ToolComponentReference `json:"toolComponent,omitempty,omitzero"`
}

ReportingDescriptorReference Information about how to locate a relevant reporting descriptor. Use NewReportingDescriptorReference when constructing a value so schema defaults are initialized.

func NewReportingDescriptorReference added in v0.1.1

func NewReportingDescriptorReference() ReportingDescriptorReference

NewReportingDescriptorReference returns an initialized ReportingDescriptorReference with the defaults defined by SARIF 2.1.0.

func (ReportingDescriptorReference) MarshalJSON

func (v ReportingDescriptorReference) MarshalJSON() ([]byte, error)

func (*ReportingDescriptorReference) UnmarshalJSON

func (v *ReportingDescriptorReference) UnmarshalJSON(data []byte) error

type ReportingDescriptorRelationship

type ReportingDescriptorRelationship struct {
	// Description A description of the reporting descriptor relationship.
	Description Message `json:"description,omitempty,omitzero"`
	// Kinds A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.
	Kinds []string `json:"kinds,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the reporting descriptor reference.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Target A reference to the related reporting descriptor.
	Target ReportingDescriptorReference `json:"target"`
}

ReportingDescriptorRelationship Information about the relation of one reporting descriptor to another. Use NewReportingDescriptorRelationship when constructing a value so schema defaults are initialized.

func NewReportingDescriptorRelationship added in v0.1.1

func NewReportingDescriptorRelationship() ReportingDescriptorRelationship

NewReportingDescriptorRelationship returns an initialized ReportingDescriptorRelationship with the defaults defined by SARIF 2.1.0.

func (ReportingDescriptorRelationship) MarshalJSON

func (v ReportingDescriptorRelationship) MarshalJSON() ([]byte, error)

func (*ReportingDescriptorRelationship) UnmarshalJSON

func (v *ReportingDescriptorRelationship) UnmarshalJSON(data []byte) error

type Result

type Result struct {
	// AnalysisTarget Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.
	AnalysisTarget ArtifactLocation `json:"analysisTarget,omitempty,omitzero"`
	// Attachments A set of artifacts relevant to the result.
	Attachments []Attachment `json:"attachments,omitempty,omitzero"`
	// BaselineState The state of a result relative to a baseline of a previous run.
	BaselineState string `json:"baselineState,omitempty,omitzero"`
	// CodeFlows An array of 'codeFlow' objects relevant to the result.
	CodeFlows []CodeFlow `json:"codeFlows,omitempty,omitzero"`
	// CorrelationGUID A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.
	CorrelationGUID string `json:"correlationGuid,omitempty,omitzero"`
	// Fingerprints A set of strings each of which individually defines a stable, unique identity for the result.
	Fingerprints map[string]string `json:"fingerprints,omitempty,omitzero"`
	// Fixes An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.
	Fixes []Fix `json:"fixes,omitempty,omitzero"`
	// GraphTraversals An array of one or more unique 'graphTraversal' objects.
	GraphTraversals []GraphTraversal `json:"graphTraversals,omitempty,omitzero"`
	// Graphs An array of zero or more unique graph objects associated with the result.
	Graphs []Graph `json:"graphs,omitempty,omitzero"`
	// GUID A stable, unique identifer for the result in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// HostedViewerURI An absolute URI at which the result can be viewed.
	HostedViewerURI string `json:"hostedViewerUri,omitempty,omitzero"`
	// Kind A value that categorizes results by evaluation state.
	Kind string `json:"kind,omitempty,omitzero"`
	// Level A value specifying the severity level of the result.
	Level string `json:"level,omitempty,omitzero"`
	// Locations The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.
	Locations []Location `json:"locations,omitempty,omitzero"`
	// Message A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.
	Message Message `json:"message"`
	// OccurrenceCount A positive integer specifying the number of times this logically unique result was observed in this run.
	OccurrenceCount int `json:"occurrenceCount,omitempty,omitzero"`
	// PartialFingerprints A set of strings that contribute to the stable, unique identity of the result.
	PartialFingerprints map[string]string `json:"partialFingerprints,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the result.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Provenance Information about how and when the result was detected.
	Provenance ResultProvenance `json:"provenance,omitempty,omitzero"`
	// Rank A number representing the priority or importance of the result.
	Rank float64 `json:"rank,omitempty,omitzero"`
	// RelatedLocations A set of locations relevant to this result.
	RelatedLocations []Location `json:"relatedLocations,omitempty,omitzero"`
	// Rule A reference used to locate the rule descriptor relevant to this result.
	Rule ReportingDescriptorReference `json:"rule,omitempty,omitzero"`
	// RuleID The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists.
	RuleID string `json:"ruleId,omitempty,omitzero"`
	// RuleIndex The index within the tool component rules array of the rule object associated with this result.
	RuleIndex int `json:"ruleIndex,omitempty,omitzero"`
	// Stacks An array of 'stack' objects relevant to the result.
	Stacks []Stack `json:"stacks,omitempty,omitzero"`
	// Suppressions A set of suppressions relevant to this result.
	Suppressions []Suppression `json:"suppressions,omitempty,omitzero"`
	// Taxa An array of references to taxonomy reporting descriptors that are applicable to the result.
	Taxa []ReportingDescriptorReference `json:"taxa,omitempty,omitzero"`
	// WebRequest A web request associated with this result.
	WebRequest WebRequest `json:"webRequest,omitempty,omitzero"`
	// WebResponse A web response associated with this result.
	WebResponse WebResponse `json:"webResponse,omitempty,omitzero"`
	// WorkItemURIs The URIs of the work items associated with this result.
	WorkItemURIs []string `json:"workItemUris,omitempty,omitzero"`
}

Result A result produced by an analysis tool. Use NewResult when constructing a value so schema defaults are initialized.

func NewResult added in v0.1.1

func NewResult() Result

NewResult returns an initialized Result with the defaults defined by SARIF 2.1.0.

func (Result) MarshalJSON

func (v Result) MarshalJSON() ([]byte, error)

func (*Result) UnmarshalJSON

func (v *Result) UnmarshalJSON(data []byte) error

type ResultProvenance

type ResultProvenance struct {
	// ConversionSources An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.
	ConversionSources []PhysicalLocation `json:"conversionSources,omitempty,omitzero"`
	// FirstDetectionRunGUID A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.
	FirstDetectionRunGUID string `json:"firstDetectionRunGuid,omitempty,omitzero"`
	// FirstDetectionTimeUtc The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format.
	FirstDetectionTimeUtc string `json:"firstDetectionTimeUtc,omitempty,omitzero"`
	// InvocationIndex The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.
	InvocationIndex int `json:"invocationIndex,omitempty,omitzero"`
	// LastDetectionRunGUID A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.
	LastDetectionRunGUID string `json:"lastDetectionRunGuid,omitempty,omitzero"`
	// LastDetectionTimeUtc The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format.
	LastDetectionTimeUtc string `json:"lastDetectionTimeUtc,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the result.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

ResultProvenance Contains information about how and when a result was detected. Use NewResultProvenance when constructing a value so schema defaults are initialized.

func NewResultProvenance added in v0.1.1

func NewResultProvenance() ResultProvenance

NewResultProvenance returns an initialized ResultProvenance with the defaults defined by SARIF 2.1.0.

func (ResultProvenance) MarshalJSON

func (v ResultProvenance) MarshalJSON() ([]byte, error)

func (*ResultProvenance) UnmarshalJSON

func (v *ResultProvenance) UnmarshalJSON(data []byte) error

type Run

type Run struct {
	// Addresses Addresses associated with this run instance, if any.
	Addresses []Address `json:"addresses,omitempty,omitzero"`
	// Artifacts An array of artifact objects relevant to the run.
	Artifacts []Artifact `json:"artifacts,omitempty,omitzero"`
	// AutomationDetails Automation details that describe this run.
	AutomationDetails RunAutomationDetails `json:"automationDetails,omitempty,omitzero"`
	// BaselineGUID The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.
	BaselineGUID string `json:"baselineGuid,omitempty,omitzero"`
	// ColumnKind Specifies the unit in which the tool measures columns.
	ColumnKind string `json:"columnKind,omitempty,omitzero"`
	// Conversion A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.
	Conversion Conversion `json:"conversion,omitempty,omitzero"`
	// DefaultEncoding Specifies the default encoding for any artifact object that refers to a text file.
	DefaultEncoding string `json:"defaultEncoding,omitempty,omitzero"`
	// DefaultSourceLanguage Specifies the default source language for any artifact object that refers to a text file that contains source code.
	DefaultSourceLanguage string `json:"defaultSourceLanguage,omitempty,omitzero"`
	// ExternalPropertyFileReferences References to external property files that should be inlined with the content of a root log file.
	ExternalPropertyFileReferences ExternalPropertyFileReferences `json:"externalPropertyFileReferences,omitempty,omitzero"`
	// Graphs An array of zero or more unique graph objects associated with the run.
	Graphs []Graph `json:"graphs,omitempty,omitzero"`
	// Invocations Describes the invocation of the analysis tool.
	Invocations []Invocation `json:"invocations,omitempty,omitzero"`
	// Language The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).
	Language string `json:"language,omitempty,omitzero"`
	// LogicalLocations An array of logical locations such as namespaces, types or functions.
	LogicalLocations []LogicalLocation `json:"logicalLocations,omitempty,omitzero"`
	// NewlineSequences An ordered list of character sequences that were treated as line breaks when computing region information for the run.
	NewlineSequences []string `json:"newlineSequences,omitempty,omitzero"`
	// OriginalURIBaseIDs The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.
	OriginalURIBaseIDs map[string]ArtifactLocation `json:"originalUriBaseIds,omitempty,omitzero"`
	// Policies Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).
	Policies []ToolComponent `json:"policies,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the run.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// RedactionTokens An array of strings used to replace sensitive information in a redaction-aware property.
	RedactionTokens []string `json:"redactionTokens,omitempty,omitzero"`
	// Results The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.
	Results []Result `json:"results,omitempty,omitzero"`
	// RunAggregates Automation details that describe the aggregate of runs to which this run belongs.
	RunAggregates []RunAutomationDetails `json:"runAggregates,omitempty,omitzero"`
	// SpecialLocations A specialLocations object that defines locations of special significance to SARIF consumers.
	SpecialLocations SpecialLocations `json:"specialLocations,omitempty,omitzero"`
	// Taxonomies An array of toolComponent objects relevant to a taxonomy in which results are categorized.
	Taxonomies []ToolComponent `json:"taxonomies,omitempty,omitzero"`
	// ThreadFlowLocations An array of threadFlowLocation objects cached at run level.
	ThreadFlowLocations []ThreadFlowLocation `json:"threadFlowLocations,omitempty,omitzero"`
	// Tool Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.
	Tool Tool `json:"tool"`
	// Translations The set of available translations of the localized data provided by the tool.
	Translations []ToolComponent `json:"translations,omitempty,omitzero"`
	// VersionControlProvenance Specifies the revision in version control of the artifacts that were scanned.
	VersionControlProvenance []VersionControlDetails `json:"versionControlProvenance,omitempty,omitzero"`
	// WebRequests An array of request objects cached at run level.
	WebRequests []WebRequest `json:"webRequests,omitempty,omitzero"`
	// WebResponses An array of response objects cached at run level.
	WebResponses []WebResponse `json:"webResponses,omitempty,omitzero"`
}

Run Describes a single run of an analysis tool, and contains the reported output of that run. Use NewRun when constructing a value so schema defaults are initialized.

func NewRun added in v0.1.1

func NewRun() Run

NewRun returns an initialized Run with the defaults defined by SARIF 2.1.0.

func (Run) MarshalJSON

func (v Run) MarshalJSON() ([]byte, error)

func (*Run) UnmarshalJSON

func (v *Run) UnmarshalJSON(data []byte) error

type RunAutomationDetails

type RunAutomationDetails struct {
	// CorrelationGUID A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.
	CorrelationGUID string `json:"correlationGuid,omitempty,omitzero"`
	// Description A description of the identity and role played within the engineering system by this object's containing run object.
	Description Message `json:"description,omitempty,omitzero"`
	// GUID A stable, unique identifer for this object's containing run object in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// ID A hierarchical string that uniquely identifies this object's containing run object.
	ID string `json:"id,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the run automation details.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

RunAutomationDetails Information that describes a run's identity and role within an engineering system process.

func (RunAutomationDetails) MarshalJSON

func (v RunAutomationDetails) MarshalJSON() ([]byte, error)

type SpecialLocations

type SpecialLocations struct {
	// DisplayBase Provides a suggestion to SARIF consumers to display file paths relative to the specified location.
	DisplayBase ArtifactLocation `json:"displayBase,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the special locations.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

SpecialLocations Defines locations of special significance to SARIF consumers.

func (SpecialLocations) MarshalJSON

func (v SpecialLocations) MarshalJSON() ([]byte, error)

type Stack

type Stack struct {
	// Frames An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.
	Frames []StackFrame `json:"frames"`
	// Message A message relevant to this call stack.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the stack.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Stack A call stack that is relevant to a result.

func (Stack) MarshalJSON

func (v Stack) MarshalJSON() ([]byte, error)

type StackFrame

type StackFrame struct {
	// Location The location to which this stack frame refers.
	Location Location `json:"location,omitempty,omitzero"`
	// Module The name of the module that contains the code of this stack frame.
	Module string `json:"module,omitempty,omitzero"`
	// Parameters The parameters of the call that is executing.
	Parameters []string `json:"parameters,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the stack frame.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ThreadID The thread identifier of the stack frame.
	ThreadID int `json:"threadId,omitempty,omitzero"`
}

StackFrame A function call within a stack trace. Use NewStackFrame when constructing a value so schema defaults are initialized.

func NewStackFrame added in v0.1.1

func NewStackFrame() StackFrame

NewStackFrame returns an initialized StackFrame with the defaults defined by SARIF 2.1.0.

func (StackFrame) MarshalJSON

func (v StackFrame) MarshalJSON() ([]byte, error)

func (*StackFrame) UnmarshalJSON

func (v *StackFrame) UnmarshalJSON(data []byte) error

type Suppression

type Suppression struct {
	// GUID A stable, unique identifer for the suprression in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// Justification A string representing the justification for the suppression.
	Justification string `json:"justification,omitempty,omitzero"`
	// Kind A string that indicates where the suppression is persisted.
	Kind string `json:"kind"`
	// Location Identifies the location associated with the suppression.
	Location Location `json:"location,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the suppression.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// State A string that indicates the state of the suppression.
	State string `json:"state,omitempty,omitzero"`
}

Suppression A suppression that is relevant to a result.

func (Suppression) MarshalJSON

func (v Suppression) MarshalJSON() ([]byte, error)

type ThreadFlow

type ThreadFlow struct {
	// ID An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.
	ID string `json:"id,omitempty,omitzero"`
	// ImmutableState Values of relevant expressions at the start of the thread flow that remain constant.
	ImmutableState map[string]MultiformatMessageString `json:"immutableState,omitempty,omitzero"`
	// InitialState Values of relevant expressions at the start of the thread flow that may change during thread flow execution.
	InitialState map[string]MultiformatMessageString `json:"initialState,omitempty,omitzero"`
	// Locations A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.
	Locations []ThreadFlowLocation `json:"locations"`
	// Message A message relevant to the thread flow.
	Message Message `json:"message,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the thread flow.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

ThreadFlow Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.

func (ThreadFlow) MarshalJSON

func (v ThreadFlow) MarshalJSON() ([]byte, error)

type ThreadFlowLocation

type ThreadFlowLocation struct {
	// ExecutionOrder An integer representing the temporal order in which execution reached this location.
	ExecutionOrder int `json:"executionOrder,omitempty,omitzero"`
	// ExecutionTimeUtc The Coordinated Universal Time (UTC) date and time at which this location was executed.
	ExecutionTimeUtc string `json:"executionTimeUtc,omitempty,omitzero"`
	// Importance Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important".
	Importance string `json:"importance,omitempty,omitzero"`
	// Index The index within the run threadFlowLocations array.
	Index int `json:"index,omitempty,omitzero"`
	// Kinds A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.
	Kinds []string `json:"kinds,omitempty,omitzero"`
	// Location The code location.
	Location Location `json:"location,omitempty,omitzero"`
	// Module The name of the module that contains the code that is executing.
	Module string `json:"module,omitempty,omitzero"`
	// NestingLevel An integer representing a containment hierarchy within the thread flow.
	NestingLevel int `json:"nestingLevel,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the threadflow location.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Stack The call stack leading to this location.
	Stack Stack `json:"stack,omitempty,omitzero"`
	// State A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.
	State map[string]MultiformatMessageString `json:"state,omitempty,omitzero"`
	// Taxa An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.
	Taxa []ReportingDescriptorReference `json:"taxa,omitempty,omitzero"`
	// WebRequest A web request associated with this thread flow location.
	WebRequest WebRequest `json:"webRequest,omitempty,omitzero"`
	// WebResponse A web response associated with this thread flow location.
	WebResponse WebResponse `json:"webResponse,omitempty,omitzero"`
}

ThreadFlowLocation A location visited by an analysis tool while simulating or monitoring the execution of a program. Use NewThreadFlowLocation when constructing a value so schema defaults are initialized.

func NewThreadFlowLocation added in v0.1.1

func NewThreadFlowLocation() ThreadFlowLocation

NewThreadFlowLocation returns an initialized ThreadFlowLocation with the defaults defined by SARIF 2.1.0.

func (ThreadFlowLocation) MarshalJSON

func (v ThreadFlowLocation) MarshalJSON() ([]byte, error)

func (*ThreadFlowLocation) UnmarshalJSON

func (v *ThreadFlowLocation) UnmarshalJSON(data []byte) error

type Tool

type Tool struct {
	// Driver The analysis tool that was run.
	Driver ToolComponent `json:"driver"`
	// Extensions Tool extensions that contributed to or reconfigured the analysis tool that was run.
	Extensions []ToolComponent `json:"extensions,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the tool.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

Tool The analysis tool that was run. Use NewTool when constructing a value so schema defaults are initialized.

func NewTool added in v0.1.1

func NewTool() Tool

NewTool returns an initialized Tool with the defaults defined by SARIF 2.1.0.

func (Tool) MarshalJSON

func (v Tool) MarshalJSON() ([]byte, error)

func (*Tool) UnmarshalJSON

func (v *Tool) UnmarshalJSON(data []byte) error

type ToolComponent

type ToolComponent struct {
	// AssociatedComponent The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.
	AssociatedComponent ToolComponentReference `json:"associatedComponent,omitempty,omitzero"`
	// Contents The kinds of data contained in this object.
	Contents []string `json:"contents,omitempty,omitzero"`
	// DottedQuadFileVersion The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).
	DottedQuadFileVersion string `json:"dottedQuadFileVersion,omitempty,omitzero"`
	// DownloadURI The absolute URI from which the tool component can be downloaded.
	DownloadURI string `json:"downloadUri,omitempty,omitzero"`
	// FullDescription A comprehensive description of the tool component.
	FullDescription MultiformatMessageString `json:"fullDescription,omitempty,omitzero"`
	// FullName The name of the tool component along with its version and any other useful identifying information, such as its locale.
	FullName string `json:"fullName,omitempty,omitzero"`
	// GlobalMessageStrings A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.
	GlobalMessageStrings map[string]MultiformatMessageString `json:"globalMessageStrings,omitempty,omitzero"`
	// GUID A unique identifer for the tool component in the form of a GUID.
	GUID string `json:"guid,omitempty,omitzero"`
	// InformationURI The absolute URI at which information about this version of the tool component can be found.
	InformationURI string `json:"informationUri,omitempty,omitzero"`
	// IsComprehensive Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.
	IsComprehensive bool `json:"isComprehensive,omitempty,omitzero"`
	// Language The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).
	Language string `json:"language,omitempty,omitzero"`
	// LocalizedDataSemanticVersion The semantic version of the localized strings defined in this component; maintained by components that provide translations.
	LocalizedDataSemanticVersion string `json:"localizedDataSemanticVersion,omitempty,omitzero"`
	// Locations An array of the artifactLocation objects associated with the tool component.
	Locations []ArtifactLocation `json:"locations,omitempty,omitzero"`
	// MinimumRequiredLocalizedDataSemanticVersion The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.
	MinimumRequiredLocalizedDataSemanticVersion string `json:"minimumRequiredLocalizedDataSemanticVersion,omitempty,omitzero"`
	// Name The name of the tool component.
	Name string `json:"name"`
	// Notifications An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.
	Notifications []ReportingDescriptor `json:"notifications,omitempty,omitzero"`
	// Organization The organization or company that produced the tool component.
	Organization string `json:"organization,omitempty,omitzero"`
	// Product A product suite to which the tool component belongs.
	Product string `json:"product,omitempty,omitzero"`
	// ProductSuite A localizable string containing the name of the suite of products to which the tool component belongs.
	ProductSuite string `json:"productSuite,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the tool component.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ReleaseDateUtc A string specifying the UTC date (and optionally, the time) of the component's release.
	ReleaseDateUtc string `json:"releaseDateUtc,omitempty,omitzero"`
	// Rules An array of reportingDescriptor objects relevant to the analysis performed by the tool component.
	Rules []ReportingDescriptor `json:"rules,omitempty,omitzero"`
	// SemanticVersion The tool component version in the format specified by Semantic Versioning 2.0.
	SemanticVersion string `json:"semanticVersion,omitempty,omitzero"`
	// ShortDescription A brief description of the tool component.
	ShortDescription MultiformatMessageString `json:"shortDescription,omitempty,omitzero"`
	// SupportedTaxonomies An array of toolComponentReference objects to declare the taxonomies supported by the tool component.
	SupportedTaxonomies []ToolComponentReference `json:"supportedTaxonomies,omitempty,omitzero"`
	// Taxa An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.
	Taxa []ReportingDescriptor `json:"taxa,omitempty,omitzero"`
	// TranslationMetadata Translation metadata, required for a translation, not populated by other component types.
	TranslationMetadata TranslationMetadata `json:"translationMetadata,omitempty,omitzero"`
	// Version The tool component version, in whatever format the component natively provides.
	Version string `json:"version,omitempty,omitzero"`
}

ToolComponent A component, such as a plug-in or the driver, of the analysis tool that was run. Use NewToolComponent when constructing a value so schema defaults are initialized.

func NewToolComponent added in v0.1.1

func NewToolComponent() ToolComponent

NewToolComponent returns an initialized ToolComponent with the defaults defined by SARIF 2.1.0.

func (ToolComponent) MarshalJSON

func (v ToolComponent) MarshalJSON() ([]byte, error)

func (*ToolComponent) UnmarshalJSON

func (v *ToolComponent) UnmarshalJSON(data []byte) error

type ToolComponentReference

type ToolComponentReference struct {
	// GUID The 'guid' property of the referenced toolComponent.
	GUID string `json:"guid,omitempty,omitzero"`
	// Index An index into the referenced toolComponent in tool.extensions.
	Index int `json:"index,omitempty,omitzero"`
	// Name The 'name' property of the referenced toolComponent.
	Name string `json:"name,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the toolComponentReference.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
}

ToolComponentReference Identifies a particular toolComponent object, either the driver or an extension. Use NewToolComponentReference when constructing a value so schema defaults are initialized.

func NewToolComponentReference added in v0.1.1

func NewToolComponentReference() ToolComponentReference

NewToolComponentReference returns an initialized ToolComponentReference with the defaults defined by SARIF 2.1.0.

func (ToolComponentReference) MarshalJSON

func (v ToolComponentReference) MarshalJSON() ([]byte, error)

func (*ToolComponentReference) UnmarshalJSON

func (v *ToolComponentReference) UnmarshalJSON(data []byte) error

type TranslationMetadata

type TranslationMetadata struct {
	// DownloadURI The absolute URI from which the translation metadata can be downloaded.
	DownloadURI string `json:"downloadUri,omitempty,omitzero"`
	// FullDescription A comprehensive description of the translation metadata.
	FullDescription MultiformatMessageString `json:"fullDescription,omitempty,omitzero"`
	// FullName The full name associated with the translation metadata.
	FullName string `json:"fullName,omitempty,omitzero"`
	// InformationURI The absolute URI from which information related to the translation metadata can be downloaded.
	InformationURI string `json:"informationUri,omitempty,omitzero"`
	// Name The name associated with the translation metadata.
	Name string `json:"name"`
	// Properties Key/value pairs that provide additional information about the translation metadata.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// ShortDescription A brief description of the translation metadata.
	ShortDescription MultiformatMessageString `json:"shortDescription,omitempty,omitzero"`
}

TranslationMetadata Provides additional metadata related to translation.

func (TranslationMetadata) MarshalJSON

func (v TranslationMetadata) MarshalJSON() ([]byte, error)

type VersionControlDetails

type VersionControlDetails struct {
	// AsOfTimeUtc A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.
	AsOfTimeUtc string `json:"asOfTimeUtc,omitempty,omitzero"`
	// Branch The name of a branch containing the revision.
	Branch string `json:"branch,omitempty,omitzero"`
	// MappedTo The location in the local file system to which the root of the repository was mapped at the time of the analysis.
	MappedTo ArtifactLocation `json:"mappedTo,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the version control details.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// RepositoryURI The absolute URI of the repository.
	RepositoryURI string `json:"repositoryUri"`
	// RevisionID A string that uniquely and permanently identifies the revision within the repository.
	RevisionID string `json:"revisionId,omitempty,omitzero"`
	// RevisionTag A tag that has been applied to the revision.
	RevisionTag string `json:"revisionTag,omitempty,omitzero"`
}

VersionControlDetails Specifies the information necessary to retrieve a desired revision from a version control system.

func (VersionControlDetails) MarshalJSON

func (v VersionControlDetails) MarshalJSON() ([]byte, error)

type WebRequest

type WebRequest struct {
	// Body The body of the request.
	Body ArtifactContent `json:"body,omitempty,omitzero"`
	// Headers The request headers.
	Headers map[string]string `json:"headers,omitempty,omitzero"`
	// Index The index within the run.webRequests array of the request object associated with this result.
	Index int `json:"index,omitempty,omitzero"`
	// Method The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.
	Method string `json:"method,omitempty,omitzero"`
	// Parameters The request parameters.
	Parameters map[string]string `json:"parameters,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the request.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Protocol The request protocol. Example: 'http'.
	Protocol string `json:"protocol,omitempty,omitzero"`
	// Target The target of the request.
	Target string `json:"target,omitempty,omitzero"`
	// Version The request version. Example: '1.1'.
	Version string `json:"version,omitempty,omitzero"`
}

WebRequest Describes an HTTP request. Use NewWebRequest when constructing a value so schema defaults are initialized.

func NewWebRequest added in v0.1.1

func NewWebRequest() WebRequest

NewWebRequest returns an initialized WebRequest with the defaults defined by SARIF 2.1.0.

func (WebRequest) MarshalJSON

func (v WebRequest) MarshalJSON() ([]byte, error)

func (*WebRequest) UnmarshalJSON

func (v *WebRequest) UnmarshalJSON(data []byte) error

type WebResponse

type WebResponse struct {
	// Body The body of the response.
	Body ArtifactContent `json:"body,omitempty,omitzero"`
	// Headers The response headers.
	Headers map[string]string `json:"headers,omitempty,omitzero"`
	// Index The index within the run.webResponses array of the response object associated with this result.
	Index int `json:"index,omitempty,omitzero"`
	// NoResponseReceived Specifies whether a response was received from the server.
	NoResponseReceived bool `json:"noResponseReceived,omitempty,omitzero"`
	// Properties Key/value pairs that provide additional information about the response.
	Properties PropertyBag `json:"properties,omitempty,omitzero"`
	// Protocol The response protocol. Example: 'http'.
	Protocol string `json:"protocol,omitempty,omitzero"`
	// ReasonPhrase The response reason. Example: 'Not found'.
	ReasonPhrase string `json:"reasonPhrase,omitempty,omitzero"`
	// StatusCode The response status code. Example: 451.
	StatusCode int `json:"statusCode,omitempty,omitzero"`
	// Version The response version. Example: '1.1'.
	Version string `json:"version,omitempty,omitzero"`
}

WebResponse Describes the response to an HTTP request. Use NewWebResponse when constructing a value so schema defaults are initialized.

func NewWebResponse added in v0.1.1

func NewWebResponse() WebResponse

NewWebResponse returns an initialized WebResponse with the defaults defined by SARIF 2.1.0.

func (WebResponse) MarshalJSON

func (v WebResponse) MarshalJSON() ([]byte, error)

func (*WebResponse) UnmarshalJSON

func (v *WebResponse) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
cmd
sarifgen command

Jump to

Keyboard shortcuts

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