Sha256: 31ccc3e0adec26594479b523d10180ba88d7f4e60572d4975a0d2645008a6a71

Contents?: true

Size: 985 Bytes

Versions: 8

Compression:

Stored size: 985 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 Components
    module Protect
      # A wrapper build around the Common Agent Configuration project to allow
      # for access of the values contained in its
      # parent_configuration_spec.yaml.
      # Specifically, this allows for querying the state of the Protect
      # product.
      class Interface
        include Contrast::Components::ComponentBase
        include Contrast::Components::Interface

        access_component :settings

        def enabled?
          state.protect_enabled?
        end

        def forcibly_disabled?
          state.protect_forcibly_disabled?
        end

        def rules
          SETTINGS.protect_rules
        end

        def rule name
          SETTINGS.protect_rules[name]
        end
      end

      COMPONENT_INTERFACE = Interface.new
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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