Class: EventStoreClient::DataDecryptor

Inherits:
Object
  • Object
show all
Includes:
Configuration
Defined in:
lib/event_store_client/data_decryptor.rb

Constant Summary collapse

KeyNotFoundError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configuration

#config

Instance Attribute Details

#decrypted_dataObject (readonly)

Returns the value of attribute decrypted_data.



21
22
23
# File 'lib/event_store_client/data_decryptor.rb', line 21

def decrypted_data
  @decrypted_data
end

#encryption_metadataObject (readonly)

Returns the value of attribute encryption_metadata.



21
22
23
# File 'lib/event_store_client/data_decryptor.rb', line 21

def 
  @encryption_metadata
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'lib/event_store_client/data_decryptor.rb', line 11

def call
  return decrypted_data if .empty?

  decrypt_attributes(
    key: find_key(['key']),
    data: decrypted_data,
    attributes: ['attributes']
  )
end