Class: EventStoreClient::DataDecryptor

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

Constant Summary collapse

KeyNotFoundError =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/event_store_client/data_decryptor.rb', line 7

def call
  return encrypted_data if .empty?
  result = find_key(['key'])
  return encrypted_data unless result.success?

  decrypt_attributes(
    key: result.value!,
    data: encrypted_data,
    attributes: ['attributes']
  )
end