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)
| 44 | // default allowed hostnames are www.chainloop.dev and www.cisa.gov |
| 45 | // user provided allowed hostnames are appended to the base ones |
| 46 | func 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 |
| 56 | type EnvironmentMode int32 |