Class: RailsMasterKeyKmsDecrypter::KmsEncryptedConfiguration

Inherits:
ActiveSupport::EncryptedConfiguration
  • Object
show all
Defined in:
lib/rails_master_key_kms_decrypter/kms_encrypted_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKmsEncryptedConfiguration

def initialize(config_path:, key_path:, env_key:, raise_if_missing_key:)



8
9
10
11
12
13
# File 'lib/rails_master_key_kms_decrypter/kms_encrypted_configuration.rb', line 8

def initialize(*)
  super

  @encrypted_env_key = "ENCRYPTED_#{env_key}"
  @encrypted_key_path = "#{key_path}.enc"
end

Instance Attribute Details

#encrypted_env_keyObject (readonly)

Returns the value of attribute encrypted_env_key.



5
6
7
# File 'lib/rails_master_key_kms_decrypter/kms_encrypted_configuration.rb', line 5

def encrypted_env_key
  @encrypted_env_key
end

#encrypted_key_pathObject (readonly)

Returns the value of attribute encrypted_key_path.



5
6
7
# File 'lib/rails_master_key_kms_decrypter/kms_encrypted_configuration.rb', line 5

def encrypted_key_path
  @encrypted_key_path
end

Instance Method Details

#keyObject



15
16
17
# File 'lib/rails_master_key_kms_decrypter/kms_encrypted_configuration.rb', line 15

def key
  read_encrypted_env_key || read_encrypted_key_file || super
end