environment

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 6 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) Data added in v0.4.0

func (a *Attestor) Data() *Attestor

func (*Attestor) Name

func (a *Attestor) Name() string

func (*Attestor) RunType

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

func (*Attestor) Schema added in v0.4.0

func (a *Attestor) Schema() *jsonschema.Schema

func (*Attestor) Type

func (a *Attestor) Type() string

type EnvironmentAttestor added in v0.4.0

type EnvironmentAttestor interface {
	// Attestor
	Name() string
	Type() string
	RunType() attestation.RunType
	Attest(ctx *attestation.AttestationContext) error
	Data() *Attestor
}

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