Sha256: 2f3e11c17f5cba59abc9c54b575e47b6e24e2fcb1aa6d7c1f593942c3deadae8

Contents?: true

Size: 1.99 KB

Versions: 18

Compression:

Stored size: 1.99 KB

Contents

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

require 'contrast/utils/object_share'
require 'contrast/agent/reporting/settings/assess_rule'

module Contrast
  module Agent
    module Reporting
      # This module will hold all the settings from the TS responce
      module Settings
        # Application level settings for the Assess featureset.
        class Assess
          # Assess rules to disable for this application.
          #
          # @return disabled_rules [Array<String>] Array with string rule_ids
          def disabled_rules
            @_disabled_rules ||= begin
              disabled = []
              rule_settings.each_pair do |rule_id, rules_setting|
                disabled << rule_id unless rules_setting.enable
              end
              disabled
            end
          end

          # @param disabled_rules [Array] with AssessRuleID strings
          # @return disabled_rules [Array<AssessRuleID>] Array with string rule_ids
          def disabled_rules= disabled_rules
            @_disabled_rules = disabled_rules if disabled_rules.is_a?(Array)
          end

          # @return [Hash<String,Contrast::Agent::Reporting::Settings::AssessRule>] map of rule, by id, to
          #   configuration
          def rule_settings
            @_rule_settings ||= {}
          end

          # The id of a session on TeamServer under which this session of this application should report
          # Overrides that set by application.session_id (should match if provided).
          #
          # @return session_id [String, nil]
          def session_id
            @_session_id
          end

          # Set the session_id
          #
          # @param session_id [String]
          # @return session_id [String]
          def session_id= session_id
            @_session_id = session_id if session_id.is_a?(String) && !session_id.blank?
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.6.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.5.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.4.1 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.4.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.3.2 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.3.1 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.3.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.2.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.1.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-7.0.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.15.3 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.15.2 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.15.1 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.15.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.14.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.13.0 lib/contrast/agent/reporting/settings/assess.rb
contrast-agent-6.12.0 lib/contrast/agent/reporting/settings/assess.rb