Class: Cerbos::Output::CheckResources::Result::Metadata::Effect

Inherits:
Object
  • Object
show all
Defined in:
lib/cerbos/output/check_resources.rb

Overview

Additional information about how a policy decision was reached.

Instance Attribute Summary collapse

Instance Attribute Details

#matched_policyString (readonly)

The policy that was used to make the decision.

Returns:

  • (String)

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/cerbos/output/check_resources.rb', line 199

CheckResources::Result::Metadata::Effect = Output.new_class(:matched_policy, :matched_scope) do
  # @!attribute [r] matched_policy
  #   The policy that was used to make the decision.
  #
  #   @return [String]

  # @!attribute [r] matched_scope
  #   The policy scope that was used to make the decision.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(effect_meta)
    new(
      matched_policy: effect_meta.matched_policy,
      matched_scope: effect_meta.matched_scope
    )
  end
end

#matched_scopeString (readonly)

The policy scope that was used to make the decision.

Returns:

  • (String)

See Also:


199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/cerbos/output/check_resources.rb', line 199

CheckResources::Result::Metadata::Effect = Output.new_class(:matched_policy, :matched_scope) do
  # @!attribute [r] matched_policy
  #   The policy that was used to make the decision.
  #
  #   @return [String]

  # @!attribute [r] matched_scope
  #   The policy scope that was used to make the decision.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(effect_meta)
    new(
      matched_policy: effect_meta.matched_policy,
      matched_scope: effect_meta.matched_scope
    )
  end
end