| 91 | } |
| 92 | |
| 93 | func 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 | |
| 113 | func 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 |