Files
defi-arbitrage/docs/solacenet/FILE_DROP_GATEWAY_INGRESS.example.md
T

711 B

File-drop ingress — SolaceNet gateway enforcement (example)

Gap: PG-GW-W03 — file workers are app-specific; this pattern shows how to call the shared guard.

import { requireGatewayMicroservicesForWorker } from '@/core/gateway/rails/gateway-rails-enforcement';
import fs from 'fs/promises';

async function processInboundFile(path: string, tenantId: string, adapterId: string) {
  await requireGatewayMicroservicesForWorker({
    tenantId,
    ingressKind: 'file-drop',
    detail: path,
    adapterId,
  });
  const raw = await fs.readFile(path, 'utf8');
  // ... validate / ingest ...
}

Set SOLACENET_GATEWAY_RAILS_ENFORCE=1 in the worker environment when policy should apply.