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

Function ApplyOptions

pkg/policies/engine/engine.go:132–153  ·  view source on GitHub ↗

ApplyOptions applies options and returns the configured Options This automatically appends BaseAllowedHostnames to any user-provided hostnames

(opts ...Option)

Source from the content-addressed store, hash-verified

130// ApplyOptions applies options and returns the configured Options
131// This automatically appends BaseAllowedHostnames to any user-provided hostnames
132func ApplyOptions(opts ...Option) *Options {
133 options := &Options{
134 CommonEngineOptions: &CommonEngineOptions{
135 AllowedHostnames: make([]string, 0),
136 IncludeRawData: false,
137 EnablePrint: false,
138 ControlPlaneConnection: nil,
139 },
140 OperatingMode: 0, // Default restrictive mode
141 ExecutionTimeout: 0,
142 Logger: nil,
143 }
144
145 for _, opt := range opts {
146 opt(options)
147 }
148
149 // Append base allowed hostnames to user-provided ones
150 options.AllowedHostnames = append(options.AllowedHostnames, BaseAllowedHostnames...)
151
152 return options
153}
154
155type PolicyEngine interface {
156 // Verify verifies an input against a policy

Callers 2

NewEngineFunction · 0.92
NewEngineFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected