Class: Cerbos::Output::CheckResources::Result::Resource

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

Overview

A resource that was checked.

Instance Attribute Summary collapse

Instance Attribute Details

#idString (readonly)

The unique identifier of the resource.

Returns:

  • (String)

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cerbos/output/check_resources.rb', line 141

CheckResources::Result::Resource = Output.new_class(:kind, :id, :policy_version, :scope) do
  # @!attribute [r] kind
  #   The type of resource.
  #
  #   @return [String]

  # @!attribute [r] id
  #   The unique identifier of the resource.
  #
  #   @return [String]

  # @!attribute [r] policy_version
  #   The policy version against which the check was performed.
  #
  #   @return [String]

  # @!attribute [r] scope
  #   The policy scope against which the check was performed.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(resource)
    new(
      kind: resource.kind,
      id: resource.id,
      policy_version: resource.policy_version,
      scope: resource.scope
    )
  end
end

#kindString (readonly)

The type of resource.

Returns:

  • (String)

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cerbos/output/check_resources.rb', line 141

CheckResources::Result::Resource = Output.new_class(:kind, :id, :policy_version, :scope) do
  # @!attribute [r] kind
  #   The type of resource.
  #
  #   @return [String]

  # @!attribute [r] id
  #   The unique identifier of the resource.
  #
  #   @return [String]

  # @!attribute [r] policy_version
  #   The policy version against which the check was performed.
  #
  #   @return [String]

  # @!attribute [r] scope
  #   The policy scope against which the check was performed.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(resource)
    new(
      kind: resource.kind,
      id: resource.id,
      policy_version: resource.policy_version,
      scope: resource.scope
    )
  end
end

#policy_versionString (readonly)

The policy version against which the check was performed.

Returns:

  • (String)

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cerbos/output/check_resources.rb', line 141

CheckResources::Result::Resource = Output.new_class(:kind, :id, :policy_version, :scope) do
  # @!attribute [r] kind
  #   The type of resource.
  #
  #   @return [String]

  # @!attribute [r] id
  #   The unique identifier of the resource.
  #
  #   @return [String]

  # @!attribute [r] policy_version
  #   The policy version against which the check was performed.
  #
  #   @return [String]

  # @!attribute [r] scope
  #   The policy scope against which the check was performed.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(resource)
    new(
      kind: resource.kind,
      id: resource.id,
      policy_version: resource.policy_version,
      scope: resource.scope
    )
  end
end

#scopeString (readonly)

The policy scope against which the check was performed.

Returns:

  • (String)

See Also:


141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cerbos/output/check_resources.rb', line 141

CheckResources::Result::Resource = Output.new_class(:kind, :id, :policy_version, :scope) do
  # @!attribute [r] kind
  #   The type of resource.
  #
  #   @return [String]

  # @!attribute [r] id
  #   The unique identifier of the resource.
  #
  #   @return [String]

  # @!attribute [r] policy_version
  #   The policy version against which the check was performed.
  #
  #   @return [String]

  # @!attribute [r] scope
  #   The policy scope against which the check was performed.
  #
  #   @return [String]
  #
  #   @see https://docs.cerbos.dev/cerbos/latest/policies/scoped_policies.html Scoped policies

  def self.from_protobuf(resource)
    new(
      kind: resource.kind,
      id: resource.id,
      policy_version: resource.policy_version,
      scope: resource.scope
    )
  end
end