Sha256: 0d88a59cc7941991da272537c62e8adcc0597103d95b517d1832926a7faf1362

Contents?: true

Size: 860 Bytes

Versions: 10

Compression:

Stored size: 860 Bytes

Contents

module SymmetricEncryption
  module Keystore
    # Heroku uses environment variables too.
    class Heroku < Environment
      # Returns [Hash] a new keystore configuration after generating the data key.
      def self.generate_data_key(**args)
        config            = super(**args)
        config[:keystore] = :heroku
        config
      end

      # Write the encrypted Encryption key to `encrypted_key` attribute.
      def write(key)
        encrypted_key = key_encrypting_key.encrypt(key)
        puts "\n\n********************************************************************************"
        puts "Add the environment key to Heroku:\n\n"
        puts "  heroku config:add #{key_env_var}=#{encoder.encode(encrypted_key)}"
        puts '********************************************************************************'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
symmetric-encryption-4.3.1 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.3.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.2.1 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.2.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.4 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.3 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.2 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.1 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.1.0.beta1 lib/symmetric_encryption/keystore/heroku.rb