2021-03-10 18:13:00 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-02-23 13:02:10 -05:00
|
|
|
require "active_support/core_ext/module"
|
|
|
|
require "active_support/core_ext/array"
|
|
|
|
|
|
|
|
module ActiveRecord
|
|
|
|
module Encryption
|
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
2021-03-12 11:36:49 -05:00
|
|
|
eager_autoload do
|
|
|
|
autoload :Cipher
|
|
|
|
autoload :Config
|
|
|
|
autoload :Configurable
|
|
|
|
autoload :Context
|
|
|
|
autoload :Contexts
|
|
|
|
autoload :DerivedSecretKeyProvider
|
|
|
|
autoload :EncryptableRecord
|
|
|
|
autoload :EncryptedAttributeType
|
|
|
|
autoload :EncryptedFixtures
|
|
|
|
autoload :EncryptingOnlyEncryptor
|
2021-03-22 11:02:55 -04:00
|
|
|
autoload :DeterministicKeyProvider
|
2021-03-12 11:36:49 -05:00
|
|
|
autoload :Encryptor
|
|
|
|
autoload :EnvelopeEncryptionKeyProvider
|
|
|
|
autoload :Errors
|
|
|
|
autoload :ExtendedDeterministicQueries
|
2021-03-22 13:13:59 -04:00
|
|
|
autoload :ExtendedDeterministicUniquenessValidator
|
2021-03-12 11:36:49 -05:00
|
|
|
autoload :Key
|
|
|
|
autoload :KeyGenerator
|
|
|
|
autoload :KeyProvider
|
|
|
|
autoload :Message
|
|
|
|
autoload :MessageSerializer
|
|
|
|
autoload :NullEncryptor
|
|
|
|
autoload :Properties
|
|
|
|
autoload :ReadOnlyNullEncryptor
|
2021-03-20 18:25:17 -04:00
|
|
|
autoload :Scheme
|
2021-03-12 11:36:49 -05:00
|
|
|
end
|
2021-02-23 13:02:10 -05:00
|
|
|
|
|
|
|
class Cipher
|
|
|
|
extend ActiveSupport::Autoload
|
2021-03-12 11:36:49 -05:00
|
|
|
|
|
|
|
eager_autoload do
|
|
|
|
autoload :Aes256Gcm
|
|
|
|
end
|
2021-02-23 13:02:10 -05:00
|
|
|
end
|
|
|
|
|
2021-03-12 11:43:11 -05:00
|
|
|
include Configurable
|
|
|
|
include Contexts
|
2021-03-12 11:36:49 -05:00
|
|
|
|
|
|
|
def self.eager_load!
|
|
|
|
super
|
|
|
|
|
|
|
|
Cipher.eager_load!
|
|
|
|
end
|
2021-02-23 13:02:10 -05:00
|
|
|
end
|
|
|
|
end
|