mod backport

module backport

Backport list for one stack lock.

A locked module is on the list when an advisory matches its version and its reach class is cross-user or network-facing. local-only, not-reachable, and unclassified are recorded and left off the list. Blast radius is the SBOM closure: the module and every locked module that depends on it through a runtime or build edge.

Variables

const BACKPORT_LIST_SCHEMA_VERSION: u32

Schema of BackportDocument.

Functions

fn backport_list(request: &BackportRequest<'_>) -> Result<BackportDocument>

Resolve the advisories and classify every matching locked module.

fn render_markdown(document: &BackportDocument) -> String

Markdown for BackportDocument.

fn write_backport(path: &Path, document: &BackportDocument) -> Result<()>

Write the markdown. A path ending in .md also gets a sibling .json.

Structs and Unions

struct BackportDocument

The backport list for one lock.

schema_version: u32

BACKPORT_LIST_SCHEMA_VERSION.

lock: String

Lock path, as it was passed.

generation: String

Toolchain label of the lock.

advisories: Vec<String>

Advisory ids that were resolved, sorted.

stack_modules: usize

Packages in the lock.

listed: usize

Rows with BackportRow::on_list.

recorded: usize

Rows left off the list.

rows: Vec<BackportRow>

Matching modules. On-list rows come first.

notes: Vec<String>

Advisories that name a package the lock lacks, a version outside the range, or a range that did not parse.

struct BackportRequest<'a>

What stack sbom --backport-list reads.

lock: &'a StackLock

Stack lock.

lock_path: &'a Path

Path the lock was read from. Relative recipe paths resolve beside it.

cves: &'a [String]

Advisory ids. Empty means every id in Self::osv_cache.

osv_cache: Option<&'a Path>

Recorded OSV responses. Absent means a live fetch of Self::cves.

reachability: Option<&'a Path>

Site file of name class lines. Absent uses the built-in names.

struct BackportRow

One locked module an advisory matched.

module: String

Name/version-toolchain, plus the versionsuffix when the lock has one.

name: String

Package name.

version: String

Locked version.

reach: String

Reach class.

advisory: String

Advisory id.

fixed_in: Vec<String>

Upper bounds from a less-than clause. A less-than-or-equal bound is last-affected, not a fix.

blast_radius: usize

The module plus every locked module that depends on it.

blast: Vec<String>

Those module labels, sorted.

on_list: bool

true when justifies_backport is true for Self::reach.