oso-cloud 1.3.0.dev.5 → 1.3.0.dev.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oso/oso.rb +28 -12
- data/lib/oso/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: 14b5b319f475adefc2e05c6bf2e9cf6f22b20164d38fb9c1cb59b1b7c6c291ee
|
4
|
+
data.tar.gz: d9d50d1adcc35c04309b65cde6d2d802eec75ccdd62d6b2d5e05907e7bb9806f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8f770aaefda73dba90e6410be04dec0dc5ec1089535d7977f1aa5bd1d6310023954c6e2aae3e1d6c9e458ef2ceb5df58cf7dd16bc3c3183036da4965fcdaf02
|
7
|
+
data.tar.gz: 669d14ebf88e20a6f2a1bebdc609a7bda2e3eb6c20fc3d5eb7f4efa2b686ea611bc5a7ad28dcd4cd450a36226f1df5594daa09927a755d91ab97abe819363181
|
data/lib/oso/oso.rb
CHANGED
@@ -270,21 +270,37 @@ module OsoCloud
|
|
270
270
|
OsoCloud::Helpers.facts_to_params(result.results)
|
271
271
|
end
|
272
272
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
273
|
+
##
|
274
|
+
# List authorized actions for a batch of queries
|
275
|
+
#
|
276
|
+
# Fetches a list of actions which an actor can perform on a particular resource.
|
277
|
+
#
|
278
|
+
# @param actor [OsoCloud::Value]
|
279
|
+
# @param queries [Array<OsoCloud::Value>] | Array<[OsoCloud::Value, Array<fact>]>
|
280
|
+
# @return [Array<Array<String>>]
|
281
|
+
# @see Oso for more information about facts
|
282
|
+
def actions_batch(actor, queries:)
|
283
|
+
actor_typed_id = actor.to_api_value
|
284
|
+
data = queries.map do |q|
|
285
|
+
context_facts = []
|
286
|
+
resource = nil
|
287
|
+
if (q.is_a?(Array))
|
288
|
+
resource = q[0]
|
289
|
+
context_facts = q[1]
|
290
|
+
else
|
291
|
+
resource = q
|
292
|
+
end
|
293
|
+
resource_typed_id = resource.to_api_value
|
294
|
+
OsoCloud::Core::ActionsQuery.new(
|
295
|
+
actor_type: actor_typed_id.type,
|
296
|
+
actor_id: actor_typed_id.id,
|
297
|
+
resource_type: resource_typed_id.type,
|
298
|
+
resource_id: resource_typed_id.id,
|
299
|
+
context_facts: OsoCloud::Helpers.params_to_facts(context_facts)
|
300
|
+
)
|
284
301
|
end
|
285
302
|
@api.post_actions_batch(data).map { |result| result.results}
|
286
303
|
end
|
287
304
|
end
|
288
305
|
|
289
306
|
end
|
290
|
-
|
data/lib/oso/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oso-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0.dev.
|
4
|
+
version: 1.3.0.dev.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oso Security, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|