Sha256: 87cd1c1c2d71782b4714da9eac4da134cf403873c5613c749628eaea8eea4e79

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/api/dtm.pb'
require 'contrast/components/base'

module Contrast
  module Api
    module Decorators
      # Used to decorate the InstrumentationMode protobuf model to handle reporting Agent process start
      module InstrumentationMode
        include Contrast::Components::ComponentBase

        def self.included klass
          klass.extend(ClassMethods)
        end

        # Used to add class methods to the AgentStartup class on inclusion of the decorator
        module ClassMethods
          # Return a new DTM with the values from the configuration
          #
          # @return [Contrast::Api::Dtm::InstrumentationMode]
          def build
            msg = new
            msg.assess =  ::Contrast::ASSESS.enabled?
            msg.protect = ::Contrast::PROTECT.enabled?
            msg
          end
        end
      end
    end
  end
end

Contrast::Api::Dtm::InstrumentationMode.include(Contrast::Api::Decorators::InstrumentationMode)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.14.0 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.13.1 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.13.0 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.12.0 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.11.0 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.10.0 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.9.1 lib/contrast/api/decorators/instrumentation_mode.rb
contrast-agent-4.9.0 lib/contrast/api/decorators/instrumentation_mode.rb