Sha256: da54857b71d65e7ea09b98c29ee7f25040407232d22f18b4fabf90964306a21d

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 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/reporting/settings/exclusion_base'
require 'contrast/utils/object_share'

module Contrast
  module Agent
    module Reporting
      module Settings
        # InputExclusions class
        class InputExclusion < ExclusionBase
          ATTRIBUTES = BASE_ATTRIBUTES.dup << :type
          ATTRIBUTES.cs__freeze
          VALID_INPUT_TYPES = %w[COOKIE PARAMETER HEADER BODY QUERYSTRING].cs__freeze

          # @return type [String] The type of the input
          def type
            @_type ||= Contrast::Utils::ObjectShare::EMPTY_STRING
          end

          # @param new_type [String] Set new input type.
          # @return type [String] The type of the input.
          def type= new_type
            @_type = new_type if VALID_INPUT_TYPES.include?(new_type)
          end

          def to_controlled_hash
            hash = super
            hash[:type] = type
            hash
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
contrast-agent-6.7.0 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.5 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.4 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.3 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.2 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.1 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.6.0 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.5.1 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.5.0 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.4.0 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.3.0 lib/contrast/agent/reporting/settings/input_exclusion.rb
contrast-agent-6.2.0 lib/contrast/agent/reporting/settings/input_exclusion.rb