Class: HatiConfig::Encryption::KeyProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/hati_config/encryption.rb

Overview

KeyProvider class hierarchy for handling encryption keys.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(type, options = {}) ⇒ Object



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/hati_config/encryption.rb', line 169

def self.create(type, options = {})
  case type
  when :env
    EnvKeyProvider.new(options)
  when :file
    FileKeyProvider.new(options)
  when :aws_kms
    AwsKmsKeyProvider.new(options)
  else
    raise EncryptionError, "Unknown key provider: #{type}"
  end
end

Instance Method Details

#key ⇒ Object

Raises:

  • (NotImplementedError)


182
183
184
# File 'lib/hati_config/encryption.rb', line 182

def key
  raise NotImplementedError, 'Subclasses must implement #key'
end