bundle

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBundle    = errors.New("invalid plugin bundle")
	ErrSignature = errors.New("plugin signature verification failed")
	ErrLimit     = errors.New("plugin bundle limit exceeded")
)

Functions

func ReadZipFile

func ReadZipFile(ctx context.Context, f *zip.File, limit int64) ([]byte, error)

ReadZipFile reads a bounded entry from a verified ZIP archive.

Types

type VerifiedBundle

type VerifiedBundle struct {
	// contains filtered or unexported fields
}

VerifiedBundle is an immutable snapshot of a verified ZIP. It owns no open files and executes no code. Inspection is bounded by MaxArchiveBytes and should run in a worker; callers must bound concurrent inspections as well.

func InspectBundle

func InspectBundle(ctx context.Context, source io.Reader, platform string) (*VerifiedBundle, error)

InspectBundle snapshots and verifies an untrusted archive. platform is the host's GOOS-GOARCH. A verified self-signature is NOT publisher trust.

func (*VerifiedBundle) ArchiveBytes

func (b *VerifiedBundle) ArchiveBytes() []byte

ArchiveBytes returns a copy of the verified ZIP archive bytes.

func (*VerifiedBundle) Digest

func (b *VerifiedBundle) Digest() string

Digest binds approval to the exact inspected archive, not a mutable file path.

func (*VerifiedBundle) Extract

func (b *VerifiedBundle) Extract(ctx context.Context, root *os.Root) error

Extract writes a verified snapshot into a new, private staging root owned by the installer. os.Root confines operations even if a parent path is a symlink. Existing files are never overwritten. The installer owns cleanup on any error.

func (*VerifiedBundle) Fingerprint

func (b *VerifiedBundle) Fingerprint() string

Fingerprint returns the hex-encoded SHA-256 digest of the publisher public key.

func (*VerifiedBundle) Manifest

func (b *VerifiedBundle) Manifest() pluginapi.Manifest

Manifest returns a fresh copy; callers cannot mutate the verified identity, inventory, or capabilities by editing maps/slices returned during review.

func (*VerifiedBundle) OpenArchive

func (b *VerifiedBundle) OpenArchive() (*zip.Reader, error)

OpenArchive opens a read-only zip.Reader over the verified archive snapshot.

Jump to

Keyboard shortcuts

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