policy

package
v0.20.2-pre.20221106 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConftestVersionEnvKey = "DEFAULT_CONFTEST_VERSION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Param  string
	Option string
}

func NewPolicyArg

func NewPolicyArg(parameter string) Arg

type ConfTestExecutorWorkflow

type ConfTestExecutorWorkflow struct {
	SourceResolver         SourceResolver
	VersionCache           cache.ExecutionVersionCache
	DefaultConftestVersion *version.Version
	Exec                   runtime_models.Exec
}

ConfTestExecutorWorkflow runs a versioned conftest binary with the args built from the project context. Project context defines whether conftest runs a local policy set or runs a test on a remote policy set.

func NewConfTestExecutorWorkflow

func NewConfTestExecutorWorkflow(log logging.SimpleLogging, versionRootDir string, conftestDownloder terraform.Downloader) *ConfTestExecutorWorkflow

func (*ConfTestExecutorWorkflow) EnsureExecutorVersion

func (c *ConfTestExecutorWorkflow) EnsureExecutorVersion(log logging.SimpleLogging, v *version.Version) (string, error)

func (*ConfTestExecutorWorkflow) Run

func (c *ConfTestExecutorWorkflow) Run(ctx command.ProjectContext, executablePath string, envs map[string]string, workdir string, extraArgs []string) (string, error)

type ConfTestVersionDownloader

type ConfTestVersionDownloader struct {
	// contains filtered or unexported fields
}

type ConftestTestCommandArgs

type ConftestTestCommandArgs struct {
	PolicyArgs []Arg
	ExtraArgs  []string
	InputFile  string
	Command    string
}

type LocalSourceResolver

type LocalSourceResolver struct {
}

LocalSourceResolver resolves a local policy set to a local fs path

func (*LocalSourceResolver) Resolve

func (p *LocalSourceResolver) Resolve(policySet valid.PolicySet) (string, error)

type SourceResolver

type SourceResolver interface {
	Resolve(policySet valid.PolicySet) (string, error)
}

SourceResolver resolves the policy set to a local fs path

type SourceResolverProxy

type SourceResolverProxy struct {
	// contains filtered or unexported fields
}

SourceResolverProxy proxies to underlying source resolvers dynamically

func (*SourceResolverProxy) Resolve

func (p *SourceResolverProxy) Resolve(policySet valid.PolicySet) (string, error)

Directories

Path Synopsis
matchers
Code generated by pegomock.
Code generated by pegomock.

Jump to

Keyboard shortcuts

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