Module: Shrine::Storage::S3::ClientSideEncryption

Included in:
Shrine::Storage::S3
Defined in:
lib/shrine/storage/s3.rb

Overview

Adds support for Aws::S3::Encryption::Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encryption_clientObject (readonly)

Returns the value of attribute encryption_client.


341
342
343
# File 'lib/shrine/storage/s3.rb', line 341

def encryption_client
  @encryption_client
end

Instance Method Details

#initialize(client: nil, **options) ⇒ Object

Save the encryption client and continue initialization with normal client.


345
346
347
348
349
350
# File 'lib/shrine/storage/s3.rb', line 345

def initialize(client: nil, **options)
  return super unless client.class.name.start_with?("Aws::S3::Encryption")

  super(client: client.client, **options)
  @encryption_client = client
end