dtk_crd_parser 0.0.84 → 0.0.85

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: 6f460aa7143a0117c2ae015ec5d1246c55506242eda42544bcfe42a303b84c6c
4
- data.tar.gz: d44eca1d31d30672abe12febe8ce19f7509ac6d13b32ffbe7d31b0e67f07e724
3
+ metadata.gz: 677e549e3c7e076f473d220e501807bae625ad4c4c51695770d8f5ba3fd0b1db
4
+ data.tar.gz: 917abdc1be28d10fb6700d90047de6e3ea0891c883c76fe9c476c7b4c03b9268
5
5
  SHA512:
6
- metadata.gz: cd8369001fcf79be73a44b4cbe52086e2101209b5f850a70865e3c974271e16b7eaf57528dce1d7840df0b3fd39d1549205ddb2819f3234ccd0883969da77a2b
7
- data.tar.gz: fe313478478dbcef7abdd715db985ac89b7f0927d5eae3aa41e50053cf71e5b22c32f6658ee9a906b14c73f02c3946689b8314c311465985afd2443a58d76b92
6
+ metadata.gz: 8cecf296592bc4e16a1d8130281a185a6382ec3334cab234221cf6a62c5e92e863678b88beec3e55dae91726cfcba98d8924251ff636bea0bddc3f617c01eefa
7
+ data.tar.gz: 1c054fc7c996d6d3f670772068461a2b8b76dc1efa153395e721020796b733443e6feb0e78655cfb782697df67fbe418c00c86e2b0f3fa11f52d50a7b5721269
@@ -31,20 +31,18 @@ module DTK::CrdParser
31
31
  return nil unless data_to_decrypt
32
32
  return data_to_decrypt unless encrypted
33
33
  #get secret to get the key and iv
34
-
34
+ secret = secret()
35
35
  decipher = OpenSSL::Cipher::AES256.new :CBC
36
36
  decipher.decrypt
37
- secret = secret()
38
37
  decipher.iv = secret[:iv]
39
38
  decipher.key = secret[:key]
40
39
  plain_text = decipher.update(Base64.decode64(data_to_decrypt)) + decipher.final
41
- Logger.new('/proc/1/fd/1').info "Plaintext: #{plain_text}"
42
40
  plain_text
43
41
  end
44
42
 
45
- def secret(mountPath = '/var/secret')
46
- encrypt_key = File.read("#{mountPath}/encrypt_key")
47
- iv = File.read("#{mountPath}/iv")
43
+ def secret
44
+ encrypt_key = ENV["ENCRYPTION_KEY"]
45
+ iv = ENV["ENCRYPTION_IV"]
48
46
  {
49
47
  key: encrypt_key,
50
48
  iv: iv
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtk_crd_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.84
4
+ version: 0.0.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - DTK