lib/bolt/secret.rb in bolt-1.26.0 vs lib/bolt/secret.rb in bolt-1.27.0
- old
+ new
@@ -1,17 +1,18 @@
# frozen_string_literal: true
module Bolt
class Secret
def self.execute(plugins, outputter, options)
- enc = plugins.by_name('pkcs7')
case options[:action]
when 'createkeys'
- enc.secret_createkeys
+ plugins.get_hook('pkcs7', :secret_createkeys).call
when 'encrypt'
- outputter.print_message(enc.secret_encrypt('plaintext-value' => options[:object]))
+ encrypted = plugins.get_hook('pkcs7', :secret_encrypt).call('plaintext-value' => options[:object])
+ outputter.print_message(encrypted)
when 'decrypt'
- outputter.print_message(enc.secret_decrypt('encrypted-value' => options[:object]))
+ decrypted = plugins.get_hook('pkcs7', :secret_decrypt).call('encrypted-value' => options[:object])
+ outputter.print_message(decrypted)
end
0
end
end