Sha256: 5f180aa11f05bfae8a7513e167c923492fa23a599a8d57e4ec892a3da3e15f0c
Contents?: true
Size: 694 Bytes
Versions: 61
Compression:
Stored size: 694 Bytes
Contents
# frozen_string_literal: true module ActiveRecord module Encryption # A +NullEncryptor+ that will raise an error when trying to encrypt data # # This is useful when you want to reveal ciphertexts for debugging purposes # and you want to make sure you won't overwrite any encryptable attribute with # the wrong content. class ReadOnlyNullEncryptor def encrypt(clean_text, key_provider: nil, cipher_options: {}) raise Errors::Encryption, "This encryptor is read-only" end def decrypt(encrypted_text, key_provider: nil, cipher_options: {}) encrypted_text end def encrypted?(text) false end end end end
Version data entries
61 entries across 58 versions & 8 rubygems