Sha256: 84cc8ae79dc2c674644a4d9f97453ecaf74f43e28e4e1de8a9c7e9b9028cd08d

Contents?: true

Size: 1.8 KB

Versions: 12

Compression:

Stored size: 1.8 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/utils/object_share'
require 'contrast/utils/timer'
require 'contrast/agent/reporting/attack_result/user_input'

module Contrast
  module Agent
    module Reporting
      # This class will hold the new RaspRuleSample.
      # protect rules.
      class RaspRuleSample # rubocop:disable Lint/EmptyClass
        # def timestamp
        #   @_timestamp ||= 0
        # end
        #
        # def timestamp= timestamp_ms
        #   @_timestamp = timestamp_ms
        # end
        #
        # def user_input
        #   @_user_input ||= Contrast::Agent::Reporting::UserInput.new
        # end
        #
        # def user_input= input
        #   @_user_input = input if input.is_a?(Contrast::Agent::Reporting::UserInput)
        # end
        #
        # def build context, ia_result
        #   sample = self
        #   sample.timestamp = context&.timer&.start_ms
        #   sample.user_input = build_user_input_from_ia(ia_result)
        #   sample.user_input.document_type = if context&.request
        #                                       Contrast::Utils::StringUtils.force_utf8(context.request.document_type)
        #                                     end
        #   sample
        # end
        #
        # def build_user_input_from_ia ia_result
        #   user_input = Contrast::Agent::Reporting::UserInput.new
        #   user_input.input_type = ia_result.input_type
        #   user_input.matcher_ids = ia_result.ids
        #   user_input.path = ia_result.path
        #   user_input.key = ia_result.key if ia_result.key
        #   user_input.value = ia_result.value if ia_result.value
        #   user_input
        # end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
contrast-agent-6.6.4 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.6.3 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.6.2 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.6.1 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.6.0 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.5.1 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.5.0 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.4.0 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.3.0 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.2.0 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.1.2 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
contrast-agent-6.1.1 lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb