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 +4 -4
- data/lib/swa/cli/iam_command.rb +30 -0
- data/lib/swa/iam/role.rb +5 -0
- data/lib/swa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0863918be3963c4a4fefbf9f7d4c7f049617cf5e6b9fe53ca1d3743eace7c364'
|
4
|
+
data.tar.gz: d1d2972dbcfd1c90379202aabc80dbc4968c231bf27054842270d98aae5a6e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb11477f1210b8a6e766a0ed9b3623d60d4a7cc4b95b643cf2b634e95cb4230c024e5853e7cf4b71bc789cd006885d5ab7313275739bc7d31daf706739d2d6f
|
7
|
+
data.tar.gz: e7c298215ee0cf718992d8afde6b78ab1c8e00b25a82d3f8cd45615112bc544db33791350abb2698991f5b0d9e3d711fefaf8c38dcc4341c5664c3eaab326814
|
data/lib/swa/cli/iam_command.rb
CHANGED
@@ -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
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.
|
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-
|
11
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|