Class: Bolt::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/secret.rb,
lib/bolt/secret/base.rb

Defined Under Namespace

Classes: Base

Class Method Summary collapse

Class Method Details

.execute(plugins, outputter, options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bolt/secret.rb', line 5

def self.execute(plugins, outputter, options)
  plugin = options[:plugin] || 'pkcs7'
  case options[:action]
  when 'createkeys'
    plugins.get_hook(plugin, :secret_createkeys).call
  when 'encrypt'
    encrypted = plugins.get_hook(plugin, :secret_encrypt).call('plaintext_value' => options[:object])
    outputter.print_message(encrypted)
  when 'decrypt'
    decrypted = plugins.get_hook(plugin, :secret_decrypt).call('encrypted_value' => options[:object])
    outputter.print_message(decrypted)
  end

  0
end