Sha256: 222c89524edfe812717ece4cb57ea3d36dec2ff1151c7f08a8d7449efedd3499
Contents?: true
Size: 1.33 KB
Versions: 18
Compression:
Stored size: 1.33 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/library_discovery' require 'contrast/agent/inventory/dependencies' require 'contrast/utils/object_share' module Contrast module Agent module Inventory # Used to collect dependencies of the application for reporting class DependencyAnalysis include Singleton include Contrast::Agent::Inventory::Dependencies # Report the dependencies of this application # # @return [Array<Contrast::Agent::Reporting::LibraryDiscovery>] direct report form of # Gem::Specification that have been loaded for this application. def library_pb_list return Contrast::Utils::ObjectShare::EMPTY_ARRAY unless ::Contrast::INVENTORY.enable return Contrast::Utils::ObjectShare::EMPTY_ARRAY unless ::Contrast::INVENTORY.analyze_libraries loaded_specs.each_with_object([]) do |(_name, spec), reported_lib_list| next unless spec next unless (digest = Contrast::Utils::Sha256Builder.instance.build_from_spec(spec)) reported_lib_list << Contrast::Agent::Reporting::LibraryDiscovery.new(digest, spec) end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems