Class: Params::Password

Inherits:
Param
  • Object
show all
Defined in:
lib/kafo/params/password.rb

Overview

A password paramater is stored encrypted in answer file using AES 256 in CBC mode

we use a passphrase that is stored in kafo.yaml for encryption encrypted password is prefixed with $1$ (for historical reasons, no connection to Modular Crypt Format)

Instance Attribute Summary

Attributes inherited from Param

#default, #doc, #module, #name, #value_set

Instance Method Summary collapse

Methods inherited from Param

#initialize, #module_name, #multivalued?, #set_default, #set_value_by_config, #to_s, #valid?

Constructor Details

This class inherits a constructor from Param

Instance Method Details

#valueObject



17
18
19
# File 'lib/kafo/params/password.rb', line 17

def value
  @encrypted
end

#value=(value) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/kafo/params/password.rb', line 8

def value=(value)
  super
  if @value.nil? || @value.empty?
    @value = password_manager.password
  end
  setup_password if @value.is_a?(::String)
  @value
end