fetch_security_advisories

Function fetch_security_advisories 

Source
pub async fn fetch_security_advisories(
    limit: usize,
    cutoff_date: Option<&str>,
) -> Result<Vec<NewsFeedItem>, Box<dyn Error + Send + Sync>>
Expand description

What: Fetch security advisories from security.archlinux.org and convert to feed items.

Inputs:

  • limit: Maximum number of advisories to return (best-effort).
  • cutoff_date: Optional date string (YYYY-MM-DD) for early filtering.

Output:

  • Ok(Vec<NewsFeedItem>) on success; Err on network/parse failure.

Details:

  • Uses the public JSON advisory feed.
  • Normalizes severity strings and packages; skips entries without an ID.
  • If cutoff_date is provided, stops fetching when items exceed the date limit.

ยงErrors

  • Network fetch failures
  • JSON parsing failures