aserto 0.30.4 → 0.30.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6f6d7ede8c8254ea3a7660948f01f70ec2d59d1328676c6e479bfe4e79a2305
4
- data.tar.gz: b2314cab25c484a0c7b48254869210f11c386084bdeb2cb0a37b2024dee8716f
3
+ metadata.gz: 786e21dcb6f94db6860b19aff5c7c8086bf02ffc0ca6d6a5914cc9502dc9af2c
4
+ data.tar.gz: d134a1bf4da055712fc873b78b1695db5cc89390fede9a5982aaa02388e4e84a
5
5
  SHA512:
6
- metadata.gz: 65c36aee8d336be3016bf70ee95bd44d8ddc74d06fc1a7c0f9cc51ddff8f5a65b8282cc1160e2a6d0389be5eafaa7c2ce51fb61ce84bb9d0297cfdb6865bde2c
7
- data.tar.gz: c27fba66e09a55b63060f93596080f89eb3cdb5ee38eed73ca101ae491528abc7688a2e82879c58d187729d6ee9c3c4108b1e09c35aa7450096e8ed8d5ac7a08
6
+ metadata.gz: 57f197d7d08efb0ffe37041804977de4be0c6a500ae7ef7c784f5d4e35686000ae2039ddde79d946651c01b0fcf2a1bbeae209fcd6255c0f982062b54d127326
7
+ data.tar.gz: 0131a6051e4a3e20c20de1514f5fba8ca14bb44ae257d611d5d97dad9663bb4bd36ca26f851df25c2669bbc2182116e48f7d0743c903687dd51915dc8168fde3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.30.4
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.4
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-14 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