feat(csaf): count a target's supplier advisories, with the provider's last read (#1025) #1034

Merged
sharang merged 2 commits from feat/supplier-advisory-status into main 2026-11-17 09:51:46 +00:00
Owner

Part of #1025. Stacked on #1033: the base is feat/supplier-sbom-check, and I'll rebase this onto main once #1033 is merged.

This is the second of three PRs for the approved supplier mockup (https://claude.ai/artifact/KN3xqurmCJd9QXziKQB3Qc). It backs the editor's "14 Hinweise gelesen · zuletzt heute, 03:31".

What

  • A status per provider: each supplier CSAF refresh now writes one per provider (supplier_csaf_providers in the tenant DB: checked_at, reachable). The newest fetched_at of the advisories only says when an advisory last changed. On its own, a provider that cannot be read would look like a provider with no advisories.
  • Counts.unreachable: set when the provider's metadata or feeds cannot be read at all.
  • GET /api/v1/targets/{id}/supplier-advisories: returns {advisories, checked_at, reachable}, or data: null for a target without a supplier CSAF provider.
    • checked_at and reachable are null until the first refresh.
    • The dashboard shows that as "noch nicht gelesen", and an unreachable provider as such. Neither state is drawn in the mockup.
  • Docs: docs/guide/sbom.md.

Tests

  • Integration:
    • a target without a provider returns null;
    • setting a provider returns a count of 0;
    • with a seeded advisory and status, it returns 1, reachable: false and checked_at.
  • Local runs: cargo test -p compliance-agent --lib is green, the OpenAPI gates pass, and clippy --all-targets -D warnings is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part of #1025. Stacked on #1033: the base is `feat/supplier-sbom-check`, and I'll rebase this onto main once #1033 is merged. This is the second of three PRs for the approved supplier mockup (https://claude.ai/artifact/KN3xqurmCJd9QXziKQB3Qc). It backs the editor's "14 Hinweise gelesen · zuletzt heute, 03:31". ## What - **A status per provider:** each supplier CSAF refresh now writes one per provider (`supplier_csaf_providers` in the tenant DB: `checked_at`, `reachable`). The newest `fetched_at` of the advisories only says when an advisory last changed. On its own, a provider that cannot be read would look like a provider with no advisories. - **`Counts.unreachable`:** set when the provider's metadata or feeds cannot be read at all. - **`GET /api/v1/targets/{id}/supplier-advisories`:** returns `{advisories, checked_at, reachable}`, or `data: null` for a target without a supplier CSAF provider. - `checked_at` and `reachable` are null until the first refresh. - The dashboard shows that as "noch nicht gelesen", and an unreachable provider as such. Neither state is drawn in the mockup. - **Docs:** `docs/guide/sbom.md`. ## Tests - **Integration:** - a target without a provider returns null; - setting a provider returns a count of 0; - with a seeded advisory and status, it returns 1, `reachable: false` and `checked_at`. - **Local runs:** `cargo test -p compliance-agent --lib` is green, the OpenAPI gates pass, and clippy `--all-targets -D warnings` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang changed target branch from feat/supplier-sbom-check to main 2026-11-17 09:29:56 +00:00
sharang added 2 commits 2026-11-17 09:30:04 +00:00
The target editor shows how many of the supplier's CSAF advisories are
kept and when its provider was last read. The newest fetched_at only
says when an advisory last changed, and a provider that cannot be read
would look like one without advisories, so each refresh now keeps a
status per provider (supplier_csaf_providers: checked_at, reachable).

GET /api/v1/targets/{id}/supplier-advisories returns the count and that
status, or null for a target without a supplier CSAF provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
fix(api): the supplier advisories route describes its enveloped answer (#1025)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m19s
CI / Check (pull_request) Successful in 21m17s
b1aa992f1c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang force-pushed feat/supplier-advisory-status from 067113f7ec to b1aa992f1c 2026-11-17 09:30:05 +00:00 Compare
sharang merged commit 684d3514ab into main 2026-11-17 09:51:46 +00:00
sharang deleted branch feat/supplier-advisory-status 2026-11-17 09:51:46 +00:00
Sign in to join this conversation.