package sourcepolicy
import "github.com/moby/buildkit/sourcepolicy"
Index ¶
Variables ¶
var ( // ErrSourceDenied is returned by the policy engine when a source is denied by the policy. ErrSourceDenied = errors.New("source denied by policy") // ErrTooManyOps is returned by the policy engine when there are too many converts for a single source op. ErrTooManyOps = errors.New("too many operations") )
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the source policy engine. It is responsible for evaluating a source policy against a source operation. Create one with `NewEngine`
Rule matching is delegated to the `Matcher` interface. Mutations are delegated to the `Mutater` interface.
func NewEngine ¶
NewEngine creates a new source policy engine.
func (*Engine) Evaluate ¶
Evaluate evaluates a source operation against the policy.
Policies are re-evaluated for each convert rule. Evaluate will error if the there are too many converts for a single source op to prevent infinite loops. This function may error out even if the op was mutated, in which case `true` will be returned along with the error.
An error is returned when the source is denied by the policy.
Source Files ¶
engine.go formatter.go matcher.go mutate.go
Directories ¶
Path | Synopsis |
---|---|
sourcepolicy/pb |
- Version
- v0.13.0-rc3
- Published
- Feb 28, 2024
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 5 minutes ago –
Tools for package owners.