Documentation
¶
Index ¶
- Constants
- func IsFilterSkipReason(reason string) bool
- func Verify(ctx context.Context, fsys fs.FS, eng Checker, conf Config) (*policyv1.TestResults, error)
- func VerifyStream(ctx context.Context, fsys fs.FS, eng Checker, conf Config) (int, <-chan *policyv1.TestResults_Suite, error)
- type AuxData
- type Checker
- type Config
- type FilterConfig
- type FilterDimension
- type Principals
- type Resources
- type TestFixture
Constants ¶
View Source
const ( SkipReasonName = "Test name did not match the provided pattern" SkipReasonResource = "Resource matched a policy that was excluded from the bundle" SkipReasonPrincipal = "Principal matched a policy that was excluded from the bundle" SkipReasonFilterSuite = "Suite did not match the test filter" SkipReasonFilterTest = "Test did not match the test filter" SkipReasonFilterPrincipal = "Principal did not match the test filter" SkipReasonFilterResource = "Resource did not match the test filter" SkipReasonFilterAction = "No actions matched the test filter" )
Variables ¶
This section is empty.
Functions ¶
func IsFilterSkipReason ¶ added in v0.51.0
func VerifyStream ¶ added in v0.51.0
func VerifyStream(ctx context.Context, fsys fs.FS, eng Checker, conf Config) (int, <-chan *policyv1.TestResults_Suite, error)
VerifyStream runs test suites and streams results as each suite completes. It returns the number of test suites, a channel of results, and any setup error. Callers may cancel the context to stop workers early and avoid unnecessary work.
Types ¶
type Checker ¶ added in v0.21.0
type Checker interface {
Check(ctx context.Context, inputs []*enginev1.CheckInput, opts ...evaluator.CheckOpt) ([]*enginev1.CheckOutput, error)
}
type FilterConfig ¶ added in v0.51.0
type FilterConfig struct {
Suite []string
Test []string
Principal []string
Resource []string
Action []string
}
func ParseFilterConfig ¶ added in v0.51.0
func ParseFilterConfig(filter string) (*FilterConfig, error)
ParseFilterConfig parses a filter string in the format: "test=glob1,glob2;principal=glob3;resource=glob4;action=glob5".
func (*FilterConfig) IsEmpty ¶ added in v0.51.0
func (fc *FilterConfig) IsEmpty() bool
func (*FilterConfig) Merge ¶ added in v0.51.0
func (fc *FilterConfig) Merge(other *FilterConfig) *FilterConfig
type FilterDimension ¶ added in v0.51.0
type FilterDimension string
const ( FilterDimensionSuite FilterDimension = "suite" FilterDimensionTest FilterDimension = "test" FilterDimensionPrincipal FilterDimension = "principal" FilterDimensionResource FilterDimension = "resource" FilterDimensionAction FilterDimension = "action" )
type Principals ¶ added in v0.31.0
type TestFixture ¶ added in v0.31.0
type TestFixture struct {
Principals *Principals
Resources *Resources
AuxData *AuxData
}
func LoadTestFixture ¶ added in v0.31.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.