mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Turns out we were deleting the hash args in the validation loop without dup'ing (#3044)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
e2fe18028d
commit
a765afdbe6
2 changed files with 6 additions and 5 deletions
|
@ -93,8 +93,9 @@ class AwsIamPolicy < Inspec.resource(1)
|
|||
end
|
||||
end
|
||||
|
||||
def has_statement?(raw_criteria = {})
|
||||
def has_statement?(provided_criteria = {})
|
||||
return nil unless exists?
|
||||
raw_criteria = provided_criteria.dup # provided_criteria is used for output formatting - can't delete from it.
|
||||
criteria = has_statement__normalize_criteria(has_statement__validate_criteria(raw_criteria))
|
||||
@normalized_statements ||= has_statement__normalize_statements
|
||||
statements = has_statement__focus_on_sid(@normalized_statements, criteria)
|
||||
|
|
|
@ -19,22 +19,22 @@ class AwsSecurityGroup < Inspec.resource(1)
|
|||
end
|
||||
|
||||
def allow_in?(criteria = {})
|
||||
allow(inbound_rules, criteria)
|
||||
allow(inbound_rules, criteria.dup)
|
||||
end
|
||||
RSpec::Matchers.alias_matcher :allow_in, :be_allow_in
|
||||
|
||||
def allow_out?(criteria = {})
|
||||
allow(outbound_rules, criteria)
|
||||
allow(outbound_rules, criteria.dup)
|
||||
end
|
||||
RSpec::Matchers.alias_matcher :allow_out, :be_allow_out
|
||||
|
||||
def allow_in_only?(criteria = {})
|
||||
allow_only(inbound_rules, criteria)
|
||||
allow_only(inbound_rules, criteria.dup)
|
||||
end
|
||||
RSpec::Matchers.alias_matcher :allow_in_only, :be_allow_in_only
|
||||
|
||||
def allow_out_only?(criteria = {})
|
||||
allow_only(outbound_rules, criteria)
|
||||
allow_only(outbound_rules, criteria.dup)
|
||||
end
|
||||
RSpec::Matchers.alias_matcher :allow_out_only, :be_allow_out_only
|
||||
|
||||
|
|
Loading…
Reference in a new issue