environment

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name    = "environment"
	Type    = "https://witness.dev/attestations/environment/v0.1"
	RunType = attestation.PreMaterialRunType
)

Variables

This section is empty.

Functions

func FilterEnvironmentArray

func FilterEnvironmentArray(variables []string, blockList map[string]struct{}, onAllowed func(key, val, orig string))

FilterEnvironmentArray expects an array of strings representing environment variables. Each element of the array is expected to be in the format of "KEY=VALUE". blockList is the list of elements to filter from variables, and for each element of variables that does not appear in the blockList onAllowed will be called.

Types

type Attestor

type Attestor struct {
	OS        string            `json:"os"`
	Hostname  string            `json:"hostname"`
	Username  string            `json:"username"`
	Variables map[string]string `json:"variables,omitempty"`
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Attestor

func (*Attestor) Attest

func (a *Attestor) Attest(ctx *attestation.AttestationContext) error

func (*Attestor) Name

func (a *Attestor) Name() string

func (*Attestor) RunType

func (a *Attestor) RunType() attestation.RunType

func (*Attestor) Type

func (a *Attestor) Type() string

type Option

type Option func(*Attestor)

func WithBlockList

func WithBlockList(blockList map[string]struct{}) Option

Jump to

Keyboard shortcuts

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