Module: Brightbox::Config::GpgEncryptedPasswords

Included in:
BBConfig
Defined in:
lib/brightbox-cli/config/gpg_encrypted_passwords.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gpg_passwordObject

Return the password from gpg if it's possible



12
13
14
15
16
17
18
19
20
# File 'lib/brightbox-cli/config/gpg_encrypted_passwords.rb', line 12

def gpg_password
  if defined?(@gpg_password) && !@gpg_password.nil?
    return @gpg_password
  end

  @gpg_password = if File.exist?(gpg_encrypted_password_filename)
                    gpg_decrypt_password
                  end
end

Instance Method Details

#gpg_encrypted_password_filenameObject



6
7
8
9
# File 'lib/brightbox-cli/config/gpg_encrypted_passwords.rb', line 6

def gpg_encrypted_password_filename
  file_name = "#{client_name}.password.gpg"
  @gpg_encrypted_password_filename ||= File.join(config_directory, file_name)
end