File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
activerecord/lib/active_record/encryption Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,18 @@ def compress? # :nodoc:
9494 private
9595 DECRYPT_ERRORS = [ OpenSSL ::Cipher ::CipherError , Errors ::EncryptedContentIntegrity , Errors ::Decryption ]
9696 ENCODING_ERRORS = [ EncodingError , Errors ::Encoding ]
97+
98+ # This threshold cannot be changed.
99+ #
100+ # Users can search for attributes encrypted with `deterministic: true`.
101+ # That is possible because we are able to generate the message for the
102+ # given clear text deterministically, and with that perform a regular
103+ # string lookup in SQL.
104+ #
105+ # Problem is, messages may have a "c" header that is present or not
106+ # depending on whether compression was applied on encryption. If this
107+ # threshold was modified, the message generated for lookup could vary
108+ # for the same clear text, and searches on exisiting data could fail.
97109 THRESHOLD_TO_JUSTIFY_COMPRESSION = 140 . bytes
98110
99111 def default_key_provider
You can’t perform that action at this time.
0 commit comments