# 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 Assess # 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 Assess product. class Interface include Contrast::Components::ComponentBase include Contrast::Components::Interface access_component :settings def enabled? return false unless defined?(Contrast::Agent::FeatureState) state.assess_enabled? end def tainted_columns SETTINGS.tainted_columns end def forcibly_disabled? state.assess_forcibly_disabled? end def rule_disabled? name state.assess_rule_disabled? name end def disabled_rules state.assess_disabled_rules end def scan_response? state.scan_response? end def track_frozen_sources? state.assess_track_frozen_sources? end def require_scan? state.require_scanning_enabled? end def tags state.assess_tags end def rules SETTINGS.assess_rules end def rule name SETTINGS.assess_rules[name] end end COMPONENT_INTERFACE = Interface.new end end end