* Add support for separate attestation storage repo * Move mapping file types and parsing to config package * Change signature of Verify to take image/platform * Separate Attestation Resolvers to their own files (registry, layout and referrers) * Add support configuring referrers resolution style in mapping.yaml * Add registry test
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package config
|
|
|
|
type PolicyMappings struct {
|
|
Version string `json:"version"`
|
|
Kind string `json:"kind"`
|
|
Policies []PolicyMapping `json:"policies"`
|
|
Mirrors []PolicyMirror `json:"mirrors"`
|
|
}
|
|
|
|
type AttestationSource string
|
|
|
|
const (
|
|
AttestationSourceAttached AttestationSource = "attached"
|
|
AttestationSourceReferrers AttestationSource = "referrers"
|
|
)
|
|
|
|
type PolicyMapping struct {
|
|
Id string `json:"id"`
|
|
Description string `json:"description"`
|
|
Origin *PolicyOrigin `json:"origin"`
|
|
Files []PolicyMappingFile `json:"files"`
|
|
Attestations *ReferrersConfig `json:"attestations"`
|
|
}
|
|
|
|
type ReferrersConfig struct {
|
|
Style AttestationSource `json:"style"`
|
|
Repo string `json:"repo"`
|
|
}
|
|
|
|
type PolicyMappingFile struct {
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
type PolicyMirror struct {
|
|
PolicyId string `yaml:"policy-id"`
|
|
Mirror MirrorSpec `json:"mirror"`
|
|
}
|
|
|
|
type MirrorSpec struct {
|
|
Domains []string `json:"domains"`
|
|
Prefix string `json:"prefix"`
|
|
}
|
|
|
|
type PolicyOrigin struct {
|
|
Name string `json:"name"`
|
|
Prefix string `json:"prefix"`
|
|
Domain string `json:"domain"`
|
|
}
|