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;Erron network/parse failure.
Details:
- Uses the public JSON advisory feed.
- Normalizes severity strings and packages; skips entries without an ID.
- If
cutoff_dateis provided, stops fetching when items exceed the date limit.
ยงErrors
- Network fetch failures
- JSON parsing failures