envredaction

package
v1.138.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package envredaction replaces the values of selected environment variables stored in an attestation with a fixed placeholder. The crafter applies it, and the control plane uses the same rules to check pushed attestations.

Index

Constants

View Source
const RedactedValue = "[REDACTED]"

RedactedValue replaces the value of a redacted environment variable.

Variables

This section is empty.

Functions

func Apply

func Apply(env map[string]string, names []string)

Apply replaces, in place, the value of each named variable that is present in env. The key stays, so the attestation shows that a value existed and was hidden on purpose.

func Names

func Names(mode Mode, custom []string) ([]string, error)

Names returns the exact variable names that the mode redacts. custom is used only by ModeCustom, which requires at least one non-empty name.

func Violations

func Violations(env map[string]string, names []string) []string

Violations returns, sorted, the named variables that have a non-empty value other than RedactedValue. An absent or empty value reveals nothing.

Types

type Mode

type Mode string

Mode selects which environment variables are redacted.

const (
	// ModeNone disables redaction.
	ModeNone Mode = "none"
	// ModeKnownIdentity redacts the variables that runner integrations mark as identifying a person.
	ModeKnownIdentity Mode = "known-identity"
	// ModeCustom redacts only an explicit list of variables.
	ModeCustom Mode = "custom"
)

Jump to

Keyboard shortcuts

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