kreeti / kt-paperclip

Easy file attachment management for ActiveRecord
Other
275 stars 95 forks source link

fog-google: Cannot insert legacy ACL #121

Open cwjenkins opened 1 year ago

cwjenkins commented 1 year ago

Describe the bug Paperclip fog implementation sets fog_public to true if fog_public isn't specified (default value). This causes fog-google to throw an exception when the corresponding bucket is using uniform access controls given predefined_acls (fine grain access control) is set (predefinedAcl=publicRead). If fog_public were set to false then it also causes the same issue given predefinedAcl is set to private in fog-google.

Workaround: setting fog_public to a lambda that returns nil (seems hacky).

To Reproduce

  1. Create a GCS account.
  2. Create a bucket with uniform access control.
  3. Do not config fog_public
  4. Try saving an attachment.

Expected behavior Not specifying fog_public leaves public nil.

Additional context Issue on their end. A PR providing a way to skip predefinedAcl if another gem sets it.