new-site/api/src/middleware
justin bce5db4a09 admin: view order PDFs from MinIO (signed forms, prepared filings, evidence)
Adds a Documents section to the compliance-order detail drawer so you can
review the actual filing PDFs before approving an order:
  GET /api/v1/admin/compliance-orders/:id/documents  list viewable objects
  GET /api/v1/admin/compliance-orders/:id/document?key=&token=  stream one

Key discovery pulls from esign_records (unsigned + signed docs per order),
intake_data.filing_status (pdf_minio_path, attested_pdf, evidence/*), and the
order's engagement_letter / rmd_packet columns.

Rather than hand out presigned URLs (MinIO's public host is IP-allowlisted to a
few office IPs, so links break elsewhere), the API streams the object through
itself from internal minio:9000, gated by the admin JWT. The stream endpoint
accepts the token via ?token= (new middleware requireAdminQueryOrHeader) so a
PDF opens in a new tab, and refuses any key that isn't one of the order's own
documents.
2026-06-16 00:20:15 -05:00
..
access-log.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
admin-auth.ts admin: view order PDFs from MinIO (signed forms, prepared filings, evidence) 2026-06-16 00:20:15 -05:00
cors.ts Add PUT to CORS allowed methods (needed for intake save) 2026-04-28 18:29:00 -05:00
customer-auth.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
error-handler.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
internal-auth.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
portalAuth.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
rate-limit.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
security.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00