redact

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package redact removes credentials from text before it leaves the server process: error reasons, status, mounts.json and server.log lines.

See spec/features/local-server-and-web-console#REQ:redacted-errors.

Index

Constants

View Source
const Mask = "[redacted]"

Mask replaces every removed value.

Variables

This section is empty.

Functions

func String

func String(s string) string

String returns s with URL user-info, DSN credentials, secret-named key/value pairs and Bearer or Basic credentials replaced by Mask. It is deliberately over-eager: a harmless word masked in a log line costs less than a leaked password.

Types

type Writer

type Writer struct{ W io.Writer }

Writer redacts each Write before passing it on. Callers write whole lines (log.Logger does), so a credential is never split across two writes.

func (Writer) Write

func (w Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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