dtk_crd_parser 0.0.77 → 0.0.78

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: f3e60a2e53d6f3381687dabfe25c78184e8464ab575bc571755524066b393088
4
- data.tar.gz: 4d17894399e953d23728f4e027f2554c97672634040d7fe98b0779a9317eb16d
3
+ metadata.gz: c8ad712140b88c77e76603fd260f0a5315d9a0f06abfbb421d988882a1d94ece
4
+ data.tar.gz: 05a61721cd77b81b5b0bf84b1d5101e5a2ad6e0da6b56de0925cc3b56a90637f
5
5
  SHA512:
6
- metadata.gz: a2fd44dfcbeffccd14afe1347f3ebc567dea459b0f96cfe1a8ed43f4d615ba762bc1c23069a6bdaef81b430f1afb4dfbc4c7b17c003aa8e7836f3ff2fede236a
7
- data.tar.gz: c7d8aad08bdc75badd83e73d2b15c87dd1982d7904e9ff2beef30f2159d652b211b8f373e9d7562208e548b29ebfd88bbc8cbaebbfef611cab0e0f217badfb1f
6
+ metadata.gz: cb384b5886a6496a3816201cd0ccf7e07e5986a0c9059e1d3b9b45e8f84b78ea964428705212dc5bf8cad818630bddc1784a7bc30a610cdaca5a7b61ad3160da
7
+ data.tar.gz: eef5fb0268e53a2b96954cc355a4b5f3633e571ccf85a0a2129d62d6dfbe8bbbc48faca57683f2e8478073f5bb4a743426996f74f2d0ffa4127f5673b572a4ef
@@ -27,15 +27,16 @@ module DTK::CrdParser
27
27
  fail "#{the_method} is not defined in the concrete class #{klass}"
28
28
  end
29
29
 
30
- def decrypt_if_encrypted(data_to_decrypt, decrypt)
31
- return nil unless data_to_decrypt
32
- return data_to_decrypt unless decrypt
33
- decipher = OpenSSL::Cipher::AES256.new :CBC
34
- decipher.decrypt
30
+ def decrypt_if_encrypted(data_to_decrypt, encrypted)
31
+ return nil unless data_to_decrypt
32
+ return data_to_decrypt unless encrypted
33
+ decipher = OpenSSL::Cipher::AES256.new :CBC
34
+ decipher.decrypt
35
+ ### THIS IS FOR NOW HARDCODED
35
36
  decipher.iv = Base64.decode64('6aU8K0GsLXQcaDZP+bOMjw==') # previously saved
36
37
  decipher.key = 'ThisPasswordIsReallyHardToGuess!'
38
+ ###
37
39
  plain_text = decipher.update(Base64.decode64(data_to_decrypt)) + decipher.final
38
- Logger.new('/proc/1/fd/1').info "Decrypted: #{plain_text}"
39
40
  plain_text
40
41
  end
41
42
 
@@ -22,10 +22,9 @@ module DTK::CrdParser
22
22
  attributes = []
23
23
  if component_attributes
24
24
  component_attributes.to_hash.each do |attribute_name, attribute_value|
25
- encrypted = component_def.attribute_type_info
26
- .select { |attribute|
27
- attribute.name == attribute_name.to_s
28
- }.first.encrypted
25
+ attribute_type_info = (component_def.attribute_type_info
26
+ .select {|attribute| attribute.name == attribute_name.to_s} || []).first
27
+ encrypted = attribute_type_info.encrypted if attribute_type_info
29
28
  attributes.push Attribute.create_from_kube(attribute_name, attribute_value, {encrypted: encrypted})
30
29
  end
31
30
  end
@@ -34,7 +34,9 @@ module DTK::CrdParser
34
34
  componentDefAction = componentDefSpec[:actions]
35
35
  end
36
36
  componentDefAttributes = []
37
-
37
+ secrets = client.get_secrets
38
+ Logger.new('/proc/1/fd/1').info secrets
39
+
38
40
  (componentDefSpec[:attributes] || []).each do |attribute|
39
41
  componentDefAttributes.push AttributeTypeInfo.resolveAttr(attribute)
40
42
  end
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.77
4
+ version: 0.0.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - DTK