sarif

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sarif provides a SARIF v2.1.0 output formatter for Leakwatch findings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	// ShowRaw, when true, includes the unredacted secret value as a
	// "raw" entry under each result's properties bag. When false, no raw value
	// is emitted anywhere in the output.
	ShowRaw bool

	// Version is embedded verbatim as tool.driver.version. Callers should set
	// this to the real build version (the same value reported by `leakwatch
	// version`) so shipped SARIF documents are traceable to the Leakwatch
	// release that produced them. When left empty (e.g. a zero-value
	// Formatter), it falls back to defaultToolVersion ("dev") so existing
	// callers keep producing valid, non-empty output.
	Version string
}

Formatter outputs findings in SARIF v2.1.0 format.

func (*Formatter) FileExtension

func (f *Formatter) FileExtension() string

FileExtension returns the SARIF file extension.

func (*Formatter) Format

func (f *Formatter) Format(w io.Writer, findings []finding.Finding) error

Format writes findings in SARIF v2.1.0 JSON to the given writer. When ShowRaw is true, each result carries the unredacted secret value under properties.raw; otherwise no raw value is emitted.

Jump to

Keyboard shortcuts

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