instance method validate_message_data_format

Ruby on Rails 8.1.2

Since v7.0.10 Private

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

validate_message_data_format(data, level)

No documentation comment.

Parameters

data req
level req
Source
# File activerecord/lib/active_record/encryption/message_serializer.rb, line 46
        def validate_message_data_format(data, level)
          if level > 2
            raise ActiveRecord::Encryption::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 ActiveRecord::Encryption::Errors::Decryption, "Invalid data format: hash without payload"
          end
        end

Defined in activerecord/lib/active_record/encryption/message_serializer.rb line 46 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Encryption::MessageSerializer

Type at least 2 characters to search.

↑↓ navigate · open · esc close