Sha256: 2bea121f648d4af71fdfbb0007d484f132a20527240dc14601a2927c92b89a77

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

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

module Contrast
  module Agent
    module Assess
      module Policy
        module Propagator
          # A propagator is a method which can transform data, as described by
          # the Contrast::Agent::Assess::Policy::PropagationNode class. Each
          # type of propagator does so differently, but always acts on a Source
          # to pass tags from it to a Target.
          class Base
            class << self
              def find_source source, preshift
                case source
                when Contrast::Utils::ObjectShare::OBJECT_KEY
                  preshift.object
                else
                  preshift.args[source]
                end
              end

              def tracked_value? value
                Contrast::Agent::Assess::Tracker.tracked?(value)
              end

              def propagate _propagation_node, _preshift, _target
                raise NoMethodError("Expected Base propagator subclass: #{ cs__class } to implement #propagate")
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
contrast-agent-4.4.1 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.4.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.3.2 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.3.1 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.3.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.2.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.1.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-4.0.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-3.16.0 lib/contrast/agent/assess/policy/propagator/base.rb
contrast-agent-3.15.0 lib/contrast/agent/assess/policy/propagator/base.rb