Sha256: fc4ebc4b6a75b624c6ee67e6359dd7d9c7eed39b28f1b6988e3901e36beaf99a

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

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

require 'contrast/extension/module'

module Contrast
  module Agent
    module Assess
      module Policy
        module Propagator
          # Propagation that results in some complex or specific translation
          # of tags from the source to the target. Each node with the CUSTOM
          # action knows the class and method it should call to preform this
          # action.
          module Custom
            class << self
              def propagate propagation_node, preshift, ret, block
                clazz = propagation_node.patch_class
                method = propagation_node.patch_method

                # We cannot flip the String to a Module at patcher creation time -
                # the Module may not exist yet. Instead, we have to defer until the
                # first time the patcher is used.
                if clazz.is_a?(String)
                  clazz = Object.cs__const_get(clazz)
                  propagation_node.patch_class = clazz
                end
                clazz.send(method, propagation_node, preshift, ret, block)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
contrast-agent-6.4.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.3.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.2.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.1.2 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.1.1 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.1.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-6.0.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-5.3.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-5.2.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-5.1.0 lib/contrast/agent/assess/policy/propagator/custom.rb
contrast-agent-5.0.0 lib/contrast/agent/assess/policy/propagator/custom.rb