mirror of
https://github.com/containers/podman.git
synced 2025-07-03 17:27:18 +08:00
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>
This commit is contained in:
@ -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"
|
||||
|
Reference in New Issue
Block a user