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

Function createPolicies

app/cli/internal/policydevel/eval.go:93–111  ·  view source on GitHub ↗
(policyPath string, inputs map[string]string)

Source from the content-addressed store, hash-verified

91}
92
93func createPolicies(policyPath string, inputs map[string]string) (*v1.Policies, error) {
94 // Check if the policy path already has a scheme (chainloop://, http://, https://, file://)
95 ref := policyPath
96 scheme, _ := policies.RefParts(policyPath)
97 if scheme == "" {
98 // Default to file://
99 ref = fmt.Sprintf("file://%s", policyPath)
100 }
101
102 return &v1.Policies{
103 Materials: []*v1.PolicyAttachment{
104 {
105 Policy: &v1.PolicyAttachment_Ref{Ref: ref},
106 With: inputs,
107 },
108 },
109 Attestation: nil,
110 }, nil
111}
112
113func verifyMaterial(pol *v1.Policies, material *v12.Attestation_Material, materialPath string, debug bool, allowedHostnames []string, attestationClient controlplanev1.AttestationServiceClient, grpcConn *grpc.ClientConn, projectName, projectVersion string, logger *zerolog.Logger) (*EvalSummary, error) {
114 var opts []policies.PolicyVerifierOption

Callers 1

EvaluateFunction · 0.85

Calls 1

RefPartsFunction · 0.92

Tested by

no test coverage detected