feat(sbom): check a supplier SBOM before a target holds it (#1025) #1033

Merged
sharang merged 2 commits from feat/supplier-sbom-check into main 2026-11-17 09:29:56 +00:00
Owner

Part of #1025 (phase 1 of epic #1029). It's the first of three PRs for the approved supplier mockup (https://claude.ai/artifact/KN3xqurmCJd9QXziKQB3Qc).

What

  • POST /api/v1/supplier-sboms/check (multipart file): reads the file the same way an upload of kind supplier_sbom does, and stores nothing.
    • Returns {format, components, statements}, for example CycloneDX 1.5, 212 components and 9 statements.
    • On a refusal it returns {error, code}. The code is one of unknown_format, malformed, empty, too_many_components or too_large, so the dashboard can word the refusal in German or English.
    • The route has its own body limit (20 MiB plus multipart overhead). A JSON route keeps 2 MiB.
  • The upload now keeps those three numbers with the artifact (detected: sbom_format, sbom_components, sbom_statements). It also sets ingested_at for every upload, which nothing set before. The target editor shows "CycloneDX 1.5 · 212 Komponenten · 9 Aussagen · hochgeladen am …".
  • One verdict: upload refusals carry the same code, and check and upload share SupplierSbomSummary::of.
  • The parser reports the declared format and version: the CycloneDX JSON specVersion, the XML namespace version, or the SPDX spdxVersion. It no longer has the unused read/parse wrappers.
  • Docs: docs/guide/sbom.md covers the check.

Tests

  • Unit: the format labels, and code().
  • Integration (--test e2e):
    • the check accepts a good SBOM, refuses a CSV and an empty SBOM with their codes, and accepts a 3 MiB SBOM above the 2 MiB JSON limit;
    • an upload keeps the facts and ingested_at;
    • an upload refusal carries the code.
  • Local runs: cargo test -p compliance-agent all green; clippy --all-targets -D warnings clean.

Next: the supplier advisory status for the editor, then the dashboard.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part of #1025 (phase 1 of epic #1029). It's the first of three PRs for the approved supplier mockup (https://claude.ai/artifact/KN3xqurmCJd9QXziKQB3Qc). ## What - **`POST /api/v1/supplier-sboms/check`** (multipart `file`): reads the file the same way an upload of kind `supplier_sbom` does, and stores nothing. - Returns `{format, components, statements}`, for example `CycloneDX 1.5`, 212 components and 9 statements. - On a refusal it returns `{error, code}`. The code is one of `unknown_format`, `malformed`, `empty`, `too_many_components` or `too_large`, so the dashboard can word the refusal in German or English. - The route has its own body limit (20 MiB plus multipart overhead). A JSON route keeps 2 MiB. - **The upload** now keeps those three numbers with the artifact (`detected`: `sbom_format`, `sbom_components`, `sbom_statements`). It also sets `ingested_at` for every upload, which nothing set before. The target editor shows "CycloneDX 1.5 · 212 Komponenten · 9 Aussagen · hochgeladen am …". - **One verdict:** upload refusals carry the same `code`, and check and upload share `SupplierSbomSummary::of`. - **The parser** reports the declared format and version: the CycloneDX JSON `specVersion`, the XML namespace version, or the SPDX `spdxVersion`. It no longer has the unused `read`/`parse` wrappers. - **Docs:** `docs/guide/sbom.md` covers the check. ## Tests - **Unit:** the format labels, and `code()`. - **Integration (`--test e2e`):** - the check accepts a good SBOM, refuses a CSV and an empty SBOM with their codes, and accepts a 3 MiB SBOM above the 2 MiB JSON limit; - an upload keeps the facts and `ingested_at`; - an upload refusal carries the code. - **Local runs:** `cargo test -p compliance-agent` all green; clippy `--all-targets -D warnings` clean. Next: the supplier advisory status for the editor, then the dashboard. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-17 08:02:56 +00:00
feat(sbom): check a supplier SBOM before a target holds it (#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 5m13s
CI / Check (pull_request) Successful in 21m58s
187b1c35c6
The wizard stages files before the target exists, so it could only show
a refused supplier SBOM after creating the target. POST
/api/v1/supplier-sboms/check reads the file as an upload would, stores
nothing, and returns its format, components and supplier statements, or
the refusal with a code for the dashboard to word in German or English.

An upload keeps the same three numbers with the artifact (as detected
facts) and records when the file arrived (ingested_at), for the target
editor. The check has its own 20 MiB body limit, not the 2 MiB of a JSON
route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-17 08:35:18 +00:00
fix(api): the supplier SBOM check 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 4m56s
CI / Check (pull_request) Successful in 21m23s
9094d721d2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit 0790810afb into main 2026-11-17 09:29:56 +00:00
sharang deleted branch feat/supplier-sbom-check 2026-11-17 09:29:56 +00:00
Sign in to join this conversation.