Accelerate uploads via API with Workhorse [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Stan Hu requested to merge sh-workhorse-api-upload-acceleration into master

Previously uploads via the API would go straight to Rack, which would then try to buffer and store temporary files on local disk. This enables Workhorse to accelerate API uploads and limits to the configured maximum attachment size (10 MB by default).

Workhorse needs the API endpoint /api/v4/projects/:id/uploads/authorize endpoint to support acceleration.

This adds the enforce_max_attachment_size_upload_api feature flag to enable enforcement of max attachment size in the upload API. If the feature is not enabled, we limit to 1 GB by default. GITLAB_UPLOAD_API_ALLOWLIST can be set in the environment to allow certain project IDs to bypass enforcement.

Relates to

Edited by Stan Hu