Module: SecureYaml

Defined in:
lib/secure_yaml.rb,
lib/secure_yaml/cipher.rb,
lib/secure_yaml/loader.rb,
lib/secure_yaml/version.rb,
lib/secure_yaml/yaml_decrypter.rb,
lib/secure_yaml/cli/property_encryption_application.rb

Defined Under Namespace

Classes: Cipher, Loader, PropertyEncryptionApplication, YamlDecrypter

Constant Summary collapse

ENCRYPTED_PROPERTY_WRAPPER_ID =
'ENC'
DEFAULT_SECRET_KEY_PROP_NAME =
'PROPERTIES_ENCRYPTION_PASSWORD'
VERSION =
"2.0.2"

Class Method Summary collapse

Class Method Details

.load(yaml_file, opts = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/secure_yaml.rb', line 10

def self.load(yaml_file, opts = {})
  opts[:secret_key_property_name] ||= DEFAULT_SECRET_KEY_PROP_NAME
  opts[:decryption_algorithm] ||= Cipher.new

  yaml_loader(opts[:decryption_algorithm], retrieve_secret_key(opts[:secret_key_property_name])).load(yaml_file)
end

.parse(yaml, opts = {}) ⇒ Object



17
18
19
# File 'lib/secure_yaml.rb', line 17

def self.parse(yaml, opts = {})
  load(StringIO.new(yaml), opts)
end