feat(supplier): the portal invites a supplier for one component (#1027)
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 5m16s
CI / Check (pull_request) Successful in 22m0s

Phase 3 of the supplier SBOM epic: the platform API the portal calls with its
service token to invite a supplier, list the tenant's invites and withdraw one.

- An invite is kept in the tenant's own database (`supplier_invites`), so the
  tenant export and erasure cover it, the supplier's address included. The
  portal owns the secret link and the mail and keys its link by the invite id.
- Only a supplier component (a target with `supplier`) can be invited for;
  any other answers 422, an unknown target or tenant 404, and a lookup in an
  unknown tenant creates no database.
- An invite is valid for 90 days and its state is `active`, `expired` or
  `withdrawn`; a second withdrawal keeps the first.
- Deleting a target deletes its invites.
- The portal's target list names each supplier component's `supplier`.

The upload through an invite follows in its own PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-11-18 11:35:50 +01:00
1 parent 31b8cb9d37
commit 5ec891fa28
8 files changed
+705

No files matched your search

+20
View File
@@ -129,6 +129,26 @@ form, and it is stored only when you save it as your own statement.
three numbers with the artifact, for the target editor to show.
- **A new version from the supplier:** upload it to the same target. It
replaces the previous one.
- **Inviting the supplier to upload it:** in the portal, you can invite a
supplier by e-mail to upload the SBOM of one supplier component. The link
is valid for 90 days and also takes the component's later versions. You
can withdraw it at any time. The portal holds the link and sends the mail.
Prüfwerk keeps each invite with your workspace's data, including the
supplier's address, so the workspace export and erasure cover it. Deleting
the target deletes its invites. The portal calls the platform API with its
service token:
- `POST /api/v1/platform/tenants/{id}/supplier-invites` with
`{"target_id", "email", "invited_by"}` creates an invite. It answers
`201` with its `id`, and `422` for a target without a supplier.
- `GET /api/v1/platform/tenants/{id}/supplier-invites[?target=<id>]` lists
the invites, newest first. Each one's `state` is `active`, `expired` or
`withdrawn`.
- `POST …/supplier-invites/{invite}/withdraw` with `{"withdrawn_by"}`
withdraws an invite. A second withdrawal keeps the first.
`GET /api/v1/platform/tenants/{id}/targets` names each supplier
component's `supplier`: these are the targets a supplier can be invited
for.
- **The supplier and its advisories:** a target can name its supplier: the
supplier's name, its name for the product, the version in use, and its CSAF
provider (`supplier` in the target API, with `provider-metadata.json` as an