swa 0.8.2 → 0.8.4
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/athena_command.rb +1 -2
- data/lib/swa/cli/glue_command.rb +1 -2
- data/lib/swa/cli/iam_command.rb +30 -0
- data/lib/swa/cli/kms_command.rb +2 -3
- data/lib/swa/cli/lake_formation_command.rb +1 -2
- data/lib/swa/iam/role.rb +5 -0
- data/lib/swa/record.rb +7 -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: f97ea85d4f432b6ea61fb652ce14f5ea50f1827aa3056437869f9eb6fcd28f83
|
4
|
+
data.tar.gz: 00e6d4f165f754f6dc4d03d4c45c09075b7235961527d1792eec649f8475b67e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da5a54d7e1ec1da3b3860cf27ae60e5548eb007679ff7158eb6c8e0ae7f82b49592c553b6920b230773302a7318d5f2d651ba2bfc1d5c7c37d9256bc51fc1aa6
|
7
|
+
data.tar.gz: 10134f56ec3a62439470d5f0148a8e3df4804338ff86a18c824da2795866fd1512cfab71c75f8bd9de45b1f3f5b1ab7b3c092825e4d88b6c89c47c3640bf084c
|
@@ -148,8 +148,7 @@ module Swa
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def query_for(query_method, response_key, model, **query_args)
|
151
|
-
|
152
|
-
model.list(records)
|
151
|
+
model.list_from_query(athena_client, query_method, response_key, **query_args)
|
153
152
|
end
|
154
153
|
|
155
154
|
def output_results_as_csv(result_set)
|
data/lib/swa/cli/glue_command.rb
CHANGED
@@ -211,8 +211,7 @@ module Swa
|
|
211
211
|
end
|
212
212
|
|
213
213
|
def query_for(query_method, response_key, model, **query_args)
|
214
|
-
|
215
|
-
model.list(records)
|
214
|
+
model.list_from_query(glue_client, query_method, response_key, **query_args)
|
216
215
|
end
|
217
216
|
|
218
217
|
end
|
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/cli/kms_command.rb
CHANGED
@@ -54,9 +54,8 @@ module Swa
|
|
54
54
|
::Aws::KMS::Client.new(aws_config)
|
55
55
|
end
|
56
56
|
|
57
|
-
def query_for(query_method, response_key, model)
|
58
|
-
|
59
|
-
model.list(records)
|
57
|
+
def query_for(query_method, response_key, model, **query_args)
|
58
|
+
model.list_from_query(kms_client, query_method, response_key, **query_args)
|
60
59
|
end
|
61
60
|
|
62
61
|
end
|
@@ -59,8 +59,7 @@ module Swa
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def query_for(query_method, response_key, model, **query_args)
|
62
|
-
|
63
|
-
model.list(records)
|
62
|
+
model.list_from_query(lf_client, query_method, response_key, **query_args)
|
64
63
|
end
|
65
64
|
|
66
65
|
end
|
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/record.rb
CHANGED
@@ -9,6 +9,13 @@ module Swa
|
|
9
9
|
records.lazy.map(&method(:new))
|
10
10
|
end
|
11
11
|
|
12
|
+
def self.list_from_query(client, query_method, response_key, **query_args)
|
13
|
+
records = client.public_send(query_method, **query_args).each.lazy.flat_map { |page|
|
14
|
+
page.public_send(response_key)
|
15
|
+
}
|
16
|
+
list(records)
|
17
|
+
end
|
18
|
+
|
12
19
|
def initialize(aws_record)
|
13
20
|
@aws_record = aws_record
|
14
21
|
end
|
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.4
|
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-
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|