redaction

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package redaction sanitizes application-layer observations before any persistence boundary. It never returns a hash of a detected secret.

Index

Constants

View Source
const Replacement = "[REDACTED]"

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	RuleID string
	Count  int
}

type Redactor

type Redactor struct {
	// contains filtered or unexported fields
}

func New

func New(extraNames []string, canaries [][]byte) (*Redactor, error)

func (*Redactor) AssertNoCanary

func (redactor *Redactor) AssertNoCanary(raw []byte) error

func (*Redactor) RedactHeaders

func (redactor *Redactor) RedactHeaders(headers http.Header) (http.Header, Report)

func (*Redactor) RedactJSON

func (redactor *Redactor) RedactJSON(raw []byte) ([]byte, Report, error)

func (*Redactor) RedactText

func (redactor *Redactor) RedactText(raw []byte) ([]byte, Report)

func (*Redactor) RedactURL

func (redactor *Redactor) RedactURL(input *url.URL) (*url.URL, Report, error)

func (*Redactor) SanitizeJSON

func (redactor *Redactor) SanitizeJSON(raw []byte) (SanitizedPayload, error)

func (*Redactor) SanitizeText

func (redactor *Redactor) SanitizeText(raw []byte) (SanitizedPayload, error)

type Report

type Report struct {
	Findings []Finding
}

func (Report) Empty

func (report Report) Empty() bool

type SanitizedPayload

type SanitizedPayload struct {
	// contains filtered or unexported fields
}

SanitizedPayload is the only payload type accepted by the evidence CAS. Its bytes are unexported so callers must pass through a Redactor constructor.

func (SanitizedPayload) Bytes

func (payload SanitizedPayload) Bytes() []byte

func (SanitizedPayload) Class

func (payload SanitizedPayload) Class() string

func (SanitizedPayload) Report

func (payload SanitizedPayload) Report() Report

func (SanitizedPayload) Size

func (payload SanitizedPayload) Size() int

Jump to

Keyboard shortcuts

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