Class: Contrast::Agent::Reporting::FindingEventStack
- Inherits:
-
ReportingEvent
- Object
- ReportableHash
- ReportingEvent
- Contrast::Agent::Reporting::FindingEventStack
- Defined in:
- lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb
Overview
This is the new FindingEventStack class which will include all the needed information for the new reporting system to relay this information in the Finding/Trace messages. These FindingEventStack are used by TeamServer to construct the vulnerability information for the assess feature. They represent the callstack at the time that each FindingEvent was generated.
Constant Summary collapse
- AGENT_CLASS_MARKER =
'/lib/contrast/'
Instance Attribute Summary collapse
-
#eval ⇒ String
readonly
Unused.
-
#file ⇒ String
readonly
The stack frame to show in TeamServer; the value of an entry in #caller.
-
#line_number ⇒ String
readonly
Unused.
-
#method ⇒ String
readonly
Unused.
-
#signature ⇒ String
readonly
Unused.
-
#type ⇒ String
readonly
Unused.
Attributes inherited from ReportingEvent
#event_endpoint, #event_method
Instance Method Summary collapse
-
#initialize(file_name) ⇒ FindingEventStack
constructor
To play nice with the way that TeamServer is rendering these values, we only populate the file_name field with exactly what we want them to display.
-
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
- #validate ⇒ Object
Methods inherited from ReportingEvent
Methods inherited from ReportableHash
Methods included from Components::Logger::InstanceMethods
Constructor Details
#initialize(file_name) ⇒ FindingEventStack
To play nice with the way that TeamServer is rendering these values, we only populate the file_name field with exactly what we want them to display.
35 36 37 38 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 35 def initialize file_name @file = file_name super() end |
Instance Attribute Details
#eval ⇒ String (readonly)
Returns unused.
17 18 19 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 17 def eval @eval end |
#file ⇒ String (readonly)
Returns the stack frame to show in TeamServer; the value of an entry in #caller.
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 19 def file @file end |
#line_number ⇒ String (readonly)
Returns unused.
21 22 23 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 21 def line_number @line_number end |
#method ⇒ String (readonly)
Returns unused.
23 24 25 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 23 def method @method end |
#signature ⇒ String (readonly)
Returns unused.
25 26 27 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 25 def signature @signature end |
#type ⇒ String (readonly)
Returns unused.
27 28 29 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 27 def type @type end |
Instance Method Details
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 45 def to_controlled_hash validate { file: file # eval: eval, # This is unused by the Ruby agent # line_number: line_number, # This is unused by the Ruby agent # method: method, # This is unused by the Ruby agent # signature: signature, # This is unused by the Ruby agent # type: type # This is unused by the Ruby agent } end |
#validate ⇒ Object
57 58 59 60 61 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb', line 57 def validate return unless Contrast::Utils::DuckUtils.empty_duck?(file) raise(ArgumentError, "#{ self } did not have a proper file. Unable to continue.") end |