types

package
v0.31.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BuildKitBuildType1  = "https://github.com/moby/buildkit/blob/master/docs/attestations/slsa-definitions.md"
	BuildKitBuildType02 = "https://mobyproject.org/buildkit@v1"

	ProvenanceSLSA1  = ProvenanceSLSA("v1")
	ProvenanceSLSA02 = ProvenanceSLSA("v0.2")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	Definition    []BuildStep              `json:"llbDefinition,omitempty"`
	DigestMapping map[digest.Digest]string `json:"digestMapping,omitempty"`
}

type BuildKitComplete added in v0.23.0

type BuildKitComplete struct {
	Request              bool `json:"request"`
	ResolvedDependencies bool `json:"resolvedDependencies"`
}

type BuildKitMetadata

type BuildKitMetadata struct {
	VCS      map[string]string                  `json:"vcs,omitempty"`
	Source   *Source                            `json:"source,omitempty"`
	Layers   map[string][][]ocispecs.Descriptor `json:"layers,omitempty"`
	SysUsage []*resourcestypes.SysSample        `json:"sysUsage,omitempty"`
	Network  *NetworkMetadata                   `json:"network,omitempty"`
}

type BuildStep

type BuildStep struct {
	ID            string                  `json:"id,omitempty"`
	Op            *pb.Op                  `json:"op,omitempty"`
	Inputs        []string                `json:"inputs,omitempty"`
	ResourceUsage *resourcestypes.Samples `json:"resourceUsage,omitempty"`
}

type Environment

type Environment struct {
	Platform          string `json:"platform"`
	DockerfileVersion string `json:"dockerfileVersion,omitempty"`
	ProvenanceCustomEnv
}

func (Environment) MarshalJSON added in v0.25.1

func (p Environment) MarshalJSON() ([]byte, error)

func (*Environment) UnmarshalJSON added in v0.25.1

func (p *Environment) UnmarshalJSON(data []byte) error

type GitBundle added in v0.30.0

type GitBundle struct {
	URL string `json:"url"`
}

GitBundle describes the bundle blob a git source was resolved from. URL is the full locator (e.g. "docker-image+blob://example.com/repo@sha256:...") and is the canonical data: scheme, reference body, and digest are all derivable from it and are parsed on demand by consumers (such as the purl emitter in predicate.go).

type GitSource

type GitSource struct {
	URL    string
	Commit string
	// Bundle, when non-nil, records the bundle blob that the git source
	// was resolved from. Only present on bundle-backed git sources; nil
	// for normal remote-backed git sources.
	Bundle *GitBundle `json:"bundle,omitempty"`
}

type HTTPSource

type HTTPSource struct {
	URL    string
	Digest digest.Digest
}

type ImageBlobSource added in v0.28.0

type ImageBlobSource struct {
	Ref    string
	Digest digest.Digest
	Local  bool
}

type ImageSource

type ImageSource struct {
	Ref      string
	Platform *ocispecs.Platform
	Digest   digest.Digest
	Local    bool
}

type LocalSource

type LocalSource struct {
	Name string `json:"name"`
}

func (*LocalSource) Equal added in v0.30.0

func (l *LocalSource) Equal(other *LocalSource) bool

Equal reports whether the local source matches another local source.

type NetworkMetadata added in v0.31.0

type NetworkMetadata struct {
	Mode  string                `json:"mode,omitempty"`
	Proxy *ProxyNetworkMetadata `json:"proxy,omitempty"`
}

type Parameters

type Parameters struct {
	Frontend             string                        `json:"frontend,omitempty"`
	Args                 map[string]string             `json:"args,omitempty"`
	Secrets              []*Secret                     `json:"secrets,omitempty"`
	SSH                  []*SSH                        `json:"ssh,omitempty"`
	Locals               []*LocalSource                `json:"locals,omitempty"`
	Inputs               map[string]*RequestProvenance `json:"inputs,omitempty"`
	Root                 *RequestProvenance            `json:"root,omitempty"`
	CompatibilityVersion int                           `json:"compatibilityVersion,omitempty"`
}

func (*Parameters) Clone added in v0.30.0

func (p *Parameters) Clone() *Parameters

Clone returns a deep copy of the request parameters.

func (*Parameters) Equal added in v0.30.0

func (p *Parameters) Equal(other *Parameters) bool

Equal reports whether the request parameters match another set of parameters.

type ProvenanceBuildDefinitionSLSA1 added in v0.23.0

type ProvenanceBuildDefinitionSLSA1 struct {
	slsa1.ProvenanceBuildDefinition
	ExternalParameters ProvenanceExternalParametersSLSA1 `json:"externalParameters"`
	InternalParameters ProvenanceInternalParametersSLSA1 `json:"internalParameters"`
}

type ProvenanceConfigSourceSLSA1 added in v0.23.0

type ProvenanceConfigSourceSLSA1 struct {
	URI    string         `json:"uri,omitempty"`
	Digest slsa.DigestSet `json:"digest,omitempty"`
	Path   string         `json:"path,omitempty"`
}

func (ProvenanceConfigSourceSLSA1) Clone added in v0.30.0

Clone returns a deep copy of the config source.

func (ProvenanceConfigSourceSLSA1) Equal added in v0.30.0

Equal reports whether the config source matches another config source.

type ProvenanceCustomEnv added in v0.25.0

type ProvenanceCustomEnv map[string]any

type ProvenanceExternalParametersSLSA1 added in v0.23.0

type ProvenanceExternalParametersSLSA1 struct {
	ConfigSource ProvenanceConfigSourceSLSA1 `json:"configSource"`
	Request      Parameters                  `json:"request"`
}

type ProvenanceInternalParametersSLSA1 added in v0.23.0

type ProvenanceInternalParametersSLSA1 struct {
	BuildConfig       *BuildConfig `json:"buildConfig,omitempty"`
	BuilderPlatform   string       `json:"builderPlatform"`
	DockerfileVersion string       `json:"dockerfileVersion,omitempty"`
	ProvenanceCustomEnv
}

func (ProvenanceInternalParametersSLSA1) MarshalJSON added in v0.25.1

func (p ProvenanceInternalParametersSLSA1) MarshalJSON() ([]byte, error)

MarshalJSON flattens ProvenanceCustomEnv into top level.

func (*ProvenanceInternalParametersSLSA1) UnmarshalJSON added in v0.25.1

func (p *ProvenanceInternalParametersSLSA1) UnmarshalJSON(data []byte) error

UnmarshalJSON fills both struct fields and flattened custom env.

type ProvenanceInvocationSLSA02 added in v0.23.0

type ProvenanceInvocationSLSA02 struct {
	ConfigSource slsa02.ConfigSource `json:"configSource"`
	Parameters   Parameters          `json:"parameters"`
	Environment  Environment         `json:"environment"`
}

type ProvenanceMetadataSLSA1 added in v0.23.0

type ProvenanceMetadataSLSA1 struct {
	slsa1.BuildMetadata
	BuildKitMetadata BuildKitMetadata `json:"buildkit_metadata"`
	Hermetic         bool             `json:"buildkit_hermetic,omitempty"`
	Completeness     BuildKitComplete `json:"buildkit_completeness"`
	Reproducible     bool             `json:"buildkit_reproducible,omitempty"`
}

type ProvenanceMetadataSLSA02 added in v0.23.0

type ProvenanceMetadataSLSA02 struct {
	slsa02.ProvenanceMetadata
	BuildKitMetadata BuildKitMetadata `json:"https://mobyproject.org/buildkit@v1#metadata"`
	Hermetic         bool             `json:"https://mobyproject.org/buildkit@v1#hermetic,omitempty"`
}

type ProvenancePredicateSLSA1 added in v0.23.0

type ProvenancePredicateSLSA1 struct {
	slsa1.ProvenancePredicate
	BuildDefinition ProvenanceBuildDefinitionSLSA1 `json:"buildDefinition"`
	RunDetails      ProvenanceRunDetailsSLSA1      `json:"runDetails"`
}

func (*ProvenancePredicateSLSA1) ConvertToSLSA02 added in v0.24.0

ConvertToSLSA02 converts to a SLSA v0.2 provenance predicate.

type ProvenancePredicateSLSA02 added in v0.23.0

type ProvenancePredicateSLSA02 struct {
	slsa02.ProvenancePredicate
	Invocation  ProvenanceInvocationSLSA02 `json:"invocation"`
	BuildConfig *BuildConfig               `json:"buildConfig,omitempty"`
	Metadata    *ProvenanceMetadataSLSA02  `json:"metadata,omitempty"`
}

func (*ProvenancePredicateSLSA02) ConvertToSLSA1 added in v0.24.0

ConvertToSLSA1 converts to a SLSA v1 provenance predicate.

type ProvenanceRunDetailsSLSA1 added in v0.23.0

type ProvenanceRunDetailsSLSA1 struct {
	slsa1.ProvenanceRunDetails
	Metadata *ProvenanceMetadataSLSA1 `json:"metadata,omitempty"`
}

type ProvenanceSLSA added in v0.23.0

type ProvenanceSLSA string

func (*ProvenanceSLSA) Validate added in v0.23.0

func (ps *ProvenanceSLSA) Validate() error

type ProxyCaptureIncomplete added in v0.31.0

type ProxyCaptureIncomplete struct {
	Op       string `json:"op,omitempty"`
	Name     string `json:"name,omitempty"`
	Method   string `json:"method,omitempty"`
	URI      string `json:"uri,omitempty"`
	FinalURI string `json:"finalUri,omitempty"`
	Reason   string `json:"reason,omitempty"`
}

type ProxyNetworkMetadata added in v0.31.0

type ProxyNetworkMetadata struct {
	Incomplete []ProxyCaptureIncomplete `json:"incomplete,omitempty"`
}

type RequestProvenance added in v0.30.0

type RequestProvenance struct {
	ConfigSource ProvenanceConfigSourceSLSA1 `json:"configSource"`
	Request      *Parameters                 `json:"request,omitempty"`
}

func (*RequestProvenance) Clone added in v0.30.0

Clone returns a deep copy of the request provenance.

func (*RequestProvenance) Equal added in v0.30.0

func (r *RequestProvenance) Equal(other *RequestProvenance) bool

Equal reports whether the request provenance matches another request provenance.

type SSH

type SSH struct {
	ID       string `json:"id"`
	Optional bool   `json:"optional,omitempty"`
}

func (*SSH) Equal added in v0.30.0

func (s *SSH) Equal(other *SSH) bool

Equal reports whether the SSH mount matches another SSH mount.

type Secret

type Secret struct {
	ID       string `json:"id"`
	Optional bool   `json:"optional,omitempty"`
}

func (*Secret) Equal added in v0.30.0

func (s *Secret) Equal(other *Secret) bool

Equal reports whether the secret matches another secret.

type Source

type Source struct {
	Locations map[string]*pb.Locations `json:"locations,omitempty"`
	Infos     []SourceInfo             `json:"infos,omitempty"`
}

type SourceInfo

type SourceInfo struct {
	Filename      string                   `json:"filename,omitempty"`
	Language      string                   `json:"language,omitempty"`
	Data          []byte                   `json:"data,omitempty"`
	Definition    []BuildStep              `json:"llbDefinition,omitempty"`
	DigestMapping map[digest.Digest]string `json:"digestMapping,omitempty"`
}

type Sources

type Sources struct {
	Images     []ImageSource
	ImageBlobs []ImageBlobSource
	Git        []GitSource
	HTTP       []HTTPSource
	Local      []LocalSource
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL