pub struct OsvImportRecord {
pub id: String,
pub modified: Option<String>,
pub summary: Option<String>,
pub details: Option<String>,
pub affected: Vec<OsvAffected>,
pub severity: Vec<OsvSeverity>,
pub database_specific: Option<Value>,
}Expand description
Upstream advisory shape, trimmed to just the fields the importer reads.
Anything not modeled here is preserved verbatim in extra_json.
Fields§
§id: StringUpstream id — e.g. GHSA-xxx-xxx-xxx, CVE-2024-1234.
modified: Option<String>Optional ISO-8601 modified timestamp from the advisory. Used to
pick the newer record when the same advisory_id is imported
twice.
summary: Option<String>Human-readable summary. Falls back to details on import.
details: Option<String>§affected: Vec<OsvAffected>Each affected[] entry names a single package and the version
ranges it applies to. Kept alongside the record so the scanner can
do precise range checks later.
severity: Vec<OsvSeverity>CVSS or SSVC severity. First entry is used as the coarse bucket.
database_specific: Option<Value>GHSA + a handful of other feeds park a qualitative severity label
("CRITICAL", "HIGH", …) inside database_specific.severity
when the top-level CVSS vector is absent. We keep the whole
database_specific object loose since its shape varies by feed.
Implementations§
Source§impl OsvImportRecord
impl OsvImportRecord
Sourcepub fn severity_bucket(&self) -> &'static str
pub fn severity_bucket(&self) -> &'static str
Map the record’s severity vector to one of the four coarse buckets
the scanner surfaces. OSV files mix CVSS 3.1 vectors and plain
numeric strings; we handle the common shapes and default to
"medium" for anything unrecognized rather than dropping the
advisory on the floor.
Sourcepub fn human_summary(&self) -> String
pub fn human_summary(&self) -> String
Best-effort summary. OSV advisories may omit summary in favor of
a multi-paragraph details body; we take the first non-empty of
the two.
Trait Implementations§
Source§impl Clone for OsvImportRecord
impl Clone for OsvImportRecord
Source§fn clone(&self) -> OsvImportRecord
fn clone(&self) -> OsvImportRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OsvImportRecord
impl Debug for OsvImportRecord
Source§impl<'de> Deserialize<'de> for OsvImportRecord
impl<'de> Deserialize<'de> for OsvImportRecord
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OsvImportRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OsvImportRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for OsvImportRecord
impl Serialize for OsvImportRecord
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for OsvImportRecord
impl RefUnwindSafe for OsvImportRecord
impl Send for OsvImportRecord
impl Sync for OsvImportRecord
impl Unpin for OsvImportRecord
impl UnsafeUnpin for OsvImportRecord
impl UnwindSafe for OsvImportRecord
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more