You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(osv): emit spec purl types and make the name fallback reachable
Five ecosystems declared as OSV-supported could never match. Bomly emitted
a purl type outside the spec for each of them, and the name+ecosystem
fallback that would have rescued them was unreachable.
PackageURLTypeForValues consults an explicit switch for every value and
otherwise returns the first non-empty value verbatim, so any ecosystem
without an explicit case leaked its Bomly identifier into the PURL:
pkg:erlang, pkg:haskell, pkg:r, pkg:ocaml, pkg:dpkg. Add explicit cases so
those map to hex, hackage, cran, opam and deb. Verified against the live
OSV API: pkg:cran/commonmark@1.8 and pkg:deb/debian/curl@7.64.0-4 return
advisories where pkg:r/... and pkg:dpkg/... return nothing.
Do the same for the ecosystems that only mapped correctly because the
package manager rescued them (rust, dotnet, dart, elixir, cpp). The
manager is not always populated, so the ecosystem alone now suffices.
Swift is deliberately left out: it is a purl type in its own right, and an
explicit case would beat cocoapods whenever the ecosystem is checked first.
Because SBOM ingest recovers the ecosystem from the purl type via
ParseEcosystem, which only knows Bomly's own identifiers, add an explicit
inverse table so a PURL Bomly emitted still round-trips.
Finally, make the OSV name+ecosystem fallback reachable: buildQuery now
uses it when the canonical PURL's type is not one OSV indexes. Where
neither the type nor the ecosystem is known to OSV, the PURL query is
still sent, so no package loses the query it gets today.
Fixes#317
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments