Sha256: 19bc2d1e5cdbb325780ab5724f4f08282379ca184223f4f6151d6a0c68a9a6b7
Contents?: true
Size: 1.59 KB
Versions: 18
Compression:
Stored size: 1.59 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/reportable_hash' require 'contrast/utils/duck_utils' module Contrast module Agent module Reporting # The usage, meaning loaded files, of a library seen during this request class LibraryUsageObservation < Contrast::Agent::Reporting::ReportableHash # @param [String] Sha256Sum of library as identified by the agent attr_reader :id # @param [Array<String>] List of file paths that have been loaded out of or executed by the library attr_reader :names # @param id [String] Sha256Sum of library as identified by the agent # @param class_names [Array<String>] List of file paths that have been loaded out of or executed by the library def initialize id, class_names @id = id @names = class_names super() end # @raise [ArgumentError] def to_controlled_hash validate { id: @id, names: @names } end # @raise [ArgumentError] def validate if Contrast::Utils::DuckUtils.empty_duck?(id) raise(ArgumentError, "#{ self } did not have a proper id. Unable to continue.") end if Contrast::Utils::DuckUtils.empty_duck?(names) raise(ArgumentError, "#{ self } did not have a proper names. Unable to continue.") end nil end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems