oso-cloud 1.4.0.dev.0 → 1.4.0.dev.1
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 +4 -4
- data/lib/oso/api.rb +6 -0
- data/lib/oso/oso.rb +32 -0
- 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: 7909947d74e0e8a03b13d9d1741560c6dd6537de2dbb2b3b77ef97b320e3a1a2
|
4
|
+
data.tar.gz: bdbdf26e703535dd4fd52a05ac6454a51a7cf204a9c365333c5b9c8246973cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7966031165d172979505d5f1c513445427b2950ff50fa7eccda9933174e32f4fbf8ea5fdff1d77a70a195124a7c6864136e1819b8ad0fda98da1285aa93dc1ff
|
7
|
+
data.tar.gz: 833fcf6b1cb18a83c53b39f3d5f6179b4895d6899189852423574f8f29843f94bdc29f148548c9f3eee6ed8c38fa897c763cbd83d959aaccc355c75c5091dc13
|
data/lib/oso/api.rb
CHANGED
@@ -367,6 +367,12 @@ module OsoCloud
|
|
367
367
|
results.map { |result| ActionsResult.new(**result.body) }
|
368
368
|
end
|
369
369
|
|
370
|
+
def post_bulk_actions(data)
|
371
|
+
url = '/bulk_actions'
|
372
|
+
results = POST(url, nil, data, false)
|
373
|
+
results.map { |result| ActionsResult.new(**result) }
|
374
|
+
end
|
375
|
+
|
370
376
|
def post_query(data)
|
371
377
|
url = '/query'
|
372
378
|
result = POST(url, nil, data, false)
|
data/lib/oso/oso.rb
CHANGED
@@ -303,6 +303,38 @@ module OsoCloud
|
|
303
303
|
end
|
304
304
|
@api.post_actions_batch(data).map { |result| result.results}
|
305
305
|
end
|
306
|
+
|
307
|
+
##
|
308
|
+
# List authorized actions for a batch of queries
|
309
|
+
#
|
310
|
+
# Fetches a list of actions which an actor can perform on a particular resource.
|
311
|
+
#
|
312
|
+
# @param actor [OsoCloud::Value]
|
313
|
+
# @param queries [Array<OsoCloud::Value>] | Array<[OsoCloud::Value, Array<fact>]>
|
314
|
+
# @return [Array<Array<String>>]
|
315
|
+
# @see Oso for more information about facts
|
316
|
+
def bulk_actions(actor, queries:)
|
317
|
+
actor_typed_id = actor.to_api_value
|
318
|
+
data = queries.map do |q|
|
319
|
+
context_facts = []
|
320
|
+
resource = nil
|
321
|
+
if (q.is_a?(Array))
|
322
|
+
resource = q[0]
|
323
|
+
context_facts = q[1]
|
324
|
+
else
|
325
|
+
resource = q
|
326
|
+
end
|
327
|
+
resource_typed_id = resource.to_api_value
|
328
|
+
OsoCloud::Core::ActionsQuery.new(
|
329
|
+
actor_type: actor_typed_id.type,
|
330
|
+
actor_id: actor_typed_id.id,
|
331
|
+
resource_type: resource_typed_id.type,
|
332
|
+
resource_id: resource_typed_id.id,
|
333
|
+
context_facts: OsoCloud::Helpers.params_to_facts(context_facts)
|
334
|
+
)
|
335
|
+
end
|
336
|
+
@api.post_bulk_actions(data).map { |result| result.results}
|
337
|
+
end
|
306
338
|
end
|
307
339
|
|
308
340
|
end
|
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.4.0.dev.
|
4
|
+
version: 1.4.0.dev.1
|
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-10-
|
11
|
+
date: 2023-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|