跳到内容 跳到搜索

配置选项容器

方法
N
P
S

属性

[RW] add_to_filter_parameters
[RW] compressor
[RW] deterministic_key
[RW] encrypt_fixtures
[RW] excluded_from_filter_parameters
[RW] extend_queries
[RW] forced_encoding_for_deterministic_encryption
[RW] hash_digest_class
[RW] key_derivation_salt
[RW] previous_schemes
[RW] primary_key
[RW] store_key_references
[RW] support_unencrypted_data
[RW] validate_column_size

类公共方法

new()

# File activerecord/lib/active_record/encryption/config.rb, line 14
def initialize
  set_defaults
end

实例公共方法

previous=(previous_schemes_properties)

配置以前加密方案。

config.active_record.encryption.previous = [ { key_provider: MyOldKeyProvider.new } ]
# File activerecord/lib/active_record/encryption/config.rb, line 21
def previous=(previous_schemes_properties)
  previous_schemes_properties.each do |properties|
    add_previous_scheme(**properties)
  end
end

support_sha1_for_non_deterministic_encryption=(value)

# File activerecord/lib/active_record/encryption/config.rb, line 27
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