Sha256: fe482b47e25e1ef782818f94ed4c70f8ff0adc4f416b3258ed2515147556b9fe

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

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

require 'contrast/components/base'
require 'contrast/components/config'

module Contrast
  module Components
    module Api
      # A wrapper build around the Common Agent Configuration project to allow
      # for Api keys to be mapped with their values contained in their
      # parent_configuration_spec.yaml.
      class Interface
        include Contrast::Components::ComponentBase

        def api_url
          @_api_url ||= ::Contrast::CONFIG.root.api.url
        end

        def api_key
          @_api_key ||= ::Contrast::CONFIG.root.api.api_key
        end

        def service_key
          @_service_key ||= ::Contrast::CONFIG.root.api.service_key
        end

        def username
          @_username ||= ::Contrast::CONFIG.root.api.user_name
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-4.13.1 lib/contrast/components/api.rb
contrast-agent-4.13.0 lib/contrast/components/api.rb