lib/contrast/components/assess.rb in contrast-agent-4.5.0 vs lib/contrast/components/assess.rb in contrast-agent-4.6.0
- old
+ new
@@ -17,11 +17,11 @@
def enabled?
# config overrides if forcibly set
return false if forcibly_disabled?
return true if forcibly_enabled?
- SETTINGS.assess_enabled?
+ SETTINGS.assess_state.enabled == true
end
def tainted_columns
SETTINGS.tainted_columns
end
@@ -56,14 +56,13 @@
#
# capture_stacktrace_value -> (:ALL, :NONE, :SOME)
# node types (SourceNode, PolicyNode, TriggerNode, PropagationNode)
#
# @param policy_node [Contrast::Agent::Assess::Policy::PolicyNode] The node in question.
- # @param return [Boolean] to capture or not to capture, that is the question.
+ # @return [Boolean] to capture or not to capture, that is the question.
def capture_stacktrace? policy_node
return true if capture_stacktrace_value == :ALL
-
return false if capture_stacktrace_value == :NONE
# Below here capture_stacktrace_value must be :SOME.
return true if policy_node.cs__is_a?(Contrast::Agent::Assess::Policy::SourceNode)
return true if policy_node.cs__is_a?(Contrast::Agent::Assess::Policy::TriggerNode)
@@ -88,23 +87,19 @@
def tags
CONFIG.root.assess&.tags
end
- def rules
- SETTINGS.assess_rules
+ def disabled_rules
+ # TODO: RUBY-903
+ CONFIG.root.assess&.rules&.disabled_rules || SETTINGS.assess_state.disabled_assess_rules || []
end
private
def forcibly_enabled?
@_forcibly_enabled = true?(CONFIG.root.assess.enable) if @_forcibly_enabled.nil?
@_forcibly_enabled
- end
-
- def disabled_rules
- # TODO: RUBY-903
- CONFIG.root.assess&.rules&.disabled_rules || SETTINGS.disabled_assess_rules || []
end
end
COMPONENT_INTERFACE = Interface.new
end