Documentation
¶
Index ¶
- Constants
- func Contains(value any) bool
- func FitsType(source, target reflect.Type) bool
- func FitsValue(value any, target reflect.Type) bool
- func IsEmpty(value Value) bool
- func IsSecretType(t reflect.Type) bool
- func IsValue(value any) bool
- func Sanitize(value any) any
- func SanitizeBoundary(value any, target reflect.Type) (sanitized any, secrets []string)
- func SanitizeError(err error, values ...any) error
- func SanitizeErrorWithSecretValues(err error, secrets ...string) error
- func SanitizeWithSecretValues(value any, secrets ...string) any
- func SanitizeWithSources(value any, sources ...any) any
- func TypeContains(t reflect.Type) bool
- func WireType(t reflect.Type) reflect.Type
- func WithValue(value Value, fn func([]byte) error) error
- func WithoutSecrets(t reflect.Type) reflect.Type
- type Scrubber
- type Value
Constants ¶
const Redacted = "[REDACTED]"
Variables ¶
This section is empty.
Functions ¶
func FitsType ¶
FitsType reports whether every statically known secret field in source has an exactly corresponding secret field in target. Generic interfaces are not a valid destination for a secret.
func FitsValue ¶
FitsValue is the runtime counterpart to FitsType. It checks the actual values of dynamic maps and slices before they enter an action.
func IsSecretType ¶
func Sanitize ¶
Sanitize returns a value safe for observers and event sinks. Secret leaves become the redaction marker; other values are preserved where possible.
func SanitizeBoundary ¶
SanitizeBoundary redacts fields declared as Secret in a schema contract, including plain wire strings observed before request materialization.
func SanitizeError ¶
SanitizeError creates an observer-safe error when the associated payload contains a Secret. It deliberately does not unwrap the original error.
func SanitizeErrorWithSecretValues ¶
SanitizeErrorWithSecretValues removes raw wire Secret strings from an error associated with a request before those strings have been wrapped as Values.
func SanitizeWithSecretValues ¶
SanitizeWithSecretValues redacts known secret strings from JSON-compatible values. It is used for raw wire payloads before a schema has materialized Secret.Value instances.
func SanitizeWithSources ¶
SanitizeWithSources redacts Secret leaves and any echoed secret contents in a value before it leaves the execution boundary for an observer or sink.
func TypeContains ¶
func WireType ¶
WireType replaces each Secret leaf with its string wire shape for structural JSON checks. Flow values remain Secret.Value and still require FitsType.
Types ¶
type Scrubber ¶
type Scrubber struct {
// contains filtered or unexported fields
}
Scrubber remembers bounded Secret values for one execution so echoed values can be removed from outputs and errors that no longer retain Secret.Value.
func NewScrubber ¶
func NewScrubber() *Scrubber
NewScrubber creates an empty execution-scoped Secret scrubber.
func (*Scrubber) Capture ¶
Capture records typed Secret values and, when target is provided, raw values occupying Secret-typed fields at a wire boundary.
func (*Scrubber) Clear ¶
func (scrubber *Scrubber) Clear()
Clear releases references to captured values after the execution is complete.
func (*Scrubber) Sanitize ¶
Sanitize redacts all captured values from value. If the bounded capture limit is exceeded, it redacts the complete result rather than risk an incomplete scrub.
func (*Scrubber) SanitizeError ¶
SanitizeError removes captured Secret values from err without exposing its original error chain when a value was changed.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}