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)


214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/cerbos/output/check_resources.rb', line 214

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:



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/cerbos/output/check_resources.rb', line 214

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