fix-missing-fileid
🐛 Bug Fixes
Require fileId on legacy document create unless the agent is iptower
Goal: Legacy POST /documents must not create a deposit without a linked upload, except for Tower. Clients that already send fileId or idUpload without Bcyip-Agent must keep working.
Solution: Return 400 when the file reference is missing and the header is absent, ipmagicbox, or any agent other than iptower (case-insensitive). When a reference is present, require a RemoteFile that belongs to the job, matches the hash, and is not already linked.
Features:
Bcyip-Agent: iptower→ file reference optional- No header or any other agent →
fileId/idUploadrequired - Provided reference is checked before the document is kept
Files Modified:
app/util/documentIngest.js- fileId requirement, header not requiredapp/routes/documents.js- Validate before createapp/services/documents.js- RemoteFile ownership, hash, and link checks