Hello,
I’m self-hosting Medplum and I’ve configured file storage like so:
"binaryStorage": "file:/var/lib/medplum/binary/",
"storageBaseUrl": "https://api.
**.ai/storage/"
With this configuration the files are accessible and download correctly, however the resulting URLs appear to be publicly reachable: anyone who knows the URL can download the file.
I have two questions:
Is there a supported way to restrict access so that only authenticated/logged-in users can download files?
If yes, can access policies (roles/permissions) be applied to those file URLs (for example, only users with a given role or the resource owner)?
For clarity, my desired behavior is: /storage/
endpoints should require authentication (or use short-lived signed URLs) rather than being permanently public.
Thank you.
@rahul1 ,
@finnbergquist