Sha256: 7ad7f7191cf8b81c07fcd1b4e892111c8bc0684ccb2a735aac8b644aed06a9ab

Contents?: true

Size: 860 Bytes

Versions: 5

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

5 entries across 5 versions & 1 rubygems

Version Path
symmetric-encryption-4.6.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.5.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.4.0 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.3.3 lib/symmetric_encryption/keystore/heroku.rb
symmetric-encryption-4.3.2 lib/symmetric_encryption/keystore/heroku.rb