swa 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5395b32bb927c4ec8f2ce5d25a63ee6b63050e84a8e0d45495a93bb7c44255c2
4
- data.tar.gz: ac4ca651c8331b4504e8631f50ed04422fed4d0bf64d463493ee1ae2cdf0fefa
3
+ metadata.gz: '0863918be3963c4a4fefbf9f7d4c7f049617cf5e6b9fe53ca1d3743eace7c364'
4
+ data.tar.gz: d1d2972dbcfd1c90379202aabc80dbc4968c231bf27054842270d98aae5a6e00
5
5
  SHA512:
6
- metadata.gz: 1c7236e0302c1877965f1343676d51ac383e0f78fd7221521782c5a2569fc0b6aa1e005d10028189652b1173b748adbb0f6c9f3ea50568bb79b3380d345b8593
7
- data.tar.gz: 38219530e62eaa9aae49150dd249265565d738d0981ae6ed1f39f52f4573fdec9011185fb55ec3639069f9a4445ad4c2fb6c2d84d581d12d0c883ae9f56ceb21
6
+ metadata.gz: dcb11477f1210b8a6e766a0ed9b3623d60d4a7cc4b95b643cf2b634e95cb4230c024e5853e7cf4b71bc789cd006885d5ab7313275739bc7d31daf706739d2d6f
7
+ data.tar.gz: e7c298215ee0cf718992d8afde6b78ab1c8e00b25a82d3f8cd45615112bc544db33791350abb2698991f5b0d9e3d711fefaf8c38dcc4341c5664c3eaab326814
@@ -214,6 +214,36 @@ module Swa
214
214
 
215
215
  end
216
216
 
217
+ subcommand "trust-policy", "print AssumeRolePolicyDocument" do
218
+
219
+ self.default_subcommand = "data"
220
+
221
+ subcommand ["data", "d"], "Display as data" do
222
+
223
+ parameter "[QUERY]", "JMESPath expression"
224
+
225
+ def execute
226
+ display_data(trust_policy_data, query)
227
+ end
228
+
229
+ private
230
+
231
+ def trust_policy_data
232
+ JSON.parse(role.assume_role_policy_document)
233
+ end
234
+
235
+ end
236
+
237
+ subcommand ["document", "doc"], "Print source document" do
238
+
239
+ def execute
240
+ puts role.assume_role_policy_document
241
+ end
242
+
243
+ end
244
+
245
+ end
246
+
217
247
  end
218
248
 
219
249
  subcommand ["roles"], "Show roles" do
data/lib/swa/iam/role.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "swa/resource"
2
2
  require "swa/iam/credentials"
3
3
  require "swa/iam/role_policy"
4
+ require "uri"
4
5
 
5
6
  module Swa
6
7
  module IAM
@@ -27,6 +28,10 @@ module Swa
27
28
  RolePolicy.new(role.policy(name))
28
29
  end
29
30
 
31
+ def assume_role_policy_document
32
+ URI.decode_uri_component(role.assume_role_policy_document)
33
+ end
34
+
30
35
  private
31
36
 
32
37
  alias_method :role, :aws_resource
data/lib/swa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Swa
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler