# File lib/hiera/backend/eyaml/encryptor.rb, line 28 def self.decode string Base64.decode64(string) end
# File lib/hiera/backend/eyaml/encryptor.rb, line 36 def self.decrypt *args raise StandardError, "decrypt() not defined for decryptor plugin: #{self}" end
# File lib/hiera/backend/eyaml/encryptor.rb, line 24 def self.encode binary_string Base64.encode64(binary_string).strip end
# File lib/hiera/backend/eyaml/encryptor.rb, line 32 def self.encrypt *args raise StandardError, "encrypt() not defined for encryptor plugin: #{self}" end
# File lib/hiera/backend/eyaml/encryptor.rb, line 15 def self.find encryption_scheme = nil encryption_scheme = Eyaml.default_encryption_scheme if encryption_scheme.nil? require "hiera/backend/eyaml/encryptors/#{File.basename encryption_scheme.downcase}" encryptor_module = Module.const_get('Hiera').const_get('Backend').const_get('Eyaml').const_get('Encryptors') encryptor_class = Utils.find_closest_class :parent_class => encryptor_module, :class_name => encryption_scheme raise StandardError, "Could not find hiera-eyaml encryptor: #{encryption_scheme}. Try gem install hiera-eyaml-#{encryption_scheme.downcase} ?" if encryptor_class.nil? encryptor_class end
# File lib/hiera/backend/eyaml/encryptor.rb, line 66 def self.debug msg Utils::debug :from => plugin_classname, :msg => msg end
# File lib/hiera/backend/eyaml/encryptor.rb, line 58 def self.format_message msg "[eyaml_#{plugin_classname}]: #{msg}" end
# File lib/hiera/backend/eyaml/encryptor.rb, line 54 def self.hiera? Utils::hiera? end
# File lib/hiera/backend/eyaml/encryptor.rb, line 70 def self.info msg Utils::info :from => plugin_classname, :msg => msg end
# File lib/hiera/backend/eyaml/encryptor.rb, line 50 def self.option name Eyaml::Options[ "#{plugin_classname}_#{name}" ] || self.options[ "#{plugin_classname}_#{name}" ] end
# File lib/hiera/backend/eyaml/encryptor.rb, line 42 def self.plugin_classname self.to_s.split("::").last.downcase end
# File lib/hiera/backend/eyaml/encryptor.rb, line 46 def self.register Hiera::Backend::Eyaml::Plugins.register_options :options => self.options, :plugin => plugin_classname end
# File lib/hiera/backend/eyaml/encryptor.rb, line 62 def self.trace msg Utils::trace :from => plugin_classname, :msg => msg end
# File lib/hiera/backend/eyaml/encryptor.rb, line 74 def self.warn msg Utils::warn :from => plugin_classname, :msg => msg end