scansource

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package scansource adapts SCANOSS SDK values (a v3 scan result and a vulnerabilities decoration response) into the neutral sbom.Inventory consumed by the sbom package. It is the only SBOM code that depends on the scan SDK; the sbom package itself stays SDK-free.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CryptographyFrom

func CryptographyFrom(resp *scanossapi.CryptoAlgorithmsResponse) map[string][]sbom.CryptoAlgorithm

CryptographyFrom maps a cryptography-algorithms decoration response into algorithms keyed by LicenseKey(purl, requirement).

func FromScanResult

func FromScanResult(result *scanossapi.ScanResult) sbom.Inventory

FromScanResult builds an Inventory from a v3 scan result. The deduplicated component catalog becomes the components; each component's matched files (joined by url_hash) become its file evidence. The version is taken from the component entry. Licenses and vulnerabilities are not populated here — they come from decoration services (LicensesFrom, VulnerabilitiesFrom).

func GeoprovenanceFrom

func GeoprovenanceFrom(resp *scanossapi.GeoOriginResponse) map[string][]sbom.GeoLocation

GeoprovenanceFrom maps a geoprovenance-origin decoration response into contributor locations keyed by PURL (the response carries no requirement to join on).

func LicenseKey

func LicenseKey(purl, version string) string

LicenseKey is the join key matching a decoration response entry to a component: its PURL plus the queried version (the decoration echoes the queried version back as `requirement`).

func LicensesFrom

func LicensesFrom(resp *scanossapi.ComponentsLicenseResponse) map[string][]sbom.License

LicensesFrom maps a licenses decoration response into declared licenses keyed by LicenseKey(purl, requirement). Duplicate ids per key are dropped. (The decoration service has no declared/concluded distinction — its licenses are declared.)

func VulnerabilitiesFrom

func VulnerabilitiesFrom(resp *scanossapi.VulnerabilitiesResponse) []sbom.Vulnerability

VulnerabilitiesFrom maps a vulnerabilities decoration response into neutral vulnerabilities, deduplicated by id (falling back to the CVE), accumulating the affected component PURLs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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