Sha256: 726cea50ad284aefcb636648cb24d6a04fb6cb649ac1369786eb11a62812f23f
Contents?: true
Size: 1.78 KB
Versions: 18
Compression:
Stored size: 1.78 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/components/logger' require 'contrast/agent/reporting/reporting_events/reporting_event' require 'contrast/agent/reporting/reporting_events/discovered_route' module Contrast module Agent module Reporting # This is the new ApplicationInventory class which will include all the needed information # for the new reporting system to report. Reporting those components or details discovered at # startup, or as soon as possible, but not necessarily seen used by the application. Each of # these messages should only be sent once per application. class ApplicationInventory < Contrast::Agent::Reporting::ApplicationReportingEvent # @param [Array<Contrast::Agent::Reporting::DiscoveredRoute>] the routes registered to this application, as # discovered during first request processing. attr_reader :routes def initialize @event_type = :application_inventory @event_method = :POST @event_endpoint = Contrast::Agent::Reporting::Endpoints.application_inventory # The API spec limits us to 500 routes, so we'll enforce that here to not hold on to superfulous data. @routes = Contrast::Agent.framework_manager.find_route_discovery_data&.take(500) super() end def file_name 'applications-inventory' end def to_controlled_hash { session_id: ::Contrast::ASSESS.session_id, # documentation lists routes as deprecated from the agent_ng_endpoints.yml routes: routes.map(&:to_controlled_hash) } end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems