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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ad712140b88c77e76603fd260f0a5315d9a0f06abfbb421d988882a1d94ece
|
4
|
+
data.tar.gz: 05a61721cd77b81b5b0bf84b1d5101e5a2ad6e0da6b56de0925cc3b56a90637f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
31
|
-
return nil
|
32
|
-
return data_to_decrypt unless
|
33
|
-
decipher
|
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
|
|
data/lib/crd_parser/component.rb
CHANGED
@@ -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
|
-
|
26
|
-
.select {
|
27
|
-
|
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
|