With :expose-http? true the module mounts upload, download, delete and URL
routes under /api/v1/storage. A file is reached by its tenant’s members, or,
outside a tenant, by its uploader. An app with a narrower rule passes its own
check, a function or a qualified symbol naming one:
:wagoe/storage {:provider :local :root "uploads" :expose-http? true
:may-access? myapp.files/may-access?} ; (fn [request file-key]) => truthy
What an upload may be comes from configuration; the request’s max-size,
allowed-types and allowed-extensions can only narrow it:
:wagoe/storage {:provider :local :root "uploads" :expose-http? true
:upload-limits {:max-size 5242880 :allowed-types ["application/pdf"]}}
Without :upload-limits, any type up to 10 MB is accepted. A file’s type is
its name’s extension, whatever the client declared: it is checked, stored and
served as that type, and an unknown extension is application/octet-stream. The image route
accepts only image types within them, and so does its thumbnail: a PNG,
never larger than the image, stored only when the limits allow PNG. An image
over 50 megapixels, or over 200 MB decoded, gets no thumbnail: the image
processor refuses it before decoding.
A key it refuses is a 404 on download, delete and URL, and an upload may not
replace it; a new key is not checked. It runs for platform admins too. A signed download link is checked
when the URL is issued, not when it is used.