secret

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Redacted = "***"

Redacted is the prefix the API uses to mark a masked secret. A masked value is the prefix optionally followed by the last few characters of the stored secret (e.g. "***abcd"). Masked values are never persisted: on writes they are treated as "no change" so a read-modify-write round-trip cannot overwrite a real credential with its mask.

Variables

This section is empty.

Functions

func IsMasked

func IsMasked(v string) bool

IsMasked reports whether a value was produced by Mask (it carries the redaction prefix). It is used both to detect a masked secret echoed back on update and to reject a masked value as a literal secret where there is no stored value to keep (create, auth type switch, first-time config).

func Mask

func Mask(v string) string

Mask returns a masked representation of a stored secret ("***" plus its last few characters), or empty when there is no secret, so responses signal that a credential exists and which one without exposing it.

func Resolve

func Resolve(incoming, existing string) string

Resolve implements the merge-on-omit rule for secret fields on update: when the incoming value is empty or a masked value echoed back from a response, the existing stored value is kept; otherwise the incoming value replaces it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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