Class: Contrast::Agent::Reporting::InputAnalysisResult

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb

Overview

This class will do ia analysis for our protect rules

Constant Summary collapse

INPUT_TYPE =
Contrast::Agent::Reporting::InputType
SCORE_LEVEL =
Contrast::Agent::Reporting::ScoreLevel

Instance Method Summary collapse

Instance Method Details

#attack_countObject



100
101
102
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 100

def attack_count
  @_attack_count ||= 0
end

#attack_count=(attack_count) ⇒ Object

Returns @_attack_count.

Parameters:

  • attack_count

Returns:

  • @_attack_count



106
107
108
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 106

def attack_count= attack_count
  @_attack_count = attack_count if attack_count.is_a?(Integer)
end

#detailsContrast::Agent::Reporting::Details::ProtectRuleDetails?

Additional per rule details containing more specific info.



136
137
138
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 136

def details
  @_details
end

#details=(protect_rule_details) ⇒ Object

Additional per rule details containing more specific info.

Parameters:



127
128
129
130
131
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 127

def details= protect_rule_details
  return unless protect_rule_details.is_a?(Contrast::Agent::Reporting::Details::ProtectRuleDetails)

  @_details = protect_rule_details
end

#idsObject

Matchers IDs



88
89
90
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 88

def ids
  @_ids ||= []
end

#ids=(ids) ⇒ Object

Matchers IDs

Parameters:



95
96
97
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 95

def ids= ids
  @_ids = ids if ids.is_a?(Array) && ids.any?(String)
end

#input_typeObject

Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>]

Returns:

  • @_input_type [



30
31
32
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 30

def input_type
  @_input_type ||= INPUT_TYPE::UNKNOWN
end

#input_type=(input_type) ⇒ Object

Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>] Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>]

Parameters:

  • input_type

    [

Returns:

  • @_input_type [



38
39
40
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 38

def input_type= input_type
  @_input_type = input_type if INPUT_TYPE.to_a.include?(input_type)
end

#keyObject



54
55
56
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 54

def key
  @_key ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#key=(key) ⇒ Object

Parameters:



60
61
62
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 60

def key= key
  @_key = key if key.is_a?(String)
end

#key_typeObject



71
72
73
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 71

def key_type
  @_key_type ||= INPUT_TYPE::UNDEFINED_TYPE
end

#key_type=(key_type) ⇒ Object

Parameters:

  • key_type (Symbol)


66
67
68
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 66

def key_type= key_type
  @_key_type = key_type if INPUT_TYPE.to_a.include?(key_type)
end

#pathObject



43
44
45
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 43

def path
  @_path ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#path=(path) ⇒ Object

Parameters:



49
50
51
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 49

def path= path
  @_path = path if path.is_a?(String)
end

#rule_idObject



18
19
20
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 18

def rule_id
  @_rule_id ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#rule_id=(id) ⇒ Object

Parameters:



24
25
26
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 24

def rule_id= id
  @_rule_id = id if id.is_a?(String)
end

#score_levelObject

Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::ScoreLevel>]

Returns:

  • @_score_level [



112
113
114
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 112

def score_level
  @_score_level ||= SCORE_LEVEL::IGNORE
end

#score_level=(score_level) ⇒ Object

Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::ScoreLevel>] Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::ScoreLevel>]

Parameters:

  • score_level

    [

Returns:

  • @_score_level [



120
121
122
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 120

def score_level= score_level
  @_score_level = score_level if SCORE_LEVEL.to_a.include?(score_level)
end

#valueObject



76
77
78
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 76

def value
  @_value ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#value=(value) ⇒ Object

Parameters:



82
83
84
# File 'lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb', line 82

def value= value
  @_value = value if value.is_a?(String)
end