Sha256: d3a6704994cbd81923b41def221b155e826a295529af466f1118f36fc17a313b

Contents?: true

Size: 793 Bytes

Versions: 2

Compression:

Stored size: 793 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 Config
    # This module is holding all the Env Variables that we could use through the agent lifecycle
    module EnvVariables
      ENV_VARIABLES = {
          telemetry_opt_outs: ENV['CONTRAST_AGENT_TELEMETRY_OPTOUT'].to_s || Contrast::Config::DefaultValue.new('false')
      }.cs__freeze

      def return_value key
        return unless ENV_VARIABLES.key?(key.to_sym)

        sym_key = key.downcase.to_sym
        return_val = ENV_VARIABLES[sym_key]
        if return_val.is_a?(Contrast::Config::DefaultValue)
          return_val.value
        else
          return_val
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-4.13.1 lib/contrast/config/env_variables.rb
contrast-agent-4.13.0 lib/contrast/config/env_variables.rb