Skip to content

Backend: Add export manifest persistence and signed download verification endpoint #864

Description

@Junirezz

Context

exportManifest.ts records checksum metadata for generated export artifacts. Manifests are stored in a module-level array with no persistence.

Problem / Gap

Export provenance cannot be verified after restart. Compliance and governance workflows lack a durable audit trail tying a download to requester, filters, and row counts.

Proposed approach

  • Persist export manifests in Prisma with SHA-256 checksum, requester, report type, and filters.
  • Add a read-only admin endpoint to verify a manifest by ID and checksum.
  • Integrate manifest creation into bulk export and governance export flows.
  • Apply retention policy consistent with other admin audit data.

Acceptance criteria

  • Every completed export creates a persisted manifest retrievable by ID.
  • Checksum verification endpoint returns match/mismatch without exposing raw export rows.
  • Manifests survive restart and are listed with pagination for admins.
  • Tests cover manifest creation, verification, and retention pruning.

Files/areas affected

  • backend/src/exportManifest.ts
  • backend/src/bulkExportJobs.ts
  • backend/src/listEndpoints.ts
  • backend/prisma/schema.prisma

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions