Sha256: 5478e1c579df404cbedfc2d72d041764d2bf28cd254842d3ec1d58b7e6828ba7

Contents?: true

Size: 800 Bytes

Versions: 8

Compression:

Stored size: 800 Bytes

Contents

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

module Contrast
  module Utils
    # Utility class used to determine information about the current data store
    # on which a query was executed or to which the application is connected.
    module DataStoreUtil
      def self.report_data_store data_store
        return unless data_store

        context = Contrast::Agent::REQUEST_TRACKER.current
        return unless context&.activity

        context.activity.technologies[data_store] = true
        context.activity.query_count += 1
        return unless context.activity.query_count == 1

        Contrast::Utils::InventoryUtil.append_db_config(context.activity)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-3.11.0 lib/contrast/utils/data_store_util.rb
contrast-agent-3.10.2 lib/contrast/utils/data_store_util.rb
contrast-agent-3.10.1 lib/contrast/utils/data_store_util.rb
contrast-agent-3.10.0 lib/contrast/utils/data_store_util.rb
contrast-agent-3.9.1 lib/contrast/utils/data_store_util.rb
contrast-agent-3.9.0 lib/contrast/utils/data_store_util.rb
contrast-agent-3.8.5 lib/contrast/utils/data_store_util.rb
contrast-agent-3.8.4 lib/contrast/utils/data_store_util.rb