aserto 0.30.5 → 0.30.6

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: 786e21dcb6f94db6860b19aff5c7c8086bf02ffc0ca6d6a5914cc9502dc9af2c
4
+ data.tar.gz: d134a1bf4da055712fc873b78b1695db5cc89390fede9a5982aaa02388e4e84a
5
5
  SHA512:
6
- metadata.gz: d3716fee481ad215c925f4d60cd44996ea41d8fc33eb28926754dbea2fa759b5bddbff3ffcd6a0b92d929364a9885c6eaecef9afadccd6311ee41bd9f9aa1d08
7
- data.tar.gz: 239b076745455101d912232a621f35c62bb3617e15c5e0fad36a3781ee28ee4021e88515cb465b3beb794237cb7ed6267f4f96e62c096a1c2af5e96cd0d945e1
6
+ metadata.gz: 57f197d7d08efb0ffe37041804977de4be0c6a500ae7ef7c784f5d4e35686000ae2039ddde79d946651c01b0fcf2a1bbeae209fcd6255c0f982062b54d127326
7
+ data.tar.gz: 0131a6051e4a3e20c20de1514f5fba8ca14bb44ae257d611d5d97dad9663bb4bd36ca26f851df25c2669bbc2182116e48f7d0743c903687dd51915dc8168fde3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.30.5
1
+ 0.30.6
@@ -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
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.30.6
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-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aserto-authorizer