shrinerb / shrine

File Attachment toolkit for Ruby applications
https://shrinerb.com
MIT License
3.18k stars 275 forks source link

Expose copy_options #663

Closed hkdahal closed 6 months ago

hkdahal commented 11 months ago

Currently S3-compatible Cloudflare R2 does not support tagging_directive (https://developers.cloudflare.com/r2/api/s3/api/). This means, we cannot use shrine with tagging_directive. Thus, this Pull Request aims to expose copy_options.

By default, copy_options will have existing value: { tagging_directive: "REPLACE" }

For users like me, we can instantiate S3 store like below until Cloudflare is fully compatible (or just pass additional copy options):

Shrine::Storage::S3.new(bucket: BUCKET, copy_options: {}, **s3_options),

This will also solve: https://github.com/shrinerb/shrine/issues/662

dylandamsma commented 10 months ago

Can we get this merged into main?

hkdahal commented 10 months ago

Awaiting approval from @janko. Can you please review/approve accordingly for this change? thanks

hkdahal commented 9 months ago

@pokonski - can I get your feedback/approval on this Pull Request please? thanks

pokonski commented 9 months ago

@hkdahal sorry I can't give you an approval, I'm not a maintainer of Shrine, just commented a potential improvement :) I too am waiting for this fix 🤞

hkdahal commented 9 months ago

pinging @janko for approval on this PR

thatdom commented 6 months ago

+1

janko commented 6 months ago

Thanks for the PR, looks good to me 👍🏻