sbom

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 12 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

Overview

Package sbom implements the unpacker that reads dependency data from a software bill of materials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDocument added in v0.3.3

func ParseDocument(r io.ReadSeeker) (*protosbom.Document, error)

ParseDocument reads a bill of materials in any format protobom understands, bare or wrapped in a security envelope (an in-toto statement, a DSSE envelope, a sigstore bundle), and returns the parsed document with its metadata.

Types

type Subject

type Subject struct {
	// Reader is the SBOM document stream.
	Reader io.ReadSeeker
	// Path is the path to an SBOM document on disk. It is opened lazily by the
	// unpacker when Reader is not set.
	Path string
}

Subject is the DecomposableSubject consumed by the SBOM unpacker. It wraps a software bill of materials in any of the formats protobom understands. Either Reader or Path must be set; when both are set Reader takes precedence.

func (*Subject) DecomposableType

func (s *Subject) DecomposableType() string

DecomposableType identifies this subject as an SBOM, routing it to the SBOM unpacker through the registry.

type Unpacker

type Unpacker struct{}

Unpacker reads dependency data out of an existing SBOM document. It has no decomposers: the SBOM format itself is the subject matter, parsed directly.

func NewUnpacker

func NewUnpacker() *Unpacker

NewUnpacker returns a ready-to-use SBOM unpacker.

func (*Unpacker) Extract

func (u *Unpacker) Extract(_ context.Context, subject api.DecomposableSubject) ([]*protosbom.NodeList, error)

Extract parses the SBOM in the subject and returns its node list.

func (*Unpacker) RegisterDecomposer

func (u *Unpacker) RegisterDecomposer(api.Decomposer)

RegisterDecomposer is a no-op: the SBOM unpacker has no decomposers.

func (*Unpacker) UnregisterDecomposer

func (u *Unpacker) UnregisterDecomposer(api.Decomposer)

UnregisterDecomposer is a no-op: the SBOM unpacker has no decomposers.

Jump to

Keyboard shortcuts

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