Documentation
¶
Overview ¶
Package patterns is Harbor's V1 audit redactor driver. It composes the canonical rule set from internal/audit (key-based redaction for the seven secret shapes + bearer-in-value regex + multimodal detection) and applies every rule in deterministic order on every Redact call.
The driver self-registers under name "patterns" via init(); the runtime entry point cmd/harbor/main.go blank-imports this package to trigger registration. Other drivers (PII tokenizer, semantic redactor) plug in via the same registry seam without changing callers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is the patterns Redactor. Built once at boot via Open and shared across every emit path; D-025 concurrent-reuse contract is enforced by the test suite. The rule slice is immutable after construction.
func New ¶
func New() *Driver
New constructs a Driver with the canonical V1 rule set. Exposed for tests that want to drive the redactor without round-tripping through the registry.
func NewWithRules ¶
NewWithRules constructs a Driver from an explicit rule set. Useful for tests that want to assert behaviour against a single rule.
func (*Driver) Names ¶
Names returns the deterministic order in which this driver applies rules. Used by boot-log emission and by golden-file tests.