Class: Microsandbox::SnapshotVerifyReport
- Inherits:
-
Object
- Object
- Microsandbox::SnapshotVerifyReport
- Defined in:
- lib/microsandbox/snapshot.rb
Overview
The result of Microsandbox::Snapshot.verify. Since runtime v0.6.9 payload integrity is
recorded only when the snapshot was created with record_integrity: true:
such snapshots report :verified (an integrity mismatch raises
SnapshotIntegrityError instead of returning), snapshots without recorded
integrity report :not_recorded with algorithm/content_digest nil.
Instance Attribute Summary collapse
-
#algorithm ⇒ String?
readonly
Digest algorithm (nil when :not_recorded).
-
#content_digest ⇒ String?
readonly
Matched content digest (nil when :not_recorded).
-
#digest ⇒ String
readonly
Descriptor digest.
-
#path ⇒ String
readonly
Artifact directory path.
-
#status ⇒ Symbol
readonly
:verified or :not_recorded.
Instance Method Summary collapse
-
#initialize(data) ⇒ SnapshotVerifyReport
constructor
A new instance of SnapshotVerifyReport.
-
#verified? ⇒ Boolean
Whether content integrity was recorded and matched.
Constructor Details
#initialize(data) ⇒ SnapshotVerifyReport
Returns a new instance of SnapshotVerifyReport.
135 136 137 138 139 140 141 |
# File 'lib/microsandbox/snapshot.rb', line 135 def initialize(data) @digest = data["digest"] @path = data["path"] @status = data["upper_status"].to_sym @algorithm = data["upper_algorithm"] @content_digest = data["upper_digest"] end |
Instance Attribute Details
#algorithm ⇒ String? (readonly)
Returns digest algorithm (nil when :not_recorded).
131 132 133 |
# File 'lib/microsandbox/snapshot.rb', line 131 def algorithm @algorithm end |
#content_digest ⇒ String? (readonly)
Returns matched content digest (nil when :not_recorded).
133 134 135 |
# File 'lib/microsandbox/snapshot.rb', line 133 def content_digest @content_digest end |
#digest ⇒ String (readonly)
Returns descriptor digest.
125 126 127 |
# File 'lib/microsandbox/snapshot.rb', line 125 def digest @digest end |
#path ⇒ String (readonly)
Returns artifact directory path.
127 128 129 |
# File 'lib/microsandbox/snapshot.rb', line 127 def path @path end |
#status ⇒ Symbol (readonly)
Returns :verified or :not_recorded.
129 130 131 |
# File 'lib/microsandbox/snapshot.rb', line 129 def status @status end |
Instance Method Details
#verified? ⇒ Boolean
Returns whether content integrity was recorded and matched.
144 |
# File 'lib/microsandbox/snapshot.rb', line 144 def verified? = @status == :verified |