Documentation
¶
Index ¶
Constants ¶
const ID = "ref-traffic-transcript"
ID is the YAML id for the traffic proof feature.
Variables ¶
This section is empty.
Functions ¶
func BundleForTest ¶
func BundleForTest(cfg Config) (traffic.PortBundle, *Transcript, *RawLog)
BundleForTest builds a traffic.PortBundle for unit tests: fresh Transcript, [PatternRedactor], and RawLog.
func NewPatternRedactor ¶
NewPatternRedactor removes configured substrings on the observation path.
Types ¶
type Config ¶
type Config struct {
// RedactSubstrings are removed from observer path bodies (in order). Empty uses default.
RedactSubstrings []string `yaml:"redact_substrings"`
Order *int `yaml:"order"`
}
Config for redaction pattern and default ordering.
func DecodeConfig ¶
DecodeConfig parses the feature YAML.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default settings (for tests and smoke checks).
type RawLog ¶
type RawLog struct {
Rows []RawRow
// contains filtered or unexported fields
}
RawLog records privileged verbatim payloads (unredacted).
type RawRow ¶
type RawRow struct {
Leg traffic.Leg
Bytes []byte
Meta traffic.CaptureMeta
}
RawRow is a raw capture line.
type Row ¶
type Row struct {
Leg traffic.Leg
Body []byte
At time.Time
Trace string
Redact bool
AttemptSeq int
BLegID string
BackendID string
FrontendID string
SessionID string
PrincipalID string
}
Row is one observed sample after redaction.
type Transcript ¶
type Transcript struct {
Rows []Row
// contains filtered or unexported fields
}
Transcript records structured observations (redacted path) for tests and diagnostics.
func NewTranscript ¶
func NewTranscript() *Transcript
NewTranscript returns an empty transcript buffer.
func (*Transcript) OnObservation ¶
func (t *Transcript) OnObservation(_ context.Context, ev traffic.Observation) error
type UsageLedger ¶
type UsageLedger struct {
// contains filtered or unexported fields
}
UsageLedger records usage.Event observations for proof tests (attempt lineage fields preserved).
func (*UsageLedger) EventsSnapshot ¶
func (u *UsageLedger) EventsSnapshot() []usage.Event
EventsSnapshot returns a defensive copy of recorded events (may be empty).
func (*UsageLedger) OnUsage ¶
OnUsage implements usage.Observer.