aserto 0.30.5 → 0.31.0

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: 8139b6f6794fd81dab6d33fbe2caeb16901c017ac5721a205bc39fdbba89cbac
4
- data.tar.gz: 67299415f49c6bed4d56b47abd21df02e73442033a68d1821e9e6af627c332e1
3
+ metadata.gz: 5ab86a73b764ff52a37e91ec3b99c83f7e1bab0067400b69eb0826780a928f9f
4
+ data.tar.gz: f4d486cd8f7a4ac1f12df87cfa4c9dad019a72a8f14460715a4c3e4e9b322f88
5
5
  SHA512:
6
- metadata.gz: d3716fee481ad215c925f4d60cd44996ea41d8fc33eb28926754dbea2fa759b5bddbff3ffcd6a0b92d929364a9885c6eaecef9afadccd6311ee41bd9f9aa1d08
7
- data.tar.gz: 239b076745455101d912232a621f35c62bb3617e15c5e0fad36a3781ee28ee4021e88515cb465b3beb794237cb7ed6267f4f96e62c096a1c2af5e96cd0d945e1
6
+ metadata.gz: 90042a66380156b1c7d3685342cfb19c7b33785cf52f4acd5672fc78f3b51a389036ad462166df79ecf2aebe46581832bf45e1a992c05842dfa13dc336c72bab
7
+ data.tar.gz: c4be8af2639c9efb0aa75a0e1da04cd0df0d1572c7ecac01e06caeeb7afa0d50109b3b32bdc6c3f684391a2cb158a54d19ea43c8b3f0b2cd35b866120abaf0be
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.30.5
1
+ 0.31.0
@@ -33,21 +33,27 @@ module Aserto
33
33
  exec_is(request_is(config.decision))
34
34
  end
35
35
 
36
- def check(object_id:, object_type:, relation:)
36
+ def check(object_id:, object_type:, relation:, options: {})
37
37
  resource_context_fields = {
38
38
  object_id: object_id,
39
39
  object_type: object_type,
40
40
  relation: relation
41
- }.merge!(resource_context.to_h)
41
+ }
42
42
 
43
43
  check_resource_context = Google::Protobuf::Struct
44
44
  .from_hash(resource_context_fields.transform_keys!(&:to_s))
45
45
 
46
+ policy_path = if options[:policy_path]
47
+ options[:policy_path]
48
+ else
49
+ config.policy_root ? "#{config.policy_root}.check" : "rebac.check"
50
+ end
51
+
46
52
  request = Aserto::Authorizer::V2::IsRequest.new(
47
53
  {
48
54
  policy_context: Aserto::Authorizer::V2::Api::PolicyContext.new(
49
55
  {
50
- path: config.policy_root ? "#{config.policy_root}.check" : "rebac.check",
56
+ path: policy_path,
51
57
  decisions: [config.decision]
52
58
  }
53
59
  ),
data/lib/aserto/config.rb CHANGED
@@ -56,7 +56,7 @@ module Aserto
56
56
 
57
57
  def initialize(options)
58
58
  OPTIONS.each do |key|
59
- send("#{key}=", options[key] || DEFAULT_ATTRS[key])
59
+ send(:"#{key}=", options[key] || DEFAULT_ATTRS[key])
60
60
  end
61
61
  end
62
62
  end
@@ -227,8 +227,6 @@ module Aserto
227
227
  #
228
228
  # Returns object graph from anchor to subject or object.
229
229
  #
230
- # @param [String] anchor_type
231
- # @param [String] anchor_id
232
230
  # @param [String] object_type
233
231
  # @param [String] object_id
234
232
  # @param [String] relation
@@ -239,24 +237,24 @@ module Aserto
239
237
  #
240
238
  # @example
241
239
  # directory.get_graph(
242
- # anchor_type: "user",
243
- # anchor_id: "rick@the-citadel.com",
240
+ # object_type: "user",
241
+ # object_id: "rick@the-citadel.com",
244
242
  # subject_id: "rick@the-citadel.com",
245
243
  # subject_type: "user",
246
244
  # relation: "member"
247
245
  # )
248
- def get_graph(anchor_type:, anchor_id:, object_type: "", object_id: "", relation: "", subject_type: "",
249
- subject_id: "", subject_relation: "")
246
+ def get_graph(object_type:, relation:, subject_type:, object_id: "",
247
+ subject_id: "", subject_relation: "", explain: false, trace: false)
250
248
  reader.get_graph(
251
249
  Aserto::Directory::Reader::V3::GetGraphRequest.new(
252
- anchor_type: anchor_type,
253
- anchor_id: anchor_id,
254
250
  object_type: object_type,
255
251
  object_id: object_id,
256
252
  relation: relation,
257
253
  subject_type: subject_type,
258
254
  subject_id: subject_id,
259
- subject_relation: subject_relation
255
+ subject_relation: subject_relation,
256
+ explain: explain,
257
+ trace: trace
260
258
  )
261
259
  )
262
260
  end
data/lib/aserto/errors.rb CHANGED
@@ -23,7 +23,7 @@ module Aserto
23
23
 
24
24
  def inspect
25
25
  details = %i[action conditions message].filter_map do |attribute|
26
- value = instance_variable_get "@#{attribute}"
26
+ value = instance_variable_get :"@#{attribute}"
27
27
  "#{attribute}: #{value.inspect}" if value.present?
28
28
  end.join(", ")
29
29
  "#<#{self.class.name} #{details}>"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aserto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.5
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aserto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-15 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aserto-authorizer
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.30.1
33
+ version: 0.31.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.30.1
40
+ version: 0.31.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: jwt
43
43
  requirement: !ruby/object:Gem::Requirement