Sha256: e3e8ea8a97ae399824a5933d1af3bba5bb0dfab14e2c0056e88a66bdbc588743

Contents?: true

Size: 1.7 KB

Versions: 18

Compression:

Stored size: 1.7 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/utils/object_share'
require 'contrast/agent/reporting/settings/virtual_patch_condition'

module Contrast
  module Agent
    module Reporting
      module Settings
        # The settings for each virtual patch in the agent.
        class VirtualPatch
          # @return [String]
          attr_reader :name
          # @return [String]
          attr_reader :key
          # @return [String]
          attr_reader :uuid

          def initialize hash
            @name = hash[:name]
            @key = hash[:key]
            @uuid = hash[:uuid]

            hash[:headers]&.each do |header_json|
              headers << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
            end

            hash[:parameters]&.each do |header_json|
              parameters << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
            end

            hash[:urls]&.each do |header_json|
              urls << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
            end
          end

          # @return [Array<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>]
          def headers
            @_headers ||= []
          end

          # @return [Array<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>]
          def parameters
            @_parameters ||= []
          end

          # @return [Array<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>]
          def urls
            @_urls ||= []
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.6.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.5.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.4.1 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.4.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.3.2 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.3.1 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.3.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.2.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.1.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-7.0.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.15.3 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.15.2 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.15.1 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.15.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.14.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.13.0 lib/contrast/agent/reporting/settings/virtual_patch.rb
contrast-agent-6.12.0 lib/contrast/agent/reporting/settings/virtual_patch.rb