Files
attest/mirror/types.go

51 lines
1.0 KiB
Go
Raw Normal View History

2024-04-15 15:20:56 -05:00
package mirror
import (
"github.com/docker/attest/oci"
"github.com/docker/attest/tuf"
2024-04-15 15:20:56 -05:00
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/theupdateframework/go-tuf/v2/metadata"
)
const (
2024-07-11 09:41:04 -05:00
DefaultMetadataURL = "https://docker.github.io/tuf/metadata"
DefaultTargetsURL = "https://docker.github.io/tuf/targets"
2024-04-15 15:20:56 -05:00
tufMetadataMediaType = "application/vnd.tuf.metadata+json"
tufTargetMediaType = "application/vnd.tuf.target"
tufFileAnnotation = "tuf.io/filename"
)
type TUFRole string
2024-04-15 15:20:56 -05:00
var TUFRoles = []TUFRole{metadata.ROOT, metadata.SNAPSHOT, metadata.TARGETS, metadata.TIMESTAMP}
2024-04-15 15:20:56 -05:00
type TUFMetadata struct {
2024-04-15 15:20:56 -05:00
Root map[string][]byte
Snapshot map[string][]byte
Targets map[string][]byte
Timestamp []byte
}
type DelegatedTargetMetadata struct {
Name string
Version string
Data []byte
}
type Image struct {
2024-08-12 16:43:42 -05:00
Image *oci.EmptyConfigImage
2024-04-15 15:20:56 -05:00
Tag string
}
type Index struct {
2024-06-14 10:03:39 -05:00
Index v1.ImageIndex
2024-04-15 15:20:56 -05:00
Tag string
}
type TUFMirror struct {
TUFClient *tuf.Client
2024-04-15 15:20:56 -05:00
tufPath string
metadataURL string
targetsURL string
}