event_store_client 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b27db234d64f8cbe377e6eb65b5b194c7b42178bf4201323baae5ac6a7e99f57
4
- data.tar.gz: b4df0eaec15c72dbaeccd1fa64485a23df385f889e5d448e1cd24be96913ed65
3
+ metadata.gz: '049769fdedefd4418bf5416d98b7fc594402bc58d252322f0d4719991b606959'
4
+ data.tar.gz: 95e079d13ebc780e7f4aa0bbfc3552afaff18a757ef0e0c7f209e83f5d8b98da
5
5
  SHA512:
6
- metadata.gz: 5c0f0760c3c0ce01b39dc8c9501b8112c38f911ab4415bd64fda77cda17d0e5684d4f8d362d3f1728939a6ad85b88bba3a71a2161d3399999ea425a781893564
7
- data.tar.gz: 7a5d1d6983f90d6ad38c4b57323f4290934f38e687b1302e712b9a0723b26d873ce49128d3341a6334ac62abe0c8896608943012b679d4788bac778bcdc35742
6
+ metadata.gz: '038d09d78ca867bcc280035aea884556346e114d89776e5e98866cbb432b1de835bae795489a5041f53f1dd4dd9c3b380432fc9b630f40897169253ff4ff8ddb'
7
+ data.tar.gz: 0d95de8176178c7f7e2826db65a04ff9778fd63c30b7e620b1abcfd026a99d0c561af6526b4e91f66e6be3d1247a98078eb2295bd7b79d55d8d13814fc0c95b9
@@ -5,7 +5,7 @@ module EventStoreClient
5
5
  KeyNotFoundError = Class.new(StandardError)
6
6
 
7
7
  def call
8
- return encrypted_data if encryption_metadata.empty?
8
+ return decrypted_data if encryption_metadata.empty?
9
9
 
10
10
  decrypt_attributes(
11
11
  key: find_key(encryption_metadata[:key]),
@@ -23,7 +23,7 @@ module EventStoreClient
23
23
  def initialize(data:, schema:, repository:)
24
24
  @decrypted_data = deep_dup(data).transform_keys!(&:to_sym)
25
25
  @key_repository = repository
26
- @encryption_metadata = schema.transform_keys(&:to_sym)
26
+ @encryption_metadata = schema&.transform_keys(&:to_sym) || {}
27
27
  end
28
28
 
29
29
  def decrypt_attributes(key:, data:, attributes:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '0.1.16'
4
+ VERSION = '0.1.17'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_store_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-07 00:00:00.000000000 Z
11
+ date: 2020-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-schema