method

validate_message_data_format

rails latest stable - Class: ActiveRecord::Encryption::MessagePackMessageSerializer

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

validate_message_data_format(data, level)
private

No documentation available.

# File activerecord/lib/active_record/encryption/message_pack_message_serializer.rb, line 57
        def validate_message_data_format(data, level)
          if level > 2
            raise Errors::Decryption, "More than one level of hash nesting in headers is not supported"
          end

          unless data.is_a?(Hash) && data.has_key?("p")
            raise Errors::Decryption, "Invalid data format: hash without payload"
          end
        end