POC: single authorization endpoint

Problem

It has been pointed out that one of the maintenance and implementation challenges with direct upload is that each upload must provides its own /authorize endpoint to pre-authorize the upload and provide WH with the OS location and settings. This should probably be a REST API call, so that we do not end up with a mixture of Rails controller and Grape endpoints for upload authorization.

Proposal

Write a Proof Of Concept (POC) showcasing how moving to a single, shared authorization endpoint could look like and how that would improve on the status quo, if it does.

One idea was to pass the upload endpoint URL to the authorize call, and extract the bucket from it, since WH does not know anything about which bucket is targeted, and we'd have to handle all possible buckets in a single call.

Benefits

  • Less repetition when implementing uploads
  • Single point of responsibility for upload auth
  • Easier to reason about and maintain
  • Easier migration to a single-bucket approach to Object Storage, at which point we would want to have this anyway

Drawbacks

  • While there are many features and buckets to deal with, all complexity is concentrated in one place, which could make this unwieldy
Edited by Matthias Käppler