Documentation
¶
Index ¶
Constants ¶
View Source
const ( ReportSchemaURL = "https://schemas.cerberauth.com/reportx/v0.3.0/report.schema.json" FindingSchemaURL = "https://schemas.cerberauth.com/reportx/v0.3.0/finding.schema.json" )
ReportSchemaURL and FindingSchemaURL point at the JSON Schemas published for reportx's JSON and JSONL output on schemas.cerberauth.com.
Variables ¶
View Source
var FormatNames = []FormatName{ FormatJSON, FormatYAML, FormatJSONL, FormatSARIF, FormatMarkdown, FormatHTML, FormatTerminal, }
Functions ¶
This section is empty.
Types ¶
type CLIFlags ¶
func RegisterFlags ¶
type FormatName ¶
type FormatName string
const ( FormatJSON FormatName = "json" FormatYAML FormatName = "yaml" FormatJSONL FormatName = "jsonl" FormatSARIF FormatName = "sarif" FormatMarkdown FormatName = "markdown" FormatHTML FormatName = "html" FormatTerminal FormatName = "terminal" )
type Formatter ¶
type Formatter interface {
Format(r *reportx.Report) ([]byte, error)
MediaType() string
FileExtension() string
}
func NewFormatter ¶
type HTMLFormatter ¶
type HTMLFormatter struct {
// ReferrerTag, when set, is appended as a "ref" query param to each
// finding's URL so clicks from the report can be attributed back.
ReferrerTag string
}
func NewHTMLFormatter ¶
func NewHTMLFormatter() *HTMLFormatter
func NewHTMLFormatterWithReferrerTag ¶ added in v0.1.2
func NewHTMLFormatterWithReferrerTag(tag string) *HTMLFormatter
NewHTMLFormatterWithReferrerTag returns an HTMLFormatter that tags finding URLs with the given referrer tag (see ReferrerTag).
func (*HTMLFormatter) FileExtension ¶
func (f *HTMLFormatter) FileExtension() string
func (*HTMLFormatter) MediaType ¶
func (f *HTMLFormatter) MediaType() string
type JSONFormatter ¶
type JSONFormatter struct{}
func NewJSONFormatter ¶
func NewJSONFormatter() *JSONFormatter
func (*JSONFormatter) FileExtension ¶
func (f *JSONFormatter) FileExtension() string
func (*JSONFormatter) MediaType ¶
func (f *JSONFormatter) MediaType() string
type JSONLFormatter ¶
type JSONLFormatter struct{}
func NewJSONLFormatter ¶
func NewJSONLFormatter() *JSONLFormatter
func (*JSONLFormatter) FileExtension ¶
func (f *JSONLFormatter) FileExtension() string
func (*JSONLFormatter) MediaType ¶
func (f *JSONLFormatter) MediaType() string
type MarkdownFormatter ¶
type MarkdownFormatter struct {
// ReferrerTag, when set, is appended as a "ref" query param to each
// finding's URL so clicks from the report can be attributed back.
ReferrerTag string
}
func NewMarkdownFormatter ¶
func NewMarkdownFormatter() *MarkdownFormatter
func NewMarkdownFormatterWithReferrerTag ¶ added in v0.1.2
func NewMarkdownFormatterWithReferrerTag(tag string) *MarkdownFormatter
NewMarkdownFormatterWithReferrerTag returns a MarkdownFormatter that tags finding URLs with the given referrer tag (see ReferrerTag).
func (*MarkdownFormatter) FileExtension ¶
func (f *MarkdownFormatter) FileExtension() string
func (*MarkdownFormatter) Format ¶
func (f *MarkdownFormatter) Format(r *reportx.Report) ([]byte, error)
func (*MarkdownFormatter) MediaType ¶
func (f *MarkdownFormatter) MediaType() string
type SARIFFormatter ¶
type SARIFFormatter struct{}
func NewSARIFFormatter ¶
func NewSARIFFormatter() *SARIFFormatter
func (*SARIFFormatter) FileExtension ¶
func (f *SARIFFormatter) FileExtension() string
func (*SARIFFormatter) MediaType ¶
func (f *SARIFFormatter) MediaType() string
type TerminalFormatter ¶
type TerminalFormatter struct {
NoColor bool
// ReferrerTag, when set, is appended as a "ref" query param to each
// finding's URL so clicks from the report can be attributed back.
ReferrerTag string
}
func NewTerminalFormatter ¶
func NewTerminalFormatter() *TerminalFormatter
func NewTerminalFormatterNoColor ¶
func NewTerminalFormatterNoColor() *TerminalFormatter
func NewTerminalFormatterWithReferrerTag ¶ added in v0.1.2
func NewTerminalFormatterWithReferrerTag(tag string) *TerminalFormatter
NewTerminalFormatterWithReferrerTag returns a TerminalFormatter that tags finding URLs with the given referrer tag (see ReferrerTag).
func (*TerminalFormatter) FileExtension ¶
func (f *TerminalFormatter) FileExtension() string
func (*TerminalFormatter) Format ¶
func (f *TerminalFormatter) Format(r *reportx.Report) ([]byte, error)
func (*TerminalFormatter) MediaType ¶
func (f *TerminalFormatter) MediaType() string
type YAMLFormatter ¶ added in v0.2.0
type YAMLFormatter struct{}
func NewYAMLFormatter ¶ added in v0.2.0
func NewYAMLFormatter() *YAMLFormatter
func (*YAMLFormatter) FileExtension ¶ added in v0.2.0
func (f *YAMLFormatter) FileExtension() string
func (*YAMLFormatter) Format ¶ added in v0.2.0
func (f *YAMLFormatter) Format(r *reportx.Report) ([]byte, error)
func (*YAMLFormatter) MediaType ¶ added in v0.2.0
func (f *YAMLFormatter) MediaType() string
Click to show internal directories.
Click to hide internal directories.