Sha256: dd8c305a143f7e22d6f47e6f8e1b1546ac918c76367e7b19ff7f97993a1878a8

Contents?: true

Size: 776 Bytes

Versions: 7

Compression:

Stored size: 776 Bytes

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

# This Class provides us with a way to invoke Hash propagation for those
# methods which are too complex to fit into one of the standard
# Contrast::Agent::Assess::Policy::Propagator molds.
class Hash
  def self.cs__duplicate_and_freeze object
    return object unless object.is_a?(String) && !object.cs__frozen?
    return object unless object.cs__tracked?

    object.dup.cs__freeze
  rescue StandardError
    logger.error("Unable to track dataflow through array for #{ object }")
  end

  def cs__bracket_set *args
    Hash.cs__duplicate_and_freeze(args[0])
  end
end

cs__scoped_require 'cs__assess_hash/cs__assess_hash'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-3.10.2 lib/contrast/extensions/ruby_core/assess/hash.rb
contrast-agent-3.10.1 lib/contrast/extensions/ruby_core/assess/hash.rb
contrast-agent-3.10.0 lib/contrast/extensions/ruby_core/assess/hash.rb
contrast-agent-3.9.1 lib/contrast/extensions/ruby_core/assess/hash.rb
contrast-agent-3.9.0 lib/contrast/extensions/ruby_core/assess/hash.rb
contrast-agent-3.8.5 lib/contrast/core_extensions/assess/hash.rb
contrast-agent-3.8.4 lib/contrast/core_extensions/assess/hash.rb