Sha256: 6f445628fd022872ae22c09ac4f931e1e168ee6dbe2f5e5cbddde9ecd28ff33a

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

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

module Contrast
  module Utils
    # Determine if configuration keys is excluded from logging
    module ExcludeKey
      EXCLUDE_FROM_LOG = %w[api api_key url service_key user_name].cs__freeze
      class << self
        # Check if a config key can be logged or not
        #
        # @param key [String] key to check
        # @return[Boolean] true | false
        def excludable? key
          EXCLUDE_FROM_LOG.any? { |exclude_key| key.include? exclude_key }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 lib/contrast/utils/exclude_key.rb
contrast-agent-4.14.0 lib/contrast/utils/exclude_key.rb
contrast-agent-4.13.1 lib/contrast/utils/exclude_key.rb
contrast-agent-4.13.0 lib/contrast/utils/exclude_key.rb