WithProjectContext sets the project name and version that this engine instance is evaluating policies for. The rego engine exposes them on the per-evaluation input as input.chainloop_metadata.project_name / input.chainloop_metadata.project_version_name so policy authors can pass them as operands to
(name, version string)
| 121 | // input.chainloop_metadata.project_version_name so policy authors can pass them |
| 122 | // as operands to chainloop.* built-ins. Either value may be empty. |
| 123 | func WithProjectContext(name, version string) Option { |
| 124 | return func(opts *Options) { |
| 125 | opts.ProjectName = name |
| 126 | opts.ProjectVersionName = version |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | // ApplyOptions applies options and returns the configured Options |
| 131 | // This automatically appends BaseAllowedHostnames to any user-provided hostnames |
no outgoing calls