Documentation
¶
Index ¶
- func ExtractStringFromMetadata(result Result, key string) string
- type ConfigProvider
- type Criteria
- type Data
- type EvaluationTarget
- type Evaluator
- func NewConftestEvaluator(ctx context.Context, policySources []source.PolicySource, p ConfigProvider, ...) (Evaluator, error)
- func NewConftestEvaluatorWithNamespace(ctx context.Context, policySources []source.PolicySource, p ConfigProvider, ...) (Evaluator, error)
- func NewOPAEvaluator() (Evaluator, error)
- type Outcome
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractStringFromMetadata ¶
ExtractStringFromMetadata returns the string value from the result metadata at the given key.
Types ¶
type ConfigProvider ¶
type ConfigProvider interface {
EffectiveTime() time.Time
SigstoreOpts() (policy.SigstoreOpts, error)
Spec() ecc.EnterpriseContractPolicySpec
}
ConfigProvider is a subset of the policy.Policy interface. Its purpose is to codify which parts of Policy are actually used and to make it easier to use mock in tests.
type Criteria ¶
type Criteria struct {
// contains filtered or unexported fields
}
contains include/exclude items digestItems stores include/exclude items that are specific with an imageRef - the imageRef is the key, value is the policy to include/exclude. defaultItems are include/exclude items without an imageRef
type EvaluationTarget ¶
type Evaluator ¶
type Evaluator interface {
Evaluate(ctx context.Context, target EvaluationTarget) ([]Outcome, error)
// Destroy performs any cleanup needed
Destroy()
// CapabilitiesPath returns the path to the file where capabilities are defined
CapabilitiesPath() string
}
func NewConftestEvaluator ¶
func NewConftestEvaluator(ctx context.Context, policySources []source.PolicySource, p ConfigProvider, source ecc.Source) (Evaluator, error)
NewConftestEvaluator returns initialized conftestEvaluator implementing Evaluator interface
func NewConftestEvaluatorWithNamespace ¶
func NewConftestEvaluatorWithNamespace(ctx context.Context, policySources []source.PolicySource, p ConfigProvider, source ecc.Source, namespace []string) (Evaluator, error)
set the policy namespace
func NewOPAEvaluator ¶
type Outcome ¶
type Outcome struct {
FileName string `json:"filename"`
Namespace string `json:"namespace"`
Successes []Result `json:"successes,omitempty"`
Skipped []Result `json:"skipped,omitempty"`
Warnings []Result `json:"warnings,omitempty"`
Failures []Result `json:"failures,omitempty"`
Exceptions []Result `json:"exceptions,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.