rails/activerecord/test
maximerety d0f3b007b2
[Fix #48685] Make the encryptor agnostic of the type of data to decrypt
It is the role of the underlying serializer to accept or reject the data
to decrypt depending on its type. This behavior mirrors what is done at
encryption, where the serializer asserts that the input is an
ActiveRecord::Encryption::Message.

This change allows for a wider variety of custom serializers, but does
not change the behavior when using the default MessageSerializer class.
Indeed, the default message serializer will raise a TypeError when
invoking JSON.parse on any non-String input. This error will subsequently
be translated into an ActiveRecord::Encryption::Errors::Encoding error
by the encryptor, which does not change the current behavior at the
encryptor level.

A new test asserts that the default MessageSerializer is able to reject
unexpected data types on its own at decryption time, just as it does at
encryption time (test already present). The test also asserts that an
exception is translated into an ActiveRecord::Encryption::Error::Encoding
error at the encryptor level.
2024-01-05 13:05:15 -05:00
..
active_record/connection_adapters Add deprecation and specific exceptions to warn when an adapter is using the legacy registration format in 7.2 2023-11-30 07:00:38 -05:00
activejob [Tests only] Enable `Minitest/AssertPredicate` rule 2023-10-13 19:26:47 +00:00
assets Replace test `Man` with `Human` 2020-08-14 11:37:09 -04:00
cases [Fix #48685] Make the encryptor agnostic of the type of data to decrypt 2024-01-05 13:05:15 -05:00
fixtures Fix `destroy_all` for `has_many :through` associations that points to a CPK model 2023-06-14 17:48:13 +00:00
migrations Sort migration ID as int in db:migrate:status for consistency. 2021-07-16 13:10:31 -05:00
models Merge pull request #50319 from fatkodima/fix-where-for-polymorphic-cpk 2023-12-11 10:20:07 -05:00
schema Merge pull request #50319 from fatkodima/fix-where-for-polymorphic-cpk 2023-12-11 10:20:07 -05:00
support Define missing attribute methods from `method_missing` 2024-01-05 16:56:19 +01:00
config.example.yml Move trilogy config closer to mysql2 2023-06-20 15:30:07 +00:00
config.rb Delete AS::Dependencies.safe_constantize 2021-08-20 17:51:05 +02:00