configview

package
v0.5.13 Latest Latest
Warning

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

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

Documentation

Overview

Package configview decides how a resolved configuration value is shown.

The startup summary and pw doctor render the same loaded configuration for the same reader, so what a value looks like is decided once, here, rather than twice in two packages that would drift.

Index

Constants

View Source
const Redacted = "*****"

Redacted is the mark a hidden value leaves behind. It matches what configbind writes, so one idea never shows up under two marks.

Variables

This section is empty.

Functions

func DSN

func DSN(value string) string

DSN renders a data source name with its credential removed and the rest kept.

Hiding the whole value costs the operator the question a summary is read to answer: which database is this process talking to. The parts that answer it — the scheme, the host, the port, and the database or file the DSN ends in — disclose nothing on their own, so they stay. What is removed is the userinfo, which is the credential, and the query string, which is the one place an unrecognized secret parameter could hide. A value this cannot take apart is hidden whole, because a half-parsed DSN is not worth the risk of printing.

postgres://app:s3cret@db.internal:5432/app?sslmode=verify-full
  -> postgres://*****@db.internal:5432/app
mysql://app:s3cret@tcp(db.internal:3306)/app?parseTime=true
  -> mysql://*****@db.internal:3306/app
sqlite://./app.db  -> sqlite://./app.db
sqlite://:memory:  -> sqlite://:memory:

func IsDSNKey

func IsDSNKey(key string) bool

IsDSNKey reports whether a key holds a data source name, which is the one secret-classified value with a public half worth showing.

func Raw

func Raw(overlay *configbind.Overlay, entry configbind.ProvenanceEntry) (string, bool)

Raw recovers the unmasked value behind one provenance entry.

Provenance masks a secret-classified value, which is right for anything printed as-is. A caller that has to read the value — to render part of it, or to judge whether it discloses anything — asks the overlay instead. An array element is keyed by its array there rather than by the expanded key provenance reports, which is why the indexed lookup is a second step.

Types

This section is empty.

Jump to

Keyboard shortcuts

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