Secure access to private assets via Cloudflare R2
Hi everyone,
I have started hosting my website's assets on Cloudflare R2. Everything is working well with a public bucket, and I have set up an address like cdn.mydomain.com.
But I also have private assets (images & videos) that should only be accessible to specific users of my app. I am looking for a solution to check directly from Cloudflare if a user is authorized to access the private assets. I understand that I need to use a Cloudflare worker, but I am unsure about which solution to use (cookie, token?)
I'm also thinking, if the user is authorized to access the private assets, load a page with let's say 10 assets, in that case the worker will receive 10 requests and check for each of them if the user is authorized? Is it the right way to do it?
Thanks!
Please or to participate in this conversation.