Documentation
¶
Index ¶
- Variables
- func ReadZipFile(ctx context.Context, f *zip.File, limit int64) ([]byte, error)
- type VerifiedBundle
- func (b *VerifiedBundle) ArchiveBytes() []byte
- func (b *VerifiedBundle) Digest() string
- func (b *VerifiedBundle) Extract(ctx context.Context, root *os.Root) error
- func (b *VerifiedBundle) Fingerprint() string
- func (b *VerifiedBundle) Manifest() pluginapi.Manifest
- func (b *VerifiedBundle) OpenArchive() (*zip.Reader, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
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 ¶
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 ¶
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.