feat(api): onboarding endpoints for unified targets #142

Merged
sharang merged 1 commits from feat/onboarding-api into main 2026-07-12 20:15:22 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Fable 5 c8255bf024 feat(api): onboarding endpoints for unified targets (#131)
CI / Check (pull_request) Successful in 6m14s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
REST surface the wizard drives onboarding through:
- GET/POST /api/v1/targets (list paginated / create)
- GET/PATCH/DELETE /api/v1/targets/{id} (fetch / update / delete + cascade
  findings/scans by repo_id)
- POST /api/v1/targets/{id}/artifacts (attach an artifact by reference)
- GET /api/v1/targets/{id}/applicable-scans (scan matrix + pentest support)
- POST /api/v1/targets/{id}/detect (kind-based classification — no ingest;
  deep post-ingest detection is a follow-up)

Follows the existing axum handler/route/DTO conventions (ApiResponse,
PaginationParams, tenant_db, collect_cursor_async, TenantCtx). Multipart artifact
upload and the scan-trigger endpoint (needs the unified pipeline, #133) are
follow-ups.

Also fixes the TestServer db-name prefix (was 37 chars, over the pool's 30-char
cap) which had silently broken every API integration test locally.

3 HTTP integration tests (create/list/applicable-scans, detect->PLC,
add-artifact/delete) — pass against local Mongo.

Closes #131.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 20:06:31 +02:00