Skip to content

feat: add evidence service CRUD endpoints - #17

Merged
danishkumar26 merged 1 commit into
mainfrom
feat/evidence-service
Nov 25, 2026
Merged

danishkumar26 merged 1 commit into
mainfrom
feat/evidence-service

Conversation

@danishkumar26

Copy link
Copy Markdown
Owner

Summary

Adds the Phase 3 evidence service: job-scoped evidence records with SHA-256 integrity.

  • POST /api/v1/evidence/ — create evidence (job_id, sha256, storage_uri, size_bytes)
  • GET /api/v1/evidence/ — list evidence, org-scoped through job → assessment → project
  • GET /api/v1/evidence/{id} — get a single evidence record
  • EvidenceCreate/EvidenceOut schemas; sha256 validated as a 64-char hex digest
  • Router registered in backend/app/main.py (prefix /api/v1/evidence)

Evidence is tenant-scoped to the evidence's job's assessment's organization, matching the findings CRUD pattern. The evidence table/model already existed (migration 0001); this adds the API layer.

Test Plan

  • 6 new tests in backend/tests/test_evidence.py: create/list/get, cross-org 403, nonexistent job 404, tenant-scoped listing, invalid sha256 rejected (422)
  • ruff check, ruff format --check, mypy backend/app clean
  • 50/50 pytest pass (44 existing + 6 new)

Closes Phase 3 evidence-service follow-up (next task #2 in PROJECT_STATUS.md).

Adds POST /api/v1/evidence/ (create), GET /api/v1/evidence/ (list, org-scoped), GET /api/v1/evidence/{id} (get).

Evidence is job-scoped and tenant-scoped to the job's assessment's organization.

EvidenceCreate validates sha256 as a 64-character hex digest (trust-boundary validation).

Mirrors the findings CRUD pattern; adds EvidenceCreate/EvidenceOut schemas and registers the router in main.py.

Adds 6 tests; ruff, ruff format, mypy clean; 50/50 tests pass.
@danishkumar26
danishkumar26 merged commit 98e7739 into main Nov 25, 2026
4 checks passed
@danishkumar26
danishkumar26 deleted the feat/evidence-service branch November 25, 2026 21:10
danishkumar26 added a commit that referenced this pull request Nov 25, 2026
…report

Update PROJECT_STATUS.md and ROADMAP.md (evidence service Supported), add reports/daily/2026-11-25.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant