diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/trust.go | 20 | ||||
-rw-r--r-- | pkg/trust/config.go | 6 | ||||
-rw-r--r-- | pkg/trust/trust.go | 2 |
3 files changed, 17 insertions, 11 deletions
diff --git a/pkg/domain/infra/abi/trust.go b/pkg/domain/infra/abi/trust.go index 3777c1d3b..df4081349 100644 --- a/pkg/domain/infra/abi/trust.go +++ b/pkg/domain/infra/abi/trust.go @@ -122,18 +122,24 @@ func getPolicyShowOutput(policyContentStruct trust.PolicyContent, systemRegistri if len(policyContentStruct.Default) > 0 { defaultPolicyStruct := trust.Policy{ - Name: "* (default)", - RepoName: "default", - Type: trustTypeDescription(policyContentStruct.Default[0].Type), + Transport: "all", + Name: "* (default)", + RepoName: "default", + Type: trustTypeDescription(policyContentStruct.Default[0].Type), } output = append(output, &defaultPolicyStruct) } - for _, transval := range policyContentStruct.Transports { + for transport, transval := range policyContentStruct.Transports { + if transport == "docker" { + transport = "repository" + } + for repo, repoval := range transval { tempTrustShowOutput := trust.Policy{ - Name: repo, - RepoName: repo, - Type: repoval[0].Type, + Name: repo, + RepoName: repo, + Transport: transport, + Type: trustTypeDescription(repoval[0].Type), } // TODO - keyarr is not used and I don't know its intent; commenting out for now for someone to fix later //keyarr := []string{} diff --git a/pkg/trust/config.go b/pkg/trust/config.go index 164df2a90..6186d4cbd 100644 --- a/pkg/trust/config.go +++ b/pkg/trust/config.go @@ -2,11 +2,11 @@ package trust // Policy describes a basic trust policy configuration type Policy struct { - Name string `json:"name"` + Transport string `json:"transport"` + Name string `json:"name,omitempty"` RepoName string `json:"repo_name,omitempty"` Keys []string `json:"keys,omitempty"` - SignatureStore string `json:"sigstore"` - Transport string `json:"transport"` + SignatureStore string `json:"sigstore,omitempty"` Type string `json:"type"` GPGId string `json:"gpg_id,omitempty"` } diff --git a/pkg/trust/trust.go b/pkg/trust/trust.go index 584d1fa02..1d0cc61ba 100644 --- a/pkg/trust/trust.go +++ b/pkg/trust/trust.go @@ -21,7 +21,7 @@ import ( // PolicyContent struct for policy.json file type PolicyContent struct { Default []RepoContent `json:"default"` - Transports TransportsContent `json:"transports"` + Transports TransportsContent `json:"transports,omitempty"` } // RepoContent struct used under each repo |