Class: Contrast::Agent::Reporting::UserInput
- Defined in:
- lib/contrast/agent/reporting/attack_result/user_input.rb
Overview
This class will hold the new Sqli detail used by RaspRuleSample
Constant Summary collapse
- INPUT_TYPE =
Contrast::Agent::Reporting::InputType
- DOCUMENT_TYPE =
{ XML: :XML, JSON: :JSON, NORMAL: :NORMAL }.cs__freeze
Instance Method Summary collapse
-
#document_type ⇒ Object
type [Symbol<:XML, :JSON, :NORMAL>].
- #document_type=(type) ⇒ Object
-
#input_type ⇒ Object
Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>].
-
#input_type=(input_type) ⇒ Object
Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>] Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>].
- #key ⇒ Object
- #key=(key) ⇒ Object
-
#matcher_ids ⇒ Object
Matchers IDs.
-
#matcher_ids=(ids) ⇒ Object
Matchers IDs.
- #path ⇒ Object
- #path=(path) ⇒ Object
- #to_controlled_hash ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Instance Method Details
#document_type ⇒ Object
type [Symbol<:XML, :JSON, :NORMAL>]
63 64 65 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 63 def document_type @_document_type ||= DOCUMENT_TYPE[:NORMAL] end |
#document_type=(type) ⇒ Object
67 68 69 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 67 def document_type= type @_document_type = type if DOCUMENT_TYPE.value?(type) end |
#input_type ⇒ Object
Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>]
50 51 52 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 50 def input_type @_input_type ||= INPUT_TYPE::UNDEFINED_TYPE end |
#input_type=(input_type) ⇒ Object
Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>] Symbol<Contrast::Agent::Reporting::Settings::InputAnalysis::InputAnalysisResult::InputType>]
58 59 60 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 58 def input_type= input_type @_input_type = input_type if INPUT_TYPE.to_a.include?(input_type) end |
#key ⇒ Object
27 28 29 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 27 def key @_key ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |
#key=(key) ⇒ Object
33 34 35 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 33 def key= key @_key = key if key.is_a?(String) end |
#matcher_ids ⇒ Object
Matchers IDs
73 74 75 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 73 def matcher_ids @_matcher_ids ||= [] end |
#matcher_ids=(ids) ⇒ Object
Matchers IDs
80 81 82 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 80 def matcher_ids= ids @_matcher_ids = ids if ids.is_a?(Array) && ids.any?(String) end |
#path ⇒ Object
16 17 18 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 16 def path @_path ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |
#path=(path) ⇒ Object
22 23 24 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 22 def path= path @_path = path if path.is_a?(String) end |
#to_controlled_hash ⇒ Object
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 84 def to_controlled_hash { path: path, key: key, value: value, inputType: input_type.to_s, documentType: document_type.to_s, matcherIds: matcher_ids&.map(&:to_s) } end |
#value ⇒ Object
38 39 40 |
# File 'lib/contrast/agent/reporting/attack_result/user_input.rb', line 38 def value @_value ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |