22 lines
711 B
Markdown
22 lines
711 B
Markdown
# 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.
|
|
|
|
```typescript
|
|
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.
|