Class: Gem::Guardian::VerificationResult

Inherits:
Data
  • Object
show all
Defined in:
lib/gem/guardian/verifier.rb

Overview

Result object for a single verification attempt.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actual_sha256Object (readonly)

Returns the value of attribute actual_sha256

Returns:

  • (Object)

    the current value of actual_sha256



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#artifact_pathObject (readonly)

Returns the value of attribute artifact_path

Returns:

  • (Object)

    the current value of artifact_path



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#checksum_sourceObject (readonly)

Returns the value of attribute checksum_source

Returns:

  • (Object)

    the current value of checksum_source



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#dependencyObject (readonly)

Returns the value of attribute dependency

Returns:

  • (Object)

    the current value of dependency



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#expected_sha256Object (readonly)

Returns the value of attribute expected_sha256

Returns:

  • (Object)

    the current value of expected_sha256



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#registry_checksum_providerObject (readonly)

Returns the value of attribute registry_checksum_provider

Returns:

  • (Object)

    the current value of registry_checksum_provider



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#registry_checksum_uriObject (readonly)

Returns the value of attribute registry_checksum_uri

Returns:

  • (Object)

    the current value of registry_checksum_uri



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#registry_sha256Object (readonly)

Returns the value of attribute registry_sha256

Returns:

  • (Object)

    the current value of registry_sha256



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem/guardian/verifier.rb', line 28

VerificationResult = Data.define(:dependency, :expected_sha256, :actual_sha256, :artifact_path, :status, :error,
                                 :checksum_source, :registry_sha256, :registry_checksum_provider,
                                 :registry_checksum_uri) do
  # Indicates whether the verification result is successful.
  #
  # For +:artifact+ results, success means the artifact digest was recorded,
  # not that an independent checksum comparison occurred.
  #
  # @return [Boolean] +true+ when +status+ is +:ok+
  def ok?
    status == :ok
  end
end

Instance Method Details

#ok?Boolean

Indicates whether the verification result is successful.

For +:artifact+ results, success means the artifact digest was recorded, not that an independent checksum comparison occurred.

Returns:

  • (Boolean)

    +true+ when +status+ is +:ok+



37
38
39
# File 'lib/gem/guardian/verifier.rb', line 37

def ok?
  status == :ok
end