awspec 0.37.6 → 0.37.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e41aa3a594513744d431ace78f7d9b5cbe48d19a
4
- data.tar.gz: dd884ee9d4e1ab1f7f6150e8062d6c69bbd47ab5
3
+ metadata.gz: 4416e8768e872b90fb8dcc26a35496e277b58bf3
4
+ data.tar.gz: 3b26effeda73934fe4fb87c57690efaa0ce136b4
5
5
  SHA512:
6
- metadata.gz: 328b137ab36fc507b7341e855adc1d9acdfe6eed115c50390ee08b57ffb6c07cb6281f7762596df40191c1ffe17f2cf8aa230fcb411601a60dc6b61678a8f9a7
7
- data.tar.gz: 2afdbbf071997f119ebeae58b3e69a8db54a2cc6172135953f3ac8ece326e6825a27a0530f56cadea7c7e5745b865e52e7604766963f978bf5ec98a7b43e80aa
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], action_name, @resource_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
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.37.6'
2
+ VERSION = '0.37.7'
3
3
  end
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.6
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-08 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec