123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Encryption::Config

Relationships & Source Files
Inherits: Object
Defined in: activerecord/lib/active_record/encryption/config.rb

Overview

Container of configuration options

Class Method Summary

Instance Attribute Summary

Constructor Details

.newConfig

[ GitHub ]

  
# File 'activerecord/lib/active_record/encryption/config.rb', line 13

def initialize
  set_defaults
end

Instance Attribute Details

#add_to_filter_parameters (rw)

[ GitHub ]

#deterministic_key (rw)

[ GitHub ]

#encrypt_fixtures (rw)

[ GitHub ]

#excluded_from_filter_parameters (rw)

[ GitHub ]

#extend_queries (rw)

[ GitHub ]

#forced_encoding_for_deterministic_encryption (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/encryption/config.rb', line 9

attr_accessor :primary_key, :deterministic_key, :store_key_references, :key_derivation_salt, :hash_digest_class,
              :support_unencrypted_data, :encrypt_fixtures, :validate_column_size, :add_to_filter_parameters,
              :excluded_from_filter_parameters, :extend_queries, :previous_schemes, :forced_encoding_for_deterministic_encryption

#hash_digest_class (rw)

[ GitHub ]

#key_derivation_salt (rw)

[ GitHub ]

#previous=(previous_schemes_properties) (writeonly)

Configure previous encryption schemes.

config.active_record.encryption.previous = [ { key_provider: MyOldKeyProvider.new } ]
[ GitHub ]

  
# File 'activerecord/lib/active_record/encryption/config.rb', line 20

def previous=(previous_schemes_properties)
  previous_schemes_properties.each do |properties|
    add_previous_scheme(**properties)
  end
end

#previous_schemes (rw)

[ GitHub ]

#primary_key (rw)

[ GitHub ]

#store_key_references (rw)

[ GitHub ]

#support_sha1_for_non_deterministic_encryption=(value) (writeonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/encryption/config.rb', line 26

def support_sha1_for_non_deterministic_encryption=(value)
  if value && has_primary_key?
    sha1_key_generator = ActiveRecord::Encryption::KeyGenerator.new(hash_digest_class: OpenSSL::Digest::SHA1)
    sha1_key_provider = ActiveRecord::Encryption::DerivedSecretKeyProvider.new(primary_key, key_generator: sha1_key_generator)
    add_previous_scheme key_provider: sha1_key_provider
  end
end

#support_unencrypted_data (rw)

[ GitHub ]

#validate_column_size (rw)

[ GitHub ]