Documentation
¶
Overview ¶
Package bom implements consuming Red Hat's java-flavored BOMs.
Index ¶
- Constants
- Variables
- func FormatFromName(name string) (cyclonedx.BOMFileFormat, error)
- func LoadCDX(ctx context.Context, r io.ReaderAt, format cyclonedx.BOMFileFormat) (iter.Seq2[Package, error], error)
- func PopulatePackage(pkg *claircore.Package, bp Package, sbomFile string) error
- func ReadMax(r io.Reader) ([]byte, error)
- type Package
Constants ¶
View Source
const MaxDocument = 64 << 20
MaxDocument is the most a compressed CycloneDX document may expand to. Jar members use the same limit.
Variables ¶
View Source
var ( // ErrBadFormat is a sentinel error for Red Hat-flavor requirement checks. ErrBadFormat = errors.New("java/bom: bad format") // ErrTooLarge is returned when a document exceeds [MaxDocument]. ErrTooLarge = errors.New("java/bom: document exceeds size limit") // ErrNoProduct is returned when a document has no product CPE on an excluded // framework component or on the root component. Callers should ignore the // document and continue scanning. ErrNoProduct = errors.New("java/bom: no product CPE") )
View Source
var ( HashSHA1 = unique.Make(`sha1`) HashSHA256 = unique.Make(`sha256`) )
Known hash kinds.
Functions ¶
func FormatFromName ¶
func FormatFromName(name string) (cyclonedx.BOMFileFormat, error)
FormatFromName reports the encoding named by a CycloneDX filename. A trailing ".gz" is ignored.
func LoadCDX ¶
func LoadCDX(ctx context.Context, r io.ReaderAt, format cyclonedx.BOMFileFormat) (iter.Seq2[Package, error], error)
LoadCDX loads a Red Hat-Java-flavored CycloneDX SBoM in the encoding named by format. A compressed document is decompressed before parsing, and that expansion is limited to MaxDocument.
func PopulatePackage ¶
PopulatePackage fills pkg from an SBOM component.
func ReadMax ¶
ReadMax reads r until EOF or one byte past MaxDocument. More than MaxDocument bytes returns ErrTooLarge.
Types ¶
Click to show internal directories.
Click to hide internal directories.