MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / NewEngine

Function NewEngine

pkg/policies/engine/rego/rego.go:46–53  ·  view source on GitHub ↗

NewEngine creates a new policy engine with the given options default operating mode is EnvironmentModeRestrictive default allowed hostnames are www.chainloop.dev and www.cisa.gov user provided allowed hostnames are appended to the base ones

(opts ...engine.Option)

Source from the content-addressed store, hash-verified

44// default allowed hostnames are www.chainloop.dev and www.cisa.gov
45// user provided allowed hostnames are appended to the base ones
46func NewEngine(opts ...engine.Option) *Engine {
47 options := engine.ApplyOptions(opts...)
48
49 return &Engine{
50 operatingMode: EnvironmentMode(options.OperatingMode),
51 CommonEngineOptions: options.CommonEngineOptions,
52 }
53}
54
55// EnvironmentMode defines the mode of running the policy engine
56type EnvironmentMode int32

Calls 2

ApplyOptionsFunction · 0.92
EnvironmentModeTypeAlias · 0.85