Documentation
¶
Overview ¶
Package diagnostics owns credential masking for transport previews and access logs. It operates on already captured data and never reads application bodies.
Index ¶
Constants ¶
const (
// BodyCaptureLimit bounds development body previews without limiting wire bytes.
BodyCaptureLimit = 64 << 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fields ¶
type Fields struct {
// Headers lists credential header names, compared without case sensitivity.
Headers []string
// Query lists credential query parameter names.
Query []string
// JSON lists credential JSON member names, masked at any nesting depth.
JSON []string
// Form lists credential URL-encoded form field names.
Form []string
// Body omits the entire body, for example when the body is a scalar credential.
Body bool
// Path omits the URL path and all separately printed route variables.
Path bool
}
Fields identifies authored credential locations in the actual wire format. Diagnostic constructors copy these slices; later caller changes have no effect.
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy is an immutable union of authored credential locations and conventional credential names. A zero Policy applies conventional masking only.
func New ¶
New copies and merges fields into an immutable policy. The same physical name is masked across all observed methods, even if only one method declares it secret.
func (*Policy) Body ¶
Body returns a safe preview of captured bytes. It never reads or modifies the application body. Omitted, malformed or incomplete structured captures are represented by an omission marker. Known body credentials with an unsupported content type cause whole-body omission; ordinary opaque bodies remain visible.
func (*Policy) PathValues ¶
PathValues returns a masked copy of separately captured route variables. A credential-bearing path omits every route value, matching whole-path omission.