summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2022-08-25 01:11:07 +0200
committerMiloslav Trmač <mitr@redhat.com>2022-08-29 17:55:39 +0200
commit093054ae3c9bd869cbe1d4daf2e8321115484f18 (patch)
tree854fe3d252d262f18ef0b0632ec8b0a1facce6d3
parent765c37c398d5c728e9de1e919020308ecaae5650 (diff)
downloadpodman-093054ae3c9bd869cbe1d4daf2e8321115484f18.tar.gz
podman-093054ae3c9bd869cbe1d4daf2e8321115484f18.tar.bz2
podman-093054ae3c9bd869cbe1d4daf2e8321115484f18.zip
Reorganize the types in policy.go a bit
... to go from top to bottom. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r--pkg/trust/policy.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/trust/policy.go b/pkg/trust/policy.go
index a41982c13..daa7698b2 100644
--- a/pkg/trust/policy.go
+++ b/pkg/trust/policy.go
@@ -23,6 +23,12 @@ type policyContent struct {
Transports transportsContent `json:"transports,omitempty"`
}
+// transportsContent contains policies for individual transports (= c/image/v5/signature.Policy.Transports)
+type transportsContent map[string]repoMap
+
+// repoMap maps a scope name to requirements that apply to that scope (= c/image/v5/signature.PolicyTransportScopes)
+type repoMap map[string][]repoContent
+
// repoContent is a single policy requirement (one of possibly several for a scope), representing all of the individual alternatives in a single merged struct
// (= c/image/v5/signature.{PolicyRequirement,pr*})
type repoContent struct {
@@ -34,12 +40,6 @@ type repoContent struct {
SignedIdentity json.RawMessage `json:"signedIdentity,omitempty"`
}
-// repoMap maps a scope name to requirements that apply to that scope (= c/image/v5/signature.PolicyTransportScopes)
-type repoMap map[string][]repoContent
-
-// transportsContent contains policies for individual transports (= c/image/v5/signature.Policy.Transports)
-type transportsContent map[string]repoMap
-
// DefaultPolicyPath returns a path to the default policy of the system.
func DefaultPolicyPath(sys *types.SystemContext) string {
systemDefaultPolicyPath := "/etc/containers/policy.json"