awspec 0.37.6 → 0.37.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awspec/helper/finder/iam.rb +3 -1
- data/lib/awspec/matcher/be_allowed_action.rb +8 -1
- data/lib/awspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4416e8768e872b90fb8dcc26a35496e277b58bf3
|
4
|
+
data.tar.gz: 3b26effeda73934fe4fb87c57690efaa0ce136b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2234adbd7b608695f7933fcea615020777504286791e16c348ceac069ae4576c084531d21fcf5d69b4abb79125c8030154813552c3c9bfd2535996944ba37bbd
|
7
|
+
data.tar.gz: 7ecec57952c830f37b879d968e00183649e96a81b2b8d01ea8294273e783f959ccea68d34bbe52333329333e31f2423e79a5b639cca6c030575b129682db1050
|
@@ -19,12 +19,14 @@ module Awspec::Helper
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def select_policy_evaluation_results(policy_arn, action_name, resource_arn = nil)
|
22
|
+
def select_policy_evaluation_results(policy_arn, action_name, resource_arn = nil, context_entries = nil)
|
23
23
|
options = {
|
24
24
|
policy_source_arn: policy_arn,
|
25
25
|
action_names: [action_name]
|
26
26
|
}
|
27
27
|
options[:resource_arns] = [resource_arn] if resource_arn
|
28
|
+
options[:context_entries] = context_entries if context_entries
|
29
|
+
|
28
30
|
res = iam_client.simulate_principal_policy(options)
|
29
31
|
res.evaluation_results
|
30
32
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
RSpec::Matchers.define :be_allowed_action do |action_name|
|
2
2
|
match do |type|
|
3
|
-
results = type.select_policy_evaluation_results(type.resource_via_client[:arn],
|
3
|
+
results = type.select_policy_evaluation_results(type.resource_via_client[:arn],
|
4
|
+
action_name,
|
5
|
+
@resource_arn,
|
6
|
+
@context_entries)
|
4
7
|
results.find do |result|
|
5
8
|
result.eval_decision == 'allowed'
|
6
9
|
end
|
@@ -9,4 +12,8 @@ RSpec::Matchers.define :be_allowed_action do |action_name|
|
|
9
12
|
chain :resource_arn do |arn|
|
10
13
|
@resource_arn = arn
|
11
14
|
end
|
15
|
+
|
16
|
+
chain :context_entries do |context|
|
17
|
+
@context_entries = context
|
18
|
+
end
|
12
19
|
end
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.37.
|
4
|
+
version: 0.37.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|