Skip to main content

Crate vlz_db

Crate vlz_db 

Source

Structs§

AffectedEvent
One OSV range event (introduced / fixed / last_affected / limit).
AffectedRange
One advisory version range from a provider (FR-039).
CacheEntryInfo
Summary of a single cache entry (FR-035, OP-009). When raw_vulns is Some, the entry includes the full CVE payload (e.g. for vlz db show --full).
CorpusDocument
Versioned corpus document (vlz db import).
CorpusEntry
One cache entry to import (FR-021a).
CveEvidenceLocation
First-party source line referencing an advisory symbol (FR-032 evidence).
CveRecord
DatabaseStats
FileIgnoreDb
File-backed IgnoreDb using versioned JSON and atomic rename writes.
FpEntry
Stored row for a CVE marked as false positive (FR-015). Optional VEX triage fields (justification, status, detail) are schema-compatible with v1: absent on disk deserializes as None.
FpMarkFields
Caller-supplied FP mark fields (comment / project / VEX triage / W3-2).
FpMarkMeta
Audit metadata written on each FP mark.
ImportableEntry
Parsed entry ready for DatabaseBackend::put.
MatchExplain
Structured matching / explain payload attached to a CVE finding (W3-1).
MatchQuery
Package identity used when querying CVE providers (W3-1).
Package
Scanned package identity for CVE lookup and reporting.
PackageDeclarationLocation
Line-level location where a dependency is declared (FR-036a).
PurgeEntry
Minimal struct for purge: only need expires_at to decide whether to remove.
StoredEntry
Serialized form of a cache entry (raw vuln JSON per package+provider + TTL).

Enums§

AffectedRangeType
OSV affected[].ranges[].type values we decode (FR-039).
CorpusImportError
Errors while parsing or verifying a corpus file.
CvssVersion
CVSS version used for the primary score (FR-034).
DatabaseError
Errors that can bubble up from any backend implementation.
DeclarationKind
Manifest or lockfile origin of a dependency declaration (FR-036a Tier 1).
FindingClass
Finding class for report consumers (OSV CVE/GHSA vs MAL-*).
Severity
Severity label for display in reports (FR-013). Derived from primary CVSS score + configurable thresholds.
TtlSelector
Selector for which cache entries to update TTL (OP-015).

Constants§

CORPUS_SCHEMA_VERSION
Schema version for the vlz corpus JSON envelope.
COSIGN_BIN_NAME
Allowlisted cosign binary name (SEC-025).
COSIGN_BUNDLE_SUFFIX
Sibling Sigstore bundle suffix (file.json -> file.json.sigstore.json).
CRATES_IO_ECOSYSTEM
OSV / package ecosystem for crates.io (Rust).
DEFAULT_IGNORE_FILE_NAME
Default ignore filename for new installs (OP-002, OP-003).
GO_ECOSYSTEM
OSV / package ecosystem for Go modules.
IGNORE_FILE_SCHEMA_VERSION
Schema version for on-disk JSON ignore files.
LEGACY_IGNORE_REDB_FILE_NAME
Legacy RedB ignore filename (migration source for the default JSON name).
MAVEN_ECOSYSTEM
OSV / package ecosystem for Maven (Java / Kotlin JVM libraries).
MAX_DECLARATIONS_PER_FINDING
Cap declaration SARIF locations per result (aligned with evidence cap).
NPM_ECOSYSTEM
OSV / package ecosystem for npm (JavaScript / TypeScript).
NUGET_ECOSYSTEM
OSV / package ecosystem for NuGet (.NET).
PACKAGIST_ECOSYSTEM
OSV / package ecosystem for Packagist (PHP / Composer).
PUBSPEC_LOCK_FILE_NAME
Dart / Flutter lock basename (Appendix A).
PUBSPEC_MANIFEST_FILE_NAME
Dart / Flutter manifest basename (FR-005).
PUB_ECOSYSTEM
OSV / package ecosystem for Pub (Dart / Flutter).
PUB_PURL_TYPE
PURL type for Pub packages (pkg:pub/<name>@<version>).
PYPI_ECOSYSTEM
OSV / package ecosystem for PyPI (Python).
RANGE_TYPE_ECOSYSTEM
OSV advisory range type string for ECOSYSTEM ranges (FR-039, NFR-024).
RANGE_TYPE_GIT
OSV advisory range type string for GIT ranges (FR-039, NFR-024).
RANGE_TYPE_SEMVER
OSV advisory range type string for SEMVER ranges (FR-039, NFR-024).
RAW_IDENTITY_SCALAR_KEYS
Scalar JSON keys that carry a vulnerability identity.
RUBYGEMS_ECOSYSTEM
OSV / package ecosystem for RubyGems (Ruby).
WINNER_REASON_AFFECTED_RANGES
Winner selection reason when merging multi-provider records (FR-019-EXT).
WINNER_REASON_CVSS_VERSION
Winner had a newer CVSS version than other candidates.
WINNER_REASON_PROVIDER_ORDER
Winner won on user --providers list order.
WINNER_REASON_SOLE
Sole provider record in the alias group (no merge contest).

