lib/contrast/agent/protect/policy/rule_applicator.rb in contrast-agent-6.1.0 vs lib/contrast/agent/protect/policy/rule_applicator.rb in contrast-agent-6.1.1
- old
+ new
@@ -36,11 +36,11 @@
# @raise [Contrast::SecurityException] on block, will pass the
# exception from the rule
def apply_rule method, exception, properties, object, args
invoke(method, exception, properties, object, args)
rescue Contrast::SecurityException => e
- raise e
+ raise(e)
rescue StandardError => e
logger.error('Error applying protect rule', e, module: object.cs__class.cs__name, method: method,
rule: rule_name)
end
@@ -62,26 +62,26 @@
# @param _args [Array<Object>] the arguments passed to the triggering
# method at invocation
# @raise [Contrast::SecurityException] on block, will pass the
# exception from the rule
def invoke _method, _exception, _properties, _object, _args
- raise NoMethodError, 'This is abstract, override it.'
+ raise(NoMethodError, 'This is abstract, override it.')
end
# The name of the rule, as expected by the Contrast Service and Contrast UI.
#
# @return [String]
def rule_name
- raise NoMethodError, 'This is abstract, override it.'
+ raise(NoMethodError, 'This is abstract, override it.')
end
# The rule for which this applicator applies. It'll be a concrete
# sub-class of Contrast::Agent::Protect::Rule::Base, found based on
# the value of Contrast::Agent::Protect::Policy::RuleApplicator#name.
#
# @return [Contrast::Agent::Protect::Rule::Base]
def rule
- ::Contrast::PROTECT.rule rule_name
+ ::Contrast::PROTECT.rule(rule_name)
end
# Should we skip analysis for this rule for this method invocation?
# This allows us to short circuit in those cases for which the rule
# will not apply.