Documentation
¶
Overview ¶
Package sbom generates SPDX SBOM documents for scafctl catalog artifacts.
Index ¶
Constants ¶
View Source
const MediaType = "application/spdx+json"
MediaType is the IANA media type for SPDX JSON SBOM documents.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnnotationSPDX ¶
type AnnotationSPDX struct {
Annotator string `json:"annotator"`
Date string `json:"annotationDate"`
Type string `json:"annotationType"`
Comment string `json:"comment"`
}
AnnotationSPDX is a free-form annotation on a package.
type CreationInfo ¶
CreationInfo contains metadata about when and how the SBOM was created.
type Document ¶
type Document struct {
SPDXVersion string `json:"spdxVersion"`
DataLicense string `json:"dataLicense"`
SPDXID string `json:"SPDXID"`
Name string `json:"name"`
Namespace string `json:"documentNamespace"`
CreationInfo CreationInfo `json:"creationInfo"`
Packages []Package `json:"packages"`
Relationships []Relationship `json:"relationships,omitempty"`
ExtractedTexts []ExtractedText `json:"hasExtractedLicensingInfos,omitempty"`
}
Document represents an SPDX 2.3 JSON document.
type ExternalRef ¶
type ExternalRef struct {
Category string `json:"referenceCategory"`
Type string `json:"referenceType"`
Locator string `json:"referenceLocator"`
}
ExternalRef links to an external identifier (e.g., purl).
type ExtractedText ¶
type ExtractedText struct {
ID string `json:"licenseId"`
Name string `json:"name"`
Text string `json:"extractedText"`
}
ExtractedText holds extracted license text for custom licenses.
type GenerateOptions ¶
type GenerateOptions struct {
// Namespace is the SPDX document namespace URI.
// If empty, a default based on the solution name and version is used.
Namespace string
// ContentDigest is the sha256 digest of the primary content layer.
ContentDigest string
// BundleDigest is the sha256 digest of the bundle layer (empty if no bundle).
BundleDigest string
// BinaryName is the tool name (e.g., "scafctl") for the creator field.
BinaryName string
}
GenerateOptions configures SBOM generation.
type Package ¶
type Package struct {
SPDXID string `json:"SPDXID"`
Name string `json:"name"`
Version string `json:"versionInfo,omitempty"`
Supplier string `json:"supplier,omitempty"`
DownloadLocation string `json:"downloadLocation"`
FilesAnalyzed bool `json:"filesAnalyzed"`
Checksums []Checksum `json:"checksums,omitempty"`
ExternalRefs []ExternalRef `json:"externalRefs,omitempty"`
Description string `json:"description,omitempty"`
PrimaryPurpose string `json:"primaryPackagePurpose,omitempty"`
Annotations []AnnotationSPDX `json:"annotations,omitempty"`
}
Package represents an SPDX package (the solution or a dependency).
type Relationship ¶
type Relationship struct {
Element string `json:"spdxElementId"`
Type string `json:"relationshipType"`
Related string `json:"relatedSpdxElement"`
}
Relationship describes a dependency or composition link.
Click to show internal directories.
Click to hide internal directories.