@@ -26,11 +26,12 @@ import (
2626
2727func newPolicyDevelopEvalCmd () * cobra.Command {
2828 var (
29- materialPath string
30- kind string
31- annotations []string
32- policyPath string
33- inputs []string
29+ materialPath string
30+ kind string
31+ annotations []string
32+ policyPath string
33+ inputs []string
34+ allowedHostnames []string
3435 )
3536
3637 cmd := & cobra.Command {
@@ -44,11 +45,12 @@ evaluates the policy against the provided material or attestation.`,
4445 chainloop policy eval --policy policy.yaml --material sbom.json --kind SBOM_CYCLONEDX_JSON --annotation key1=value1,key2=value2 --input key3=value3` ,
4546 RunE : func (_ * cobra.Command , _ []string ) error {
4647 opts := & action.PolicyEvalOpts {
47- MaterialPath : materialPath ,
48- Kind : kind ,
49- Annotations : parseKeyValue (annotations ),
50- PolicyPath : policyPath ,
51- Inputs : parseKeyValue (inputs ),
48+ MaterialPath : materialPath ,
49+ Kind : kind ,
50+ Annotations : parseKeyValue (annotations ),
51+ PolicyPath : policyPath ,
52+ Inputs : parseKeyValue (inputs ),
53+ AllowedHostnames : allowedHostnames ,
5254 }
5355
5456 policyEval , err := action .NewPolicyEval (opts , actionOpts )
@@ -71,6 +73,7 @@ evaluates the policy against the provided material or attestation.`,
7173 cmd .Flags ().StringSliceVar (& annotations , "annotation" , []string {}, "Key-value pairs of material annotations (key=value)" )
7274 cmd .Flags ().StringVarP (& policyPath , "policy" , "p" , "policy.yaml" , "Path to custom policy file" )
7375 cmd .Flags ().StringSliceVar (& inputs , "input" , []string {}, "Key-value pairs of policy inputs (key=value)" )
76+ cmd .Flags ().StringSliceVar (& allowedHostnames , "allowed-hostnames" , []string {}, "Additional hostnames allowed for http.send requests in policies" )
7477
7578 return cmd
7679}
0 commit comments