Sha256: 17925fac9a4598fb7641afdab1a45f09d7fa3afb92aaf488958c38c25196d44f

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 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/agent/patching/policy/policy_node'

module Contrast
  module Agent
    module Deadzone
      module Policy
        # This class functions to translate our policy.json into an actionable Ruby object, allowing for dynamic
        # patching over hardcoded patching, specifically for those methods in which other Contrast operations should
        # not apply.
        class DeadzoneNode < Contrast::Agent::Patching::Policy::PolicyNode
          def node_class
            'Deadzone'
          end

          def feature
            'Deadzone'
          end

          # Deadzone means place the code inside of the contrast scope so that none of our code executes. As such, all
          # DeadZone nodes have that as their method scope.
          def method_scope
            :contrast
          end

          # TODO: RUBY-99999 remove, used to clean up logs while debugging
          # def validate
          #   return if class_name
          #
          #   raise(ArgumentError, "#{ node_class } #{ id } did not have a proper class name. Unable to create.")
          # end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contrast-agent-5.3.0 lib/contrast/agent/deadzone/policy/deadzone_node.rb
contrast-agent-5.2.0 lib/contrast/agent/deadzone/policy/deadzone_node.rb
contrast-agent-5.1.0 lib/contrast/agent/deadzone/policy/deadzone_node.rb
contrast-agent-5.0.0 lib/contrast/agent/deadzone/policy/deadzone_node.rb