Documentation
¶
Overview ¶
Package envparse provides simple parsers for KEY=VALUE-style CLI inputs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSensitiveKey ¶
IsSensitiveKey reports whether key looks like it carries a secret value. Matching is case-insensitive substring against a fixed marker list.
func KeyValuePairs ¶
KeyValuePairs parses a comma-separated KEY1=VALUE1,KEY2=VALUE2 string into a map. Empty input returns nil. Pairs without '=' are silently skipped. Whitespace around keys and values is trimmed.
func KeysOnly ¶ added in v0.139.4
KeysOnly returns a copy of env entries (each in "KEY=VALUE" form, the same shape exec.Cmd.Env uses) reduced to their key names. It exists because the denylist approach used to fail open: a secret whose key name matched no marker reached the log, which is how the GitHub App private key arrived in every agent-claude pod log before its marker was added. A key name carries no secret, so logging names only cannot leak by construction. The split is at the first '=' so a value containing '=' is still discarded. Entries without '=' pass through unchanged. The input slice is not mutated.
func RedactForLog ¶
RedactForLog returns a copy of env entries (each in "KEY=VALUE" form, the same shape exec.Cmd.Env uses) where every value is replaced with the literal "***". Keys remain visible so operators can confirm which vars are passed without exposing the values. Entries without '=' pass through unchanged. The input slice is not mutated.
Unlike KeysOnly, which drops values entirely, this keeps the KEY=*** shape for callers that want to see that a value exists. It stars every value rather than consulting IsSensitiveKey, so it is fail-safe: no key name is trusted, and a secret under an unlisted key cannot reach the log.
Types ¶
This section is empty.