Class: Paramsync::CLI::EncryptCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/paramsync/cli/encrypt_command.rb

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/paramsync/cli/encrypt_command.rb', line 7

def run(args)
  Paramsync::CLI.configure
  STDOUT.sync = true

  ciphertext = Paramsync.config.kms_client.encrypt(
      key_id: Paramsync.config.kms_key,
      plaintext: args[1]
    ).ciphertext_blob

  hash = { args[0] => ciphertext }
  puts YAML.dump(hash).gsub("---\n", '')
end