Traits§

DatabaseBackend
IgnoreDb
Trait for false-positive (ignore) database backends (FR-015). Any backend (RedB, SQLite, etc.) must implement this contract so that project_id-scoped filtering works consistently across implementations.

Functions§

cosign_available
True when cosign is executable on PATH.
declaration_dedupe_key
Dedupe key for declaration locations.
dedupe_sort_declarations
Dedupe and sort declaration locations in place.
ecosystem_for_purl_type
OSV ecosystem label for a PURL type (FR-038 import).
entry_is_expired
True when the entry is past its expiry (treat as cache miss).
finding_class_for_id
Derive FindingClass from a vulnerability record id.
fp_entry_applies_to_paths
True when the FP entry applies to the given finding manifest paths (W3-2).
fp_entry_applies_to_paths_under_root
Like fp_entry_applies_to_paths, also matching repo-relative scopes against absolute manifests under scan_root (W3-2).
fp_entry_is_active
True when the FP entry is still active at now_secs (W3-2).
hex_encode
Hex-encode bytes as lowercase.
importable_entries
Convert parsed corpus entries into put-ready records.
is_cve_id
True when s looks like a CVE ID (CVE-YYYY-NNNN, case-insensitive).
is_mal_id
True when s looks like an OSV malicious-package ID (MAL-YYYY-NNNN).
legacy_redb_path_for_json
Derive the legacy .redb path for a JSON ignore path (same stem, .redb extension). Example: vlz-ignore.json → vlz-ignore.redb, fps.json → fps.redb.
match_query_for
Build a MatchQuery from package identity fields.
matching_fp_entry
FP entry for record_id, including marks stored under pre-merge alias keys.
new_stored_entry
Build a new stored entry for a fresh put.
normalize_stored_entry
Normalize after deserialization: fill added_at_secs/ttl_secs from expiry if missing.
normalize_vuln_id
Canonical form for merge keys and ranking: uppercase CVE IDs, else as-is.
package_from_purl
Parse a Package URL into a Package for CVE lookup (FR-038 / W3-3).
parse_corpus_json
Parse corpus JSON: versioned envelope or bare db show --full --format json array of cache entry objects.
parse_pkg_cache_key
Split name::version::provider_id (name may contain ::).
pkg_cache_key
Cache key: name::version::provider_id.
purl_for_package
PURL for a resolved package (SEC-019 CycloneDX 1.6, SPDX 3.0).
purl_type_for_ecosystem
PURL type string for SBOM output from a package ecosystem (SEC-019).
raw_identity_ids
Identity strings from a raw provider blob (CVE-normalized matching later).
raw_matches_record_id
True when a raw identity field matches record_id (CVE-normalized).
record_identity_ids
Identity strings for FP/VEX lookup: merged record_id plus matching raw fields.
record_is_fp_marked
True when any identity for record_id matches a marked FP key (CVE-normalized).
reject_world_writable_db
SEC-014: Returns Err if the file at path exists and is world-writable. Call before opening a cache or ignore DB file. Group or other write bits (0o022) indicate world-writable.
sha256_hex
SHA-256 of bytes as lowercase hex.
sibling_cosign_bundle
Default detached cosign bundle path beside path ({path}.sigstore.json).
sort_declarations
Sort declarations: manifest before lockfile, then path, then line.
unix_now_secs
Unix seconds since epoch (0 if clock is before epoch).
verify_cosign_blob
Run cosign verify-blob --bundle BUNDLE PATH (fail closed).
verify_sha256
Verify file bytes against an expected lowercase hex SHA-256 digest.