Class: Contrast::Agent::Reporting::AttackResult
- Defined in:
- lib/contrast/agent/reporting/attack_result/attack_result.rb
Overview
This class will hold the new Attacks results generated by our protect rules.
Constant Summary collapse
- RESPONSE_TYPE =
Contrast::Agent::Reporting::ResponseType
Instance Method Summary collapse
- #details ⇒ Object
- #details=(protect_details) ⇒ Object
- #empty? ⇒ Boolean
-
#response ⇒ Object
Generated the attack result.
-
#response=(response_type) ⇒ Object
sets the response_type.
- #rule_id ⇒ Object
- #rule_id=(rule_id) ⇒ Object
- #samples ⇒ Object
- #samples=(samples) ⇒ Object
- #tags ⇒ Object
- #tags=(tags) ⇒ Object
Instance Method Details
#details ⇒ Object
62 63 64 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 62 def details @_details ||= {} end |
#details=(protect_details) ⇒ Object
66 67 68 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 66 def details= protect_details @_details = protect_details if protect_details.is_a?(Contrast::Agent::Reporting::Details::ProtectRuleDetails) end |
#empty? ⇒ Boolean
70 71 72 73 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 70 def empty? Contrast::Utils::DuckUtils.empty_duck?(samples) || Contrast::Utils::DuckUtils.empty_duck?(rule_id) || response == ::Contrast::Agent::Reporting::ResponseType::NO_ACTION end |
#response ⇒ Object
Generated the attack result
20 21 22 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 20 def response @_response ||= RESPONSE_TYPE::NO_ACTION end |
#response=(response_type) ⇒ Object
sets the response_type
28 29 30 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 28 def response= response_type @_response = response_type if RESPONSE_TYPE.to_a.include?(response_type) end |
#rule_id ⇒ Object
33 34 35 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 33 def rule_id @_rule_id ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |
#rule_id=(rule_id) ⇒ Object
39 40 41 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 39 def rule_id= rule_id @_rule_id = rule_id if rule_id.is_a?(String) end |
#samples ⇒ Object
44 45 46 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 44 def samples @_samples ||= [] end |
#samples=(samples) ⇒ Object
50 51 52 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 50 def samples= samples @_samples = samples if samples.is_a?(Array) end |
#tags ⇒ Object
54 55 56 |
# File 'lib/contrast/agent/reporting/attack_result/attack_result.rb', line 54 def @_tags ||= Contrast::Utils::ObjectShare::EMPTY_STRING end |