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

Method Run

app/cli/pkg/action/policy_develop_eval.go:48–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func (action *PolicyEval) Run() (*policydevel.EvalSummary, error) {
49 var attClient pb.AttestationServiceClient
50 if action.CPConnection != nil {
51 attClient = pb.NewAttestationServiceClient(action.CPConnection)
52 }
53
54 evalOpts := &policydevel.EvalOptions{
55 PolicyPath: action.opts.PolicyPath,
56 MaterialKind: action.opts.Kind,
57 Annotations: action.opts.Annotations,
58 MaterialPath: action.opts.MaterialPath,
59 Inputs: action.opts.Inputs,
60 AllowedHostnames: action.opts.AllowedHostnames,
61 Debug: action.opts.Debug,
62 AttestationClient: attClient,
63 ControlPlaneConn: action.CPConnection,
64 ProjectName: action.opts.ProjectName,
65 ProjectVersionName: action.opts.ProjectVersionName,
66 }
67
68 // Evaluate policy
69 resp, err := policydevel.Evaluate(evalOpts, action.Logger)
70 if err != nil {
71 return nil, err
72 }
73
74 return resp, nil
75}

Callers 1

newPolicyDevelopEvalCmdFunction · 0.95

Calls 1

EvaluateFunction · 0.92

Tested by

no test coverage detected