Engineering
Shared file uploads and antivirus scanning
How a central upload service used signed S3 uploads and read the result of a Lambda antivirus scan.
One upload service for several workflows
SalesCandy’s sc-files service gave callers a common way to store images, audio, video, and PDFs. An authorised caller requested a pre-signed POST and an upload token, sent the file directly to S3, then registered the upload with that token. The service checked the pending upload against the tenant and user. A signed GET let an authorised client download a registered file. This kept file transfer out of the application’s GraphQL request while giving products a shared registration flow.
The Manager Portal used the same flow in account details and project screens. Both the admin and customer GraphQL repositories defined upload operations backed by the file service. The file service also had a media retrieval path for Twilio Conversations.
Git evidence. sc-files d483f84 (README.md, handler.js), manager-portal f1324139a (account details and project components), sc-admin-appsync 1991980, and customer-api-appsync 57b2fa3.
S3 and Lambda shared the scan result through an object tag
The archived bucket-antivirus utility describes an S3 object-created event invoking Lambda, which scans the object with ClamAV and writes the verdict back to S3. The source defines the default tag as av-status. The companion repository contains a packaged Lambda build. The source history records a Dockerfile fix for a missing library needed by the ClamAV definition updater.
In sc-files, the Twilio media retrieval path reads that same tag before fetching the file body. It proceeds on CLEAN, rejects INFECTED, and stops waiting if the verdict fails to arrive within the polling window. The object tag lets the upload and scanning paths run independently while giving the messaging flow a concrete signal for when a file can be shared.
Git evidence. bucket-antivirus-function-src 11d8f51 (README.md, common.py) and c09a62d (Dockerfile), bucket-antivirus-function (archived lambda.zip), and sc-files d483f84 (fetchMediaFromS3, checkFileIsReady). The code demonstrates the scan gate on the media retrieval path. Historical bucket deployment settings and scan enforcement on other read paths remain unverified.