class Hiera::Backend::Eyaml::Encryptor
Attributes
Public Class Methods
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 65 def self.debug(msg) LoggingHelper.debug from: plugin_classname, msg: msg end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 29 def self.decode(string) Base64.decode64(string) end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 37 def self.decrypt *_args raise StandardError, "decrypt() not defined for decryptor plugin: #{self}" end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 25 def self.encode(binary_string) Base64.strict_encode64(binary_string) end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 33 def self.encrypt *_args raise StandardError, "encrypt() not defined for encryptor plugin: #{self}" end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 12 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 if encryptor_class.nil? raise StandardError, "Could not find hiera-eyaml encryptor: #{encryption_scheme}. Try gem install hiera-eyaml-#{encryption_scheme.downcase} ?" end encryptor_class end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 57 def self.format_message(msg) "[eyaml_#{plugin_classname}]: #{msg}" end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 53 def self.hiera? Utils.hiera? end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 69 def self.info(msg) LoggingHelper.info from: plugin_classname, msg: msg end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 49 def self.option(name) Eyaml::Options["#{plugin_classname}_#{name}"] || options["#{plugin_classname}_#{name}"] end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 41 def self.plugin_classname to_s.split('::').last.downcase end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 45 def self.register Hiera::Backend::Eyaml::Plugins.register_options options: options, plugin: plugin_classname end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 61 def self.trace(msg) LoggingHelper.trace from: plugin_classname, msg: msg end
Source
# File lib/hiera/backend/eyaml/encryptor.rb, line 73 def self.warn(msg) LoggingHelper.warn from: plugin_classname, msg: msg end