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)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/cerbos/output/check_resources.rb', line 156

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)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/cerbos/output/check_resources.rb', line 156

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)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/cerbos/output/check_resources.rb', line 156

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:



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/cerbos/output/check_resources.rb', line 156

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