artifact

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package artifact defines the private distribution manifest shared by packaging and runtime verification.

Index

Constants

View Source
const GuestABI = "debuglet-go-wasi-imports-v1"
View Source
const ManifestPath = "share/debuglet/manifest.json"
View Source
const Toolchain = "go1.26.8"

Variables

This section is empty.

Functions

func CheckUniqueJSON

func CheckUniqueJSON(data []byte) error

CheckUniqueJSON rejects duplicate object keys and extra JSON values.

func PayloadModes

func PayloadModes() map[string]fs.FileMode

PayloadModes returns a fresh map, so callers cannot mutate the contract.

func PayloadModesFor added in v0.3.0

func PayloadModesFor(component string) map[string]fs.FileMode

PayloadModesFor returns the exact file set for a full bundle (empty component) or one role. An unknown component has no payload.

func ValidSourceSHA

func ValidSourceSHA(sha string) bool

func ValidVersion

func ValidVersion(version string) bool

Types

type File

type File struct {
	SHA256 string `json:"sha256"`
	Bytes  int64  `json:"bytes"`
}

File records an exact payload's bytes and SHA-256 digest.

func HashFile

func HashFile(path string) (File, error)

HashFile reads only a regular file and returns its current exact identity.

type Manifest

type Manifest struct {
	SchemaVersion    int             `json:"schema_version"`
	Component        string          `json:"component,omitempty"`
	Version          string          `json:"version"`
	SourceSHA        string          `json:"source_sha"`
	Dirty            bool            `json:"dirty"`
	GoVersion        string          `json:"go_version"`
	GOOS             string          `json:"goos"`
	GOARCH           string          `json:"goarch"`
	GuestABI         string          `json:"guest_abi"`
	Files            map[string]File `json:"files"`
	BuildPipelineURL string          `json:"build_pipeline_url"`
}

Manifest identifies one complete installation. It never hashes itself.

func DecodeManifest

func DecodeManifest(data []byte) (Manifest, error)

DecodeManifest is bounded, rejects duplicate and unknown keys, and validates metadata before any payload is opened. Hashes provide identity, not signatures.

func DecodeManifestMetadata

func DecodeManifestMetadata(data []byte) (Manifest, error)

DecodeManifestMetadata validates metadata with an explicit file object. Build records use an empty object until the final payload manifest is assembled.

func Verify

func Verify(root string) (Manifest, error)

Verify requires the complete installed tree, with no additional members or symlinks. The selected root itself may be reached via a caller-resolved link.

Jump to

Keyboard shortcuts

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