Sha256: 853e7cd6482baae4908b0fea5f04a26024d13f82da9cad8cc09135f00ce74b44
Contents?: true
Size: 1.21 KB
Versions: 5
Compression:
Stored size: 1.21 KB
Contents
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'contrast/agent/reporting/reporting_events/application_reporting_event' require 'contrast/agent/reporting/reporting_events/library_usage_observation' require 'contrast/components/logger' module Contrast module Agent module Reporting # List of libraries that have been observed to have something loaded or executed. class ObservedLibraryUsage < Contrast::Agent::Reporting::ApplicationReportingEvent # @return Array[Contrast::Agent::Reporting::LibraryUsageObservation] attr_reader :observations def initialize @event_endpoint = Contrast::Agent::Reporting::Endpoints.library_usage @observations = [] super() end def file_name 'library-observation' end def to_controlled_hash validate { observations: @observations.map(&:to_controlled_hash) } end def validate raise(ArgumentError, "#{ self } did not have observations. Unable to continue.") if observations.empty? nil end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